aspose file tools*
The moose likes Other Application Frameworks and the fly likes What's wrong with my spring config? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "What Watch "What New topic
Author

What's wrong with my spring config?

Edmund Yong
Ranch Hand

Joined: Nov 16, 2003
Posts: 164
I have the following Spring/Hibernate configuration. When I run it under WebLogic, it works fine. OFAPool is a connection pool defined in WebLogic.

However, I want to run Spring/Hibernate with my stand alone program. So I commented out the OFAPool for JndiObjectFactoryBean (since WebLogic is no longer involved), and then uncomment the second tag in the configuration below. I created a class called DevelopmentDriverManagerDataSource, which extends BasicDataSource. This will directly connect to my database.



However, when I run the stand-alone program, I got the below error. It seems that JtaTransactionManager is not set correctly. I don't understand why it works well using WebLogic's database connection pool, but not with stand-alone program. Please help. Thanks in advance.



SCJP 1.2, SCWCD 1.4
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Well, simply put, Weblogic has a JTATransactionManager that you are relying on, and when run stand-alone, you do not have one. Datasources do not provide the TransactionManager.

In your stand-alone configuration, why not change your transactionManager to the Spring TransactionManager. Actually, I thought if you use the Spring TransactionManager, it will just hook into whatever TransactionManager that is available in your environment. So in the case of Weblogic it hooks into JTA, on stand-alone, the Spring Framework provides its own.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What's wrong with my spring config?
 
Similar Threads
Help needed plzzzzz
Example for JMS sender - receiver
org.springframework.beans.factory.BeanCreationException
spring 2.5.3 / hibernate 3 sessionFactory NullPointerException
ClassNotFound using Compass + Spring...