I have a question about Spring depending on Sun's JTA. I had to include the
javax.transaction - jta in my pom using <scope>provided</scope> to get the
app to deploy and run properly.
Prior to adding that, when my application started up I kept getting this
error:
06/05/19 11:26:37 org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'blahSessionFactory' defined in ServletContext
resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed;
nested exception is java.lang.ClassCastException: null
06/05/19 11:26:37 java.lang.ClassCastException
06/05/19 11:26:37 at
org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:23)
06/05/19 11:26:37 at
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:302)
[...]
My parent pom includes spring as a dependency with this:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>1.2.7</version>
<scope>compile</scope>
</dependency>
I'm not sure why I had to do this, but I had to add this to my WAR file's
pom to get the EAR to startup:
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.0.1B</version>
<scope>provided</scope>
</dependency>
I tried using a scope of "compile" which of course included the
jta-1.0.1B.jar in the WAR which caused all kinds of other problems. A
"provided" scope enables the app to startup.
I use Maven 2.0.4, and my app depends upon Spring 1.2.7. The app runs on
OC4J 10.1.2.
I guess this leads me to two questions:
1) Why do I need to specify the JTA as a "provided" dependency in my WAR
when spring lists JTA in its own pom as "optional"?
2) Since the application compiles even without including jta as a dependency
of the WAR, what has changed in the final artifact (the EAR) that makes it
startup normally? The jar is not included in the EAR or WAR, nor is it
listed in either manifest.mf.
Thanks,
Morgan
--
View this message in context:
http://www.nabble.com/-m2-+Spring+and+JTA-t1650845.html#a4471803
Sent from the Maven - Users forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]