[ 
http://jira.jboss.com/jira/browse/JBAS-1552?page=comments#action_12316835 ]
     
Scott M Stark commented on JBAS-1552:
-------------------------------------

The change in setting the serialVersionUID is sufficient if there are no serial 
fields involved, however if there are, then the serialPersistentFields must be 
conditionally set and readObject/writeObject methods added to control the names 
of the fields to read/write. For example, the 
javax.enterprise.deploy.spi.status.ProgressEvent changes include:

   /** @since 4.0.2 */
   static final long serialVersionUID;

   // Constants -----------------------------------------------------
   /**
    * These field names match the j2ee 1.4.1 ri version names
    */
   private static final ObjectStreamField[] serialPersistentFields;
   private static final int STATUS_IDX = 0;
   private static final int MODULE_ID_IDX = 1;

   static
   {
      if (SerialVersion.version == SerialVersion.LEGACY)
      {
         serialVersionUID = 3097551795061550569L;
         serialPersistentFields = new ObjectStreamField[] {
         /** @serialField statuscode DeploymentStatus current deployment status 
*/
         new ObjectStreamField("status", DeploymentStatus.class),
         /** @serialField targetModuleID TargetModuleID id of the event target 
*/
         new ObjectStreamField("moduleID", TargetModuleID.class)
         };
      }
      else
      {
         // j2ee 1.4.1 RI values
         serialVersionUID = 7815118532096485937L;
         serialPersistentFields = new ObjectStreamField[] {
         /** @serialField statuscode DeploymentStatus current deployment status 
*/
         new ObjectStreamField("statuscode", DeploymentStatus.class),
         /** @serialField targetModuleID TargetModuleID id of the event target 
*/
         new ObjectStreamField("targetModuleID", TargetModuleID.class)
         };         
      }
   }

...

   private void readObject(ObjectInputStream ois)
      throws ClassNotFoundException, IOException
   {
      ObjectInputStream.GetField fields = ois.readFields();
      String name = serialPersistentFields[STATUS_IDX].getName();
      this.status = (DeploymentStatus) fields.get(name, null);
      name = serialPersistentFields[MODULE_ID_IDX].getName();
      this.moduleID = (TargetModuleID) fields.get(name, null);
   }

   private void writeObject(ObjectOutputStream oos)
      throws IOException
   {
      // Write j2ee 1.4.1 RI field names
      ObjectOutputStream.PutField fields =  oos.putFields();
      String name = serialPersistentFields[STATUS_IDX].getName();
      fields.put(name, status);
      name = serialPersistentFields[MODULE_ID_IDX].getName();
      fields.put(name, moduleID);
      oos.writeFields();
   }


> 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
>  Attachments: build.properties, build.xml
>
>
> 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
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to