NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

EJB development with Maven, making it easier and more fool proof.

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
rjdkolb
Posted via mailing list.





PostPosted: Tue Mar 16, 2010 9:50 am    Post subject: EJB development with Maven, making it easier and more fool proof. Reply with quote

Hello

Relating to this issue :
https://glassfish.dev.java.net/issues/show_bug.cgi?id=11642
I have been thinking quite a bit on how to solve this tripping up
developers.

Here is the example of what is happening now :
1) Start NetBeans 6.8
2) Create EJB Maven project
3) Create a stateless session bean classed Stateless1 and local
interface Stateless1Local
4) Create a stateless session bean classed Stateless2 and local
interface Stateless2Local
5) Add a member to Stateless2 'private Logger logger =
Logger.getLogger(Stateless2.class);'
6) Add add a Maven dep 'log4j:log4j'
7) deploy application to GlassFish 3
Cool Go to the GlassFish 3 admin gui. Click on the deployed project.
Stateless2 will be missing
9) A log is created in the server.log that indicated Stateless2 has a
ClassNotFoundException
10) This is because Maven's EJB package does not bundle libs

Here is the example of what is happening now with normal NetBeans
projects:
1) Start NetBeans 6.8
2) Create EJB NetBeans project
3) Create a stateless session bean classed StatelessA and local
interface StatelessALocal
4) Create a stateless session bean classed StatelessB and local
interface StatelessALocal
5) Add a member to StatelessB 'private Logger logger =
Logger.getLogger(StatelessB.class);'
6) Add add a NB dep library
7) deploy application to GlassFish 3
Cool Go to the GlassFish 3 admin gui. Click on the deployed project.
StatelessA and StatelessB are there
9) This is because NetBeans's EJB package bundle libs


There is a simple solution to solve this.
Add the following to the Maven pom.xml
http://maven.apache.org/plugins/maven-assembly-plugin/usage.html

Obviously not bundling all the libs with the project is a feature, but
it is an advanced feature.

I propose adding a feature request for NetBeans to add a tick box when
creating a Maven EJB to add this Maven plugin.


regards
Richard
Back to top
mvfranz



Joined: 12 Jan 2010
Posts: 111

PostPosted: Tue Mar 16, 2010 10:40 am    Post subject: EJB development with Maven, making it easier and more fool proof. Reply with quote

I have used the assembly plugin, but I use it as the last step to create a zip file.
Back to top
Richard Kolb
Posted via mailing list.





PostPosted: Tue Mar 16, 2010 10:52 am    Post subject: EJB development with Maven, making it easier and more fool proof. Reply with quote

Hi Michael

On 16 March 2010 12:39, Michael Franz <address-removed ([email]address-removed[/email])> wrote:
Quote:
I have used the assembly plugin, but I use it as the last step to create a zip file.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo