[ 
http://jira.jboss.com/jira/browse/JBAS-1552?page=comments#action_12316170 ]
     
Adrian Brock commented on JBAS-1552:
------------------------------------

I just submitted a potential fix to JBoss Head
on how to change the SerialVersionUID to allow both j2eeri and legacy JBoss
compatibility.

In javax.resource.ResourceException:

   private static final long serialVersionUID;

   static
   {
      if (SerialVersion.version == SerialVersion.LEGACY)
         serialVersionUID = -1809703985388987999L;
      else
         serialVersionUID = 547071213627824490L;
   }

Where SerialVersion decides which version to use from a system property:
/*
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.j2ee.util;

import java.security.AccessController;
import java.security.PrivilegedAction;

/**
 * Serialization Helper.<p>
 *
 * Contains static constants and attributes to help is serialization
 * versioning.<p>
 * 
 * Set the system property <pre>org.jboss.j2ee.LegacySerialization</pre>
 * to serialization compatibility with older jboss.
 *
 * @author  <a href="mailto:[EMAIL PROTECTED]">Adrian Brock</a>.
 * @version $Revision: 1.1 $
 */
public class SerialVersion
{
   // Static --------------------------------------------------------

   /** Legacy */
   public static final int LEGACY = 0;

   /** The serialization compatible with Sun's RI */
   public static final int J2EE = 1;

   /**
    * The serialization version to use
    */
   public static int version = J2EE;

   /** Determine the serialization version */
   static
   {
      AccessController.doPrivileged(new PrivilegedAction()
      {
         public Object run()
         {
            try
            {
               if (System.getProperty("org.jboss.j2ee.LegacySerialization") != 
null)
                  version = LEGACY;
            }
            catch (Throwable ignored)
            {
            }
            return null;
         }
      });
   }
}


> JBoss use wrong version of javax.resource.ResourceException class file
> ----------------------------------------------------------------------
>
>          Key: JBAS-1552
>          URL: http://jira.jboss.com/jira/browse/JBAS-1552
>      Project: JBoss Application Server
>         Type: Bug
>   Components: JCA service
>     Versions: JBossAS-4.0.1 Final,  JBossAS-4.0.1 SP1
>  Environment: All platforms
>     Reporter: Manfred Rosenboom
>      Fix For: JBossAS-4.0.2 Final

>
>
> When passing a javax.resource.ResourceException via RMI into the JBoss 
> application server we get the following error message:
> ...
> javax.resource.ResourceException; local class incompatible: stream classdesc 
> serialVersionUID = 547071213627824490, local class serialVersionUID = 
> 4770679801401540475
>       at net.fsc.jca.tutorial.SimpleOltpConnectBean.callService(Unknown 
> Source)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:324)
>       at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
> ...
> When comparing class files, you can see, that JBoss 4.0.x doesn't use the 
> same class file as is used in Sun's j2ee.jar (J2EE 1.4 reference 
> implementation).
> Both Sun Java System Application Server Platform Edition 8.1 2005Q1 and 
> Oracle OC4J 10.1.3 use the same class file, which differes from the JBoss 
> version. So I assume, that this is a JBoss related problem.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.jboss.com/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to