java.lang.ClassCastException: bitronix.tm.BitronixTransactionManager cannot be cast to javax.transaction.UserTransaction

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

java.lang.ClassCastException: bitronix.tm.BitronixTransactionManager cannot be cast to javax.transaction.UserTransaction

magic.philip
Hello,

After some research, I think BTM is best for me.
However, I have some problem when I use it.

I use mysql as my backend database.
My environment does not use any framework, I just install the BTM in the Tomcat6.
Also I have put the mysql lib in the tomcat\lib folder.

No problems when Tomcat is finish startup.

However, when I execute my following code.

UserTransaction ut = null;
ut = (UserTransaction)ctx.lookup("java:comp/UserTransaction");

this does cause an exception
java.lang.ClassCastException: bitronix.tm.BitronixTransactionManager cannot be cast to javax.transaction.UserTransaction

Can you tell me how to resolve this problem?

By the way, do you have any example(with jar and simple code) which can be run in the tomcat6?

Best Regards,
Philip Chen