GeeCON Prague 2014*
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
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.
 
Don't get me started about those stupid light bulbs.
 
subject: Injecting @Resource UserTransaction results in null