JDK-4943271 : REGRESSION:javax.naming.Name changed its serialVersionUID
  • Type: Bug
  • Component: docs
  • Sub-Component: guides
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 2003-10-24
  • Updated: 2004-03-10
  • Resolved: 2003-10-27
Related Reports
Duplicate :  
Description

Name: ygR10224			Date: 10/24/2003


Filed By      : SPB JCK team (###@###.###)
JDK           : java full version "1.5.0-beta-b25"
JCK           : 1.5
Platform[s]   : Solaris
switch/Mode   : 
JCK test owner : http://javaweb.eng/jct/sqe/JCK-tck/usr/owners.jto
Failing Test [s] :
    api/javax_naming/spi/ResolveResult/serial/index.html#Constructor
    api/javax_naming/CannotProceedException/serial/index.html#Constructor
    api/javax_naming/LinkException/serial/index.html#Constructor
    api/javax_naming/NamingException/serial/index.html#Constructor


Specification excerpt:
======================
--------- J2SE API spec v.1.5 ---------
...
...
>From JOSS, ch. 4.6 "Stream Unique Identifiers":
The stream-unique identifier is a 64-bit hash of the class name, interface
class names, methods, and fields. The value must be declared in all versions
of a class except the first. It may be declared in the original class but
is
not required. The value is fixed for all compatible classes.
...
...
---------- end-of-excerpt ---------------

Problem description
===================
The serialVersionUID of interface javax.naming.Name has been changed
in JDK1.5.0-beta-b25, so Serialized Form of this interface has been changed incompatibly:
  <gyi@helmet(pts/2).860> /set/java/jdk1.5.0/solaris/bin/java -version
  java version "1.5.0-beta"
  Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b25)
  Java HotSpot(TM) Client VM (build 1.5.0-beta-b25, mixed mode)
  <gyi@helmet(pts/2).861> /set/java/jdk1.5.0/solaris/bin/serialver  javax.naming.Name
  javax.naming.Name:    static final long serialVersionUID = -3420508244076200191L;

The correct serialVersionUID should be this one that was released previously in JDK 1.3.X/1.4.X: 

<gyi@helmet(pts/2).857> /set/java/jdk1.4.2/solaris/bin/java -version
java version "1.4.2-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-rc-b25)
Java HotSpot(TM) Client VM (build 1.4.2-rc-b25, mixed mode)
<gyi@helmet(pts/2).858> /set/java/jdk1.4.2/solaris/bin/serialver javax.naming.Name
javax.naming.Name:    static final long serialVersionUID = -3617482732056931635L;

Please add the correct "private static final long serialVersionUID"  constant to the interface javax.naming.Name to make its compatible across J2SE versions.



JCK test source location:
==========================
/java/re/jck/1.5/promoted/latest/JCK-runtime-15/tests

Test output:
=============
----------ref:(3/86)----------
Creating StreamObject from Object
Checking for JDK Version : 1.3
Creating spec class.
----------log:(13/1090)----------
java.lang.IllegalArgumentException: Invalid field: javax.naming.Name remainingName
	at javasoft.sqe.serial.StreamObject.getObjectField(StreamObject.java:760)
	at javasoft.sqe.tests.api.javax.naming.spi.ResolveResult.serial.ConstructorTests.serial2001(ConstructorTests.java:86)
	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 javasoft.sqe.javatest.lib.MultiTest.invokeTestCase(MultiTest.java:399)
	at javasoft.sqe.javatest.lib.MultiTest.run(MultiTest.java:195)
	at javasoft.sqe.javatest.lib.MultiTest.run(MultiTest.java:127)
	at javasoft.sqe.tests.api.javax.naming.spi.ResolveResult.serial.ConstructorTests.main(ConstructorTests.java:30)
serial2001: Failed. Test case throws exception: java.lang.IllegalArgumentException: Invalid field: javax.naming.Name remainingName
STATUS:Failed.test cases: 1; all failed; first test case failure: serial2001
result: Failed. test cases: 1; all failed; first test case failure: serial2001




Specific Machine Info:
=====================
SunOS helmet 5.8 Generic_108528-14 sun4u sparc SUNW,Ultra-2

======================================================================

Comments
EVALUATION Name: jg118383 Date: 10/24/2003 Accepted ======================================================================
11-06-2004