quality@glassfish.java.net

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

From: Wouter van Reeven <wouter_at_van.reeven.nl>
Date: Tue, 16 Mar 2010 08:07:46 +0100

Hi Richard,


Question: did you create a Maven EJB Project or a Maven EJB Module?
Modules are supposed to be packed in an EAR, while Projects generate
stand alone jars. Just wondering what I should do to follow your steps.


Thanks, Wouter

On Tue, Mar 16, 2010 at 09:02:24AM +0200, Richard Kolb wrote:
> Hi Hong and Cats
>
> 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
> 8) 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
> 8) 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.
>
> Does this make sense ?
> Any comments will greatly be appreciated.
>
>
> regards
> Richard
>
>

-- 
Gravity brings me down
[Unknown Source]
Skype: wvreeven
Facebook: wvreeven
Twitter: wvreeven