You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by mrachell <mr...@cri-solutions.com> on 2006/05/19 17:41:51 UTC

[m2] Spring and JTA

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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Spring and JTA

Posted by Wayne Fay <wa...@gmail.com>.
Unfortunately you'll need to parse the OC4J logs (turn on full debug
mode!) and perhaps talk to Oracle about that. I personally have also
had some troubles with OAS and EARs.

Wayne

On 5/19/06, Morgan Rachell <mr...@cri-solutions.com> wrote:
>
> Thanks Jim. But I don't mind adding the Sun jars to my local repo since I
> only have to add the one dependency. Thanks for the suggestion, but I'm
> still confused about why adding a "provided" dependency changes execution of
> my EAR file.
>
>
> --
> View this message in context: http://www.nabble.com/-m2-+Spring+and+JTA-t1650845.html#a4475585
> Sent from the Maven - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Spring and JTA

Posted by Morgan Rachell <mr...@cri-solutions.com>.
Thanks Jim. But I don't mind adding the Sun jars to my local repo since I
only have to add the one dependency. Thanks for the suggestion, but I'm
still confused about why adding a "provided" dependency changes execution of
my EAR file. 


--
View this message in context: http://www.nabble.com/-m2-+Spring+and+JTA-t1650845.html#a4475585
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Spring and JTA

Posted by Jim Bethancourt <ji...@gmail.com>.
Hi Morgan,
Another idea might be to add Sun's M1 repo to your POM or config file.
 Since it's an M1 repo you'll have to list all of the dependencies,
but it's a start.  Brett had mentioned he's working with them to get
it transformed into an M2 repo, but I don't have any idea on what
their timeline is.  Hope this helps. :-)

The java.net webpage for the Maven repository project is at
https://maven-repository.dev.java.net/

The repository is located at
https://maven-repository.dev.java.net/nonav/repository/

Cheers,
Jim

On 5/19/06, Alex Mayorga Adame <al...@yahoo.com> wrote:
>
> Morgan,
>
> Please check
> http://maven.apache.org/guides/mini/guide-coping-with-sun-jars.html for a
> reference and follow this guide to install them to your local repository
> http://maven.apache.org/guides/mini/guide-installing-3rd-party-jars.html and
> this other one to deploy them to your remote repository
> http://maven.apache.org/guides/mini/guide-deploying-3rd-party-jars.html
>
> On your questions I believe that some Spring functionality relies on
> Activation, your code might compile if you're not using that functionality
> at all.
>
> Regards,
> Alex
> --
> View this message in context: http://www.nabble.com/-m2-+Spring+and+JTA-t1650845.html#a4472350
> Sent from the Maven - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] Spring and JTA

Posted by Alex Mayorga Adame <al...@yahoo.com>.
Morgan,

Please check
http://maven.apache.org/guides/mini/guide-coping-with-sun-jars.html for a
reference and follow this guide to install them to your local repository
http://maven.apache.org/guides/mini/guide-installing-3rd-party-jars.html and
this other one to deploy them to your remote repository
http://maven.apache.org/guides/mini/guide-deploying-3rd-party-jars.html

On your questions I believe that some Spring functionality relies on
Activation, your code might compile if you're not using that functionality
at all.

Regards,
Alex
--
View this message in context: http://www.nabble.com/-m2-+Spring+and+JTA-t1650845.html#a4472350
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org