[jboss-user] [EJB 3.0] - Re: JBoss 4.2.1 and EJB 3.0 Redeployment

nhelder do-not-reply at jboss.com
Tue Oct 2 16:54:17 EDT 2007


Thanks for that link jaikiran, it pointed me in the right direction.

For those curious, here's how I applied the details from that link to a ejb/war setting:

Create one (NetBeans) EJB project that contains only:
  ejb.test.SessionBean.java

Create a second EJB project that contains:
  ejb.test.interfaces.SessionLocal.java
  ejb.test.interfaces.SessionRemote.java

And then a war project that attempts to make use of the local interface.


The build file for the interfaces project produces a .jar with only the Local and Remote classes (no .xml files or other items), and deploys that .jar file to %JBOSS_HOME%/server/default/deploy

The build file for the bean project produces a .jar with the SessionBean.class file and any other items needed to deploy the bean (i.e. jboss.xml) and deploys that .jar file to the same location as the previous.

Both the bean project and the war project include references to the interfaces .jar (so they can be compiled), but don't package the interfaces .jar into their own .jar/.war files.

Deploy the interfaces first...
Then the bean...
Then the war...
And everything works fine.

Redeploy just the bean project, and everything still works fine - no ClassCastExceptions encountered.

So yeah, thanks again!

  - Nathan


PS. In my first stab, both the interfaces and the bean  files had the same package - ejb.test. This created problems when it came time for the war file to do its lookup (ClassCastExceptions once again). Splitting the interfaces and bean classes into two separate packages resolved that problem.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4090815#4090815

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4090815



More information about the jboss-user mailing list