-
Bug
-
Resolution: Fixed
-
P4
-
1.4.2
-
x86
-
windows_2000, windows_xp
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8025289 | 8 | Sean Coffey | P3 | Closed | Fixed | b115 |
JDK-2158500 | 7u80 | Sean Coffey | P3 | Resolved | Fixed | b01 |
JDK-8060767 | 7u79 | Sean Coffey | P4 | Resolved | Fixed | b01 |
JDK-8057201 | 7u76 | Sean Coffey | P4 | Resolved | Fixed | b01 |
JDK-2142289 | 6u71 | Sean Coffey | P4 | Closed | Fixed | b01 |
JDK-2142288 | 5.0u11 | Abhijit Saha | P4 | Closed | Fixed | b01 |
FULL PRODUCT VERSION :
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)
FULL OS VERSION :
Microsoft Windows 2000 [Version 5.00.2195]
A DESCRIPTION OF THE PROBLEM :
When an org.omg.CORBA.Any type is assigned a value using an alias type (e.g. from IDL definition: typedef string myString;), the insert operation on the generated helper class (generated by the "idlj" IDL compiler) fails with a null pointer exception.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Step 1: create a file bug.idl with the following content:
// IDL file bug.idl
module bug {
typedef string myString;
};
Step 2: Translate bug.idl with the command: idlj bug.idl
This will create the file bug/myStringHelper.java
Step 3:
Create the file JavaBug.java in directory bug with the following content:
// Java file JavaBug.java
package bug;
public class JavaBug {
public static void main(String[] args) {
try {
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null);
org.omg.CORBA.Any any = orb.create_any();
myStringHelper.insert(any, "hello");
System.out.println("Any: " + myStringHelper.extract(any));
} catch( Exception e ) {
e.printStackTrace();
}
}
}
Step 4:
Compile all java files with the command: javac -d . bug\*.java
Step 5:
Execute the program with the command: java -cp . bug/JavaBug
Step 6: Note the null pointer exception in the the output!
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The following message should be printed on the console:
Any: hello
ACTUAL -
java.lang.NullPointerException
at com.sun.corba.se.internal.corba.TCUtility.unmarshalIn(TCUtility.java:290)
at com.sun.corba.se.internal.corba.AnyImpl.read_value(AnyImpl.java:561)
at bug.myStringHelper.insert(myStringHelper.java:20)
at bug.JavaBug.main(JavaBug.java:8)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.NullPointerException
at com.sun.corba.se.internal.corba.TCUtility.unmarshalIn(TCUtility.java:290)
at com.sun.corba.se.internal.corba.AnyImpl.read_value(AnyImpl.java:561)
at bug.myStringHelper.insert(myStringHelper.java:20)
at bug.JavaBug.main(JavaBug.java:8)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
// IDL file bug.idl
module bug {
typedef string myString;
};
// Java file JavaBug.java
package bug;
public class JavaBug {
public static void main(String[] args) {
try {
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, null);
org.omg.CORBA.Any any = orb.create_any();
myStringHelper.insert(any, "hello");
System.out.println("Any: " + myStringHelper.extract(any));
} catch( Exception e ) {
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
(Incident Review ID: 190857)
======================================================================
- backported by
-
JDK-2158500 unmarshal error on CORBA alias type in CORBA any
- Resolved
-
JDK-8057201 unmarshal error on CORBA alias type in CORBA any
- Resolved
-
JDK-8060767 unmarshal error on CORBA alias type in CORBA any
- Resolved
-
JDK-8025289 unmarshal error on CORBA alias type in CORBA any
- Closed
-
JDK-2142288 unmarshal error on CORBA alias type in CORBA any
- Closed
-
JDK-2142289 unmarshal error on CORBA alias type in CORBA any
- Closed
- duplicates
-
JDK-6474137 Bug 5036554 was fixed in 1.4.2_09(b02) but this fix is not fixed in 1.5.0_08-b03
- Closed
- relates to
-
JDK-6474137 Bug 5036554 was fixed in 1.4.2_09(b02) but this fix is not fixed in 1.5.0_08-b03
- Closed