[jboss-user] [EJB 3.0] - MDB in seperate ejb-jar causes problem during deployment

vdweij do-not-reply at jboss.com
Fri Jul 18 10:46:59 EDT 2008

I'm fairly new to MDB and need some help. My ear has got the following structure

  |  |-- entities-ejb
  |  |        |-- META-INF
  |  |        |         |-- persistence.xml
  |  |
  |  |-- other-ejb
  |  |        |-- MyMessageDrivenBean
  |  |
  |  |-- war

The MDB caused the deployment to fail over the persistence.xml in the other jar. This is from the startup log:

xx:xx:xx,xxx WARN  [ServiceController] Problem starting service persistence.units:ear=my-ear-1.0-SNAPSHOT.ear,unitName=my-ds
  | javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
  | 	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
  | 	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
  | 	at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
  | 	at javax.naming.InitialContext.lookup(InitialContext.java:351)
  | 	at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:216)
  | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | .... and more

When I put the MDB with the entity beans everything deploys fine and the applications including messaging works perfectly.

I also tried to specify jndi.properties but this didn't seem to help.

There are posts about multiple ejb jars and entities in them sharing a single persistence.xml but I couldn't find one addressing this particular issue.

Any help is greatly appreciated!

Running Java 1.5.0_15
Jboss 4.2.2 GA
(Seam 2.0.2.SP1)

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

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

More information about the jboss-user mailing list