At Weblogic, I can get a UserTransaction instance by calling method: ctx.lookup("javax.transaction.UserTransaction").
But when I immigrate my project to JBoss, I got a NameNotFoundException
with the code above .And I found that if I use 'UserTransaction' or 'java:comp/UserTransaction' as jndi name, it will be OK.
Without modifying my programme how can I get UserTransaction with jndi name : 'javax.transaction.UserTransaction'.So at JBoss ,Is there some property file where I can change the default jndi name: UserTransaction?
(May be you will ask why don't I just change my Programme.The reason is that the programme has been used for many years,and the custom asked me to try my best to do not change it.)
I am pretty certain you have to change your program. Be careful and check the kind of object you get back. It will be a different implementation of UserTransaction and have a different transactional context dependuing on the jndi name you use.