Hi Klaus,


In most cases you can solve the problem with a restart of the registry.
The  error-message shows, that the registry has different versions
of the registered  classes.
That can happen, if you recompile your sources, restart the EJBServer
and 
forget the rmiregistry.


Getting the UserTransaction in a servlet is possible, and this runs
properly.
Indeed, in the JOnAS delivery, there is a JOnAS sample which shows how
to
access an EJB in JOnAS from a servlet in Tomcat.
In this servlet, we also get the UserTransaction as the same way.
Here is the associated code:
        .....
        // We want to start transactions from client: get
UserTransaction
        UserTransaction utx = null;
        try {
                utx = (UserTransaction)PortableRemoteObject.narrow(
                    
initialContext.lookup("javax.transaction.UserTransaction"),
                                        UserTransaction.class);
        } catch (Exception e) {
            out.println("<li>Cannot lookup UserTransaction:
"+e+"</li>");
            return ;
        }
        .....

Unfortunately, a part of this sample is missing in the JOnAS 2.1.1
binary version. I send you so this complete sample in attachment.

Kind regards.
H�l�ne.

Klaus Thiele wrote:
> 
> Hello,
> 
> i'm testing tomcat-3.1 with jonas-2-1-1 and get following
> exception if the web-component initiates a usertransaction:
> 
> RemoteException occurred in server thread; nested exception is:
>  java.rmi.UnmarshalException: error unmarshalling arguments ; nested
> exception is:
>  java.io.InvalidClassException: org.objectweb.jonas.jtm.XidImpl; Local
> class not compatible: stream classdesc
> serialVersionUID=485449215958831002 local class
> serialVersionUID=8493209859767034419
> 
> ---snipp----------------------------------------
>   UserTransaction ut = (UserTransaction)PortableRemoteObject.narrow(
> 
> initial.lookup("javax.transaction.UserTransaction"),UserTransaction.class);
>   try {
>     ut.begin();
>       ...some calls to methods in some ejbs...
>     ut.commit();
>   } catch( Exception e ) {
> ---snipp----------------------------------------
> 
> any idea? (same exception with 2.0)
> 
> thanks a lot
>   klaus
> 
> --
> Klaus Thiele - Personal & Informatik AG
> mailto:[EMAIL PROTECTED]
> 
>  "There's got to be more to life than compile-and-go."
> ----
> 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".

-- 
-=- H�l�ne JOANIN -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  mailto:[EMAIL PROTECTED]   http://www.evidian.com
  Phone: 33.4.76.29.73.53            Fax: 33.4.76.29.76.00
  Download our EJB Server JOnAS at http://www.objectweb.org

security_sample.tar

Reply via email to