"G.C. Miller" wrote:
>
> I am having trouble using transactions from jakarta-tomcat. I can access
> an EJB from jakarta-tomcat successfully when I am not inside a
> transaction, however if I try to create a User Transaction first I get the
> following stack trace.
>
> java.lang.ClassCastException
> at
>
>com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:296)
> at
> javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
> at com.sharkmail.controller.CTest.doIt(CTest.java:29)
> at
> com.sharkmail.controller.CMainServlet.doGet(CMainServlet.java:64)
> at
> com.sharkmail.controller.CMainServlet.doPost(CMainServlet.java:92)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
It seems that it is possible to get the UserTransaction object
in a servlet via Tomcat.
In the security sample that you can find in the Jonas release
there is the code of the servlet :
$JONAS_ROOT/examples/src/security/ejbSample/WEB-INF/classes/ServletOP.java
in which we do
UserTransaction utx = null;
try {
utx = (UserTransaction)
PortableRemoteObject.narrow(initialContext.lookup("javax.transaction.UserTransaction"),
UserTransaction.class);
} catch (Exception e) {
when we follow instruction that you will find in the
$JONAS_ROOT/examples/src/security/README
we have no problem to run this example that use Tomcat & JOnAS.
Best regards,
--
Philippe
Philippe Coq Evidian Phone: (33) 04 76 29 78 49
Bull S.A - 1 rue de Provence - 38432 Echirolles Cedex France
Download our EJBServer at http://www.objectweb.org
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".