]
jaikiran pai commented on JBAS-8687:
------------------------------------
Thanks for explaining how/when spring starts doing that lookup. So yes, this is a known
issue with the current versions of the AS. See this for example
. The reason why you run into this
"random" behaviour is because in its current form there is no guarantee that
when the spring bean initialization starts, the ENC of the web component is fully
populated. We are currently working on a way to get past this and the goal is to try and
solve this before 6.0.0 Final.
JPA2 persistence.xml in WEB-INF\classes\META-INF\ not allways
deployed before Web context initialisation
--------------------------------------------------------------------------------------------------------
Key: JBAS-8687
URL:
https://jira.jboss.org/browse/JBAS-8687
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: EJB3
Affects Versions: 6.0.0.CR1
Environment: JBossAS [6.0.0.20101110-CR1 "Neo"]
Java Runtime: Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java VM: Java HotSpot(TM) 64-Bit Server VM 17.1-b03,Sun Microsystems Inc.
OS-System: Windows 7 6.1,amd64
Unchanged default profile, with Oracle DataSource.
Reporter: Geert Pante
Assignee: Carlo de Wolf
Labels: deployer, jpa
Attachments: persistence.xml
I'm trying to run JASig CAS (
http://www.jasig.org/cas) using the JpaTicketRegistry.
This is done by putting a persistence.xml in WEB-INF\classes\META-INF with:
<property name="jboss.entity.manager.factory.jndi.name"
value="java:jpa/CasEntityManagerFactory"/>
I refer to it from my Spring applicationContext
<jee:jndi-lookup id="entityManagerFactory"
jndi-name="java:jpa/CasEntityManagerFactory"/>.
Most of the times this starts up correctly: first deploying and binding the Persistence
Unit, and then starting the WebApplicationContext.
But once every 5 times, it starts in the wrong order: we first get
13:13:55,150 INFO [TomcatDeployment] deploy, ctxPath=/cas
13:13:55,204 INFO [[/cas]] Initializing Spring root WebApplicationContext
13:13:55,204 INFO [ContextLoader] Root WebApplicationContext: initialization started
13:13:55,208 INFO [XmlWebApplicationContext] Refreshing Root WebApplicationContext:
startup date [Tue Nov 30 13:13:55 CET 2010]; root of context hierarchy
13:13:56,039 ERROR [ContextLoader] Context initialization failed:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'entityManagerFactory': Invocation of init method failed; nested exception is
javax.naming.NameNotFoundException: jpa not bound
[...]
13:13:56,088 ERROR [StandardContext] Error filterStart
13:13:56,088 ERROR [StandardContext] Context [/cas] startup failed due to previous
errors
13:13:56,089 INFO [[/cas]] Closing Spring root WebApplicationContext
13:13:56,095 ERROR [AbstractKernelController] Error installing to Start:
name=jboss.web.deployment:war=/cas state=Create mode=Manual requiredState=Installed:
org.jboss.deployers.spi.DeploymentException: URL
file:/D:/Applications/jboss-6.0.0.CR1/server/mbip/deploy/cas-server-webapp-3.4.2.BAYER_7-SNAPSHOT.war/
deployment failed
And only after this we get:
13:13:56,113 INFO [PersistenceUnitDeployment] Starting persistence unit
persistence.unit:unitName=cas-server-webapp-3.4.2.EBIT_7-SNAPSHOT.war#CasPersistence
13:13:56,287 INFO [Version] Hibernate Commons Annotations 3.2.0.Final
13:13:56,294 INFO [Environment] Hibernate 3.6.0.Final
13:13:56,296 INFO [Environment] hibernate.properties not found
13:13:56,300 INFO [Environment] Bytecode provider name : javassist
13:13:56,304 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
13:13:56,393 INFO [Version] Hibernate EntityManager 3.6.0.Final
13:13:56,421 INFO [Ejb3Configuration] Processing PersistenceUnitInfo [
name: CasPersistence
...]
13:13:56,928 INFO [SessionFactoryImpl] building session factory
13:13:57,137 INFO [SessionFactoryObjectFactory] Factory name:
persistence.unit:unitName=cas-server-webapp-3.4.2.EBIT_7-SNAPSHOT.war#CasPersistence
13:13:57,139 INFO [NamingHelper] JNDI InitialContext
properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory,
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
13:13:57,141 INFO [SessionFactoryObjectFactory] Bound factory to JNDI name:
persistence.unit:unitName=cas-server-webapp-3.4.2.EBIT_7-SNAPSHOT.war#CasPersistence
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: