NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
rjdkolb Posted via mailing list.
|
Posted: Tue Mar 16, 2010 9:50 am Post subject: EJB development with Maven, making it easier and more fool proof. |
|
|
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
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
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
|
Posted: Tue Mar 16, 2010 10:40 am Post subject: EJB development with Maven, making it easier and more fool proof. |
|
|
| 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.
|
Posted: Tue Mar 16, 2010 10:52 am Post subject: EJB development with Maven, making it easier and more fool proof. |
|
|
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 |
|
 |
|
|
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
|
|
|