|
Quick Lists
|
|
Bug ID:
|
6267224
|
|
Votes
|
0
|
|
Synopsis
|
Migration, interoperation failures for serialized javax.xml.namespace.QName inst. betw EE 1.4,SE 5.0
|
|
Category
|
jaxp:other
|
|
Reported Against
|
|
|
Release Fixed
|
5.0u7(b01)
|
|
State
|
10-Fix Delivered,
bug
|
|
Priority:
|
4-Low
|
|
Related Bugs
|
6253903
,
6316479
,
6319377
,
6326213
,
6338891
,
6355051
|
|
Submit Date
|
09-MAY-2005
|
|
Description
|
DESCRIPTION:
===========
Under jre5.0, an attempt to de-serialize an instance of the class javax.xml.namespace.QName, results in jvm throwing a java.io.InvalidClassException exception.
ROOT CAUSE:
==========
This issue is a result of the migration of javax.xml.namespace.QName
from J2EE1.4 to J2SE5.0; the exception is thrown as a result of a mismatch between the suid reported in the ojbect file ('qnameser.obj') and the suid hard-coded into QName. Namely, in J2SE 5.0, the serialVersionUID of javax.xml.namespace.QName is declared:
private static final long serialVersionUID = 4418622981026545151L;
but in J2EE 1.4 this value is different.
JDK VERSION INFORMATION:
=======================
java version "1.5.0_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
Java HotSpot(TM) Server VM (build 1.5.0_03-b07, mixed mode)
INSTRUCTIONS TO RECREATE ISSUE:
==============================
The attached testcase and customer file demonstrate the above issue. Run the test case by typing the following at the command line:
$java QNameSerialTest d qnameser.obj
NOTE: The file qnameser.obj was created using J2EE 1.4 and is available in the 'attachments' section.
EXCEPTION DETAILS:
=================
When trying to run the test case (QNameSerialTest.java) - the following exception occurs:
Failure during deserialization.
java.io.InvalidClassException: javax.xml.namespace.QName; local class incompatible: stream classdesc serialVersionUID = -9120448754896609940, local class serialVersionUID = 4418622981026545151
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:519)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
at QNameSerialTest.main(QNameSerialTest.java:37)
TESTCASE:
========
import javax.xml.namespace.QName;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.FileInputStream;
import java.io.FileOutputStream;
//Tests customer serialization and deserialization of javax.xml.namepace.QName.
public class QNameSerialTest {
public final static String TEST_QNAME = "{http://www.example.com}test";
public static void main (String [] args) {
if (args.length < 2) {
printUsage();
System.exit(1);
}
if ("s".equals(args[0])) {
try {
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(args[1]));
QName qname = QName.valueOf(TEST_QNAME);
oos.writeObject(qname);
oos.flush();
oos.close();
System.out.println("QName has been serialized to file: " + args[1]);
}
catch (IOException exc) {
System.err.println("Failure during serialization.");
exc.printStackTrace();
}
}
else if ("d".equals(args[0])) {
try {
ObjectInputStream ois = new ObjectInputStream(new FileInputStream(args[1]));
QName qname = (QName) ois.readObject();
ois.close();
System.out.println("Deserialization successful.");
System.out.println("QName value: " + qname.toString());
}
catch (ClassNotFoundException exc) {
System.err.println("Failure during deserialization.");
exc.printStackTrace();
}
catch (IOException exc) {
System.err.println("Failure during deserialization.");
exc.printStackTrace();
}
}
else {
printUsage();
System.exit(1);
}
}
public static void printUsage() {
System.err.println("Usage: java QNameSerialTest [s|d] file");
System.err.println("s - serialize");
System.err.println("d - deserialize");
}
}
xxxxx@xxxxx 2005-05-09 13:40:48 GMT
xxxxx@xxxxx 2005-05-23 23:46:55 GMT
xxxxx@xxxxx 2005-05-24 00:33:42 GMT
|
|
Work Around
|
There is no reasonable workaround since the JCK signature checks will force J2SE 5.0 to implement the new QName signatures (in which hashcode and equals methods are final, which changes the default serial version UID)
xxxxx@xxxxx 2005-05-09 13:40:48 GMT
|
|
Evaluation
|
This CR belongs in whatever is the appropriate BT2 category for the javax.xml.namespace.QName class. I'm making a best guess with jaxp/jaxp/other; please recategorize as appropriate.
Note that in J2SE 5.0, the serialVersionUID of javax.xml.namespace.QName is declared explicitly:
private static final long serialVersionUID = 4418622981026545151L;
but to a value that is different from the value reported for J2EE 1.4.
xxxxx@xxxxx 2005-05-10 00:06:06 GMT
the serialVersionUID is correct per serialver tool.
this is being closed as not a bug.
xxxxx@xxxxx 2005-05-25 22:25:09 GMT
|
|
Comments
|
Submitted On 28-AUG-2006
darran_l
How can a bug report be closed with a comment "closed as not a bug" when the class already contains code changes specifically to address this?
From the class: -
" * <p>This workaround was inspired by classes in the javax.management
* package, e.g. ObjectName, etc.
* See CR6267224 for original defect report.</p>"
Submitted On 08-MAR-2007
From the bug description, the bug has been fixed in 5.0u7(b01) . Currently, I have download 5.0u11(b03) but my weblogic server9.2 still failed due to the reason as below:
weblogic.management.ManagementException: [Management:141266]Parsing Failure in config.xml: javax.xml.namespace.QName; local class incompatible: stream classdesc serialVersionUID = 4418622981026545151, local class serialVersionUID = -9120448754896609940
at weblogic.management.provider.internal.RuntimeAccessImpl.<init>(RuntimeAccessImpl.java:122)
at weblogic.management.provider.internal.RuntimeAccessService.start(RuntimeAccessService.java:38)
at weblogic.t3.srvr.ServerServicesManager.startService(ServerServicesManager.java:374)
at weblogic.t3.srvr.ServerServicesManager.startInStandbyState(ServerServicesManager.java:125)
at weblogic.t3.srvr.T3Srvr.initializeStandby(T3Srvr.java:630)
at weblogic.t3.srvr.T3Srvr.startup(T3Srvr.java:402)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
at weblogic.Server.main(Server.java:67)
Here is my JDK version
java version "1.5.0_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode, sharing)
Any body could tell me why?
Submitted On 04-MAY-2007
chris-j-01
I had the same problem as the last person who submitted On 08-MAR-2007. I was using 1.5.0_10 with weblogic 9.2. I downgraded to 1.5.0_06 and it works.
Submitted On 22-JUN-2007
mdepot
Look into adding the following option to java as a workaround for this issue:
-Dcom.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0
Submitted On 24-JUL-2008
Titto
Even I solved this error by pointing the jdk for weblogic to
BEA JRockit(R) JDK 5.0 Update 4 (R26.0.0-189_CR269406)
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|
|
|
 |