United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-5067940 : [CORBA!] POA WrongAdapter thrown on roundtrip between 1.5 and 1.4.2

Details
Type:
Bug
Submit Date:
2004-06-24
Status:
Resolved
Updated Date:
2014-02-27
Project Name:
JDK
Resolved Date:
2006-02-21
Component:
other-libs
OS:
solaris_9,windows_xp
Sub-Component:
corba:orb
CPU:
x86,sparc
Priority:
P4
Resolution:
Fixed
Affected Versions:
5.0,5.0u2
Fixed Versions:
1.4.2_12 (b01)

Related Reports

Sub Tasks

Description
Name: gm110360			Date: 06/24/2004


FULL PRODUCT VERSION :
1.5.0-beta2-b51

A DESCRIPTION OF THE PROBLEM :
[ATTENTION: I filed this against RMI, actually this is against the ORB, but there is no combination to file a Tiger ORB bug]

We're sending object references back and forth between server and client and need to be able to resolve them back to the servant.

An object reference marshalled from 1.5 to 1.4.2 and back will trigger a WrongAdapter exception on POA#reference_to_servant. With the help of a debugger I think I traced it to different ORBVersions in ObjectKeyTemplateBase#equals.

This both works 1.4.2 -> 1.4.2 and 1.5 -> 1.5

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
In order to have one test program, you need to put the old 1.4.2 orb into the bootclasspath:

* extract 1.4.2 orb from rt.jar:   jar xvf rt.jar com/sun/corba/se
* make orb.jar: jar cvf orb.jar com/sun/corba/se

compile test program and run:

java -Xbootclasspath/p:orb.jar ORBInterop

You may as well try two programs running under 1.5 and 1.4.2 respectively.


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I would expect to see:

Roundtrip J2SE 1.5 -> 1.4 -> 1.5 succeeded

ACTUAL -
Roundtrip J2SE 1.5 -> 1.4 -> 1.5 failed
org.omg.PortableServer.POAPackage.WrongAdapter: IDL:omg.org/PortableServer/POA/WrongAdapter:1.0
	at com.sun.corba.se.impl.oa.poa.POAImpl.internalReferenceToId(POAImpl.java:484)
	at com.sun.corba.se.impl.oa.poa.POAImpl.reference_to_servant(POAImpl.java:1408)
	at ORBInterop.main(ORBInterop.java:39)
	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:582)
	at com.intellij.rt.execution.application.AppMain.main(Unknown Source)


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
/*
 * Copyright (c) 2004 CoreMedia AG, Hamburg. All rights reserved.
 */

import org.omg.CORBA.ORB;
import org.omg.PortableServer.POA;
import org.omg.PortableServer.Servant;

import java.util.Properties;

public class ORBInterop {
  public static void main(String[] args) throws Exception {
    Properties orbProperties_1_5 = new Properties();
    orbProperties_1_5.put("org.omg.CORBA.ORBClass", "com.sun.corba.se.impl.orb.ORBImpl");

    Properties orbProperties_1_4 = new Properties();
    orbProperties_1_4.put("org.omg.CORBA.ORBClass", "com.sun.corba.se.internal.iiop.ORB");

    ORB server = ORB.init(new String[0], orbProperties_1_5);
    ORB client_1_5 = ORB.init(new String[0], orbProperties_1_5);
    ORB client_1_4 = ORB.init(new String[0], orbProperties_1_4);


    POA poa = (POA) server.resolve_initial_references("RootPOA");
    poa.the_POAManager().activate();

    Servant servant = new Servant() {
      public String[] _all_interfaces(POA poa, byte[] objectId) {
	return new String[] { "IDL:test/Interface:1.0" };
      }
    };

    poa.activate_object(servant);

    roundtrip(server, poa, servant, client_1_5, "1.5 -> 1.5 -> 1.5");
    roundtrip(server, poa, servant, client_1_4, "1.5 -> 1.4 -> 1.5");
  }

  static void roundtrip(ORB server, POA poa, Servant servant, ORB client, String description) throws Exception {
    String serverIor = server.object_to_string(poa.servant_to_reference(servant));

    String clientIor = client.object_to_string(client.string_to_object(serverIor));
    try {
      if(servant == poa.reference_to_servant(server.string_to_object(clientIor)))
	System.out.println(description+": roundtrip succeeded");
      else
	System.out.println(description+": roundtrip succeeded, but servants differ");

    } catch(Exception e) {
      System.out.println(description+": roundtrip failed");
      e.printStackTrace();
    }
  }
}

---------- END SOURCE ----------
(Incident Review ID: 279763) 
======================================================================

                                    

Comments
EVALUATION

We updated the ORB version to fix an interoperability problem with
java.util.Date.  We thought we had handled the version checking
problem, but apparently there is a problem here.  It is too late
to fix this problem for Tiger, so it will need to go into a future release.
                                     
2004-09-27
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
mustang


                                     
2004-09-27



Hardware and Software, Engineered to Work Together