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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Ludovic Orban-2
You must make sure btm.jar and jta.jar are in tomcat's lib folder and
are not in your web app's WEB-INF/lib folder.

On Sun, Jul 22, 2012 at 3:43 PM, PhilipChen <[hidden email]> wrote:

>
> 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
> --
> View this message in context: http://old.nabble.com/java.lang.ClassCastException%3A-bitronix.tm.BitronixTransactionManager-cannot-be-cast-to-javax.transaction.UserTransaction-tp34196305p34196305.html
> Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

magic.philip
Dear my friend,

Thankx a lot.
Because of the compiler reason, I just simply add the jta.jar in my web app's lib folder.
I think this is the root cause for the result of this Exception.
After I remove the jta.jar from my web ap and it works perfect.

Very appreciate your help again.



Best Regards,
Philip Chen

Ludovic Orban-2 wrote
You must make sure btm.jar and jta.jar are in tomcat's lib folder and
are not in your web app's WEB-INF/lib folder.

On Sun, Jul 22, 2012 at 3:43 PM, PhilipChen <ctaihua.home@gmail.com> wrote:
>
> 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
> --
> View this message in context: http://old.nabble.com/java.lang.ClassCastException%3A-bitronix.tm.BitronixTransactionManager-cannot-be-cast-to-javax.transaction.UserTransaction-tp34196305p34196305.html
> Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Loading...