aspose file tools
The moose likes EJB and other Java EE Technologies and the fly likes Injecting @Resource UserTransaction results in null Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "Injecting @Resource UserTransaction results in null" Watch "Injecting @Resource UserTransaction results in null" New topic
Author

Injecting @Resource UserTransaction results in null

B Nirvan
Ranch Hand

Joined: Oct 20, 2010
Posts: 82
I am trying to use JTA transactions (without EJB) in my JPA project. I am trying to inject UserTransaction using the following code in one of my java class


but nothing gets injected and the tran variable is null. Am I missing out any configuration steps. I am using Glassfish V3.

regards,
Nirvan.
Tim Hagberg
Greenhorn

Joined: Jan 29, 2010
Posts: 12
They need to be on the same line like this:
B Nirvan
Ranch Hand

Joined: Oct 20, 2010
Posts: 82
Thanks, but that doesn't work either.

regards,
Nirvan
B Nirvan
Ranch Hand

Joined: Oct 20, 2010
Posts: 82
Is it possible to inject @Resource UserTransaction into a non-managed object (object created with new).

regards,
Nirvan.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Injecting @Resource UserTransaction results in null
 
Similar Threads
Getting NotSupportedException while Transaction.begin.
Use of UserTransaction
UserTransaction in Hibernate
java.lang.ClassCastException:
not able to insert data in db using jpa(hibernate as provider) and jboss AS