javax.naming.NameNotFoundException: persistence not bound
rac-tech Jan 27, 2011 5:50 PMHi
I have an ear that consists of a ejb module and a war module. The SpringInitiServiceImpl (ejb) listed in the following jboss xml is in a jar file(sss.jar). The sss.jar file is in the lib folder in the ear root(ear/lib) . When this is deployed in JBoss 5, an exception is thrown(list at the bottom).
I can see that just after this exception is thrown, the persistent unit is loading.
Is this a loading sequence issue?
------------------------------------
12:04:55,542 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=sss.ear/sss.jar#smalllake-bopc
12:04:55,589 INFO [Version] Hibernate Annotations 3.4.0.GA
12:04:55,589 INFO [Environment] Hibernate 3.3.1.GA
12:04:55,605 INFO [Environment] hibernate.properties not found
12:04:55,605 INFO [Environment] Bytecode provider name : javassist
12:04:55,605 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
12:04:55,667 INFO [Version] Hibernate Commons Annotations 3.1.0.GA
12:04:55,667 INFO [Version] Hibernate EntityManager 3.4.0.GA
12:04:55,683 INFO [Ejb3Configuration] Processing PersistenceUnitInfo [
name: smalllake-bopc
-----------------------------------
Any help would be highly appreciated.
The more required details are listed below.
--------------------------------------------------------------------------------------
Struture
-----------
ear/lib
- sss.jar
........
........
ear/META-INF
-application.xml
-jboss-app.xml
ear/abc.jar
-com
-META-INF
-jboss.xml
-persistence.xml
ear/abc.war
-----------------------------------------------------------------------------------------
Error
-------
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.jboss.ejb3.service.ServiceContainer.invokeOptionalMethod(ServiceContainer.java:381)
at org.jboss.ejb3.service.ServiceContainer.create(ServiceContainer.java:206)
....
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
....
Caused by: org.springframework.beans.factory.access.BootstrapException: Unable to initialize group definition. Group resource name [classpath*:beanRefContext.xml], factory key [null]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'factoryKey' defined in URL [vfszip:/D:/JavaDev/software/jboss-5.1.0.GA/server/default/deploy/sss.ear/sss.jar/beanRefContext.xml]:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'factoryKey' defined in URL [vfszip:/D:/JavaDev/software/jboss-5.1.0.GA/server/default/deploy/sss.ear/sss.jar/beanRefContext.xml]: Instantiation of bean failed; nested exception
.............
.............
at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:384)
... 67 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'service.PrCa' defined in class path resource [spring-conf.xml]: Cannot resolve reference to bean 'delegate.PrCa' while setting bean property 'delegate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'delegate.PrCa' defined in class path resource [spring-conf.xml]: Cannot resolve reference to bean 'dao.PrOffer' while setting bean property 'PrOfferDao';
............
............
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'smalllake-bopc': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: persistence not bound
..........
..........
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'delegate.PrCa' defined in class path resource [spring-conf.xml]: Cannot resolve reference to bean 'dao.PrOffer' while setting bean property 'PrOfferDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dao.PrOffer': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'smalllake-bopc': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: persistence not bound
............
............
Caused by: javax.naming.NameNotFoundException: persistence not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
at javax.naming.InitialContext.lookup(Unknown Source)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201)
at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1400)
... 133 more