JDK-8028106 : Lambda serialization fails on 17 iteration
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io:serialization
  • Priority: P2
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2013-11-11
  • Updated: 2013-11-11
  • Resolved: 2013-11-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Resolved
Related Reports
Duplicate :  
Relates :  
Description
Fails started from JDK8b115

Minimized test:
--------------------------------------------------------------------------------
public class MiniTest {

    public static void main(String[] args) throws IOException {
        for(int i = 0; i < 17; i++) {
            ser();
        }
    }

    public static void ser() throws IOException {
        try (ByteOutputStream bos = new ByteOutputStream(); ObjectOutputStream ostream = new ObjectOutputStream(bos)) {
            ostream.writeObject((FuncInt) () -> {});
        }
    }
}

@FunctionalInterface
interface FuncInt extends Serializable {

    void m();
}
--------------------------------------------------------------------------------

Output:
--------------------------------------------------------------------------------
Exception in thread "main" java.lang.NoClassDefFoundError: javasoft/sqe/tests/api/java/lang/invoke/SerializedLambda/serial/MiniTest$$Lambda$1/804564176
	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:1075)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1136)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
	at javasoft.sqe.tests.api.java.lang.invoke.SerializedLambda.serial.MiniTest.ser(MiniTest.java:25)
	at javasoft.sqe.tests.api.java.lang.invoke.SerializedLambda.serial.MiniTest.main(MiniTest.java:19)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.ClassNotFoundException: javasoft.sqe.tests.api.java.lang.invoke.SerializedLambda.serial.MiniTest$$Lambda$1.804564176
	at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 13 more
--------------------------------------------------------------------------------
Comments
This is a dup of recently fixed issue JDK-8027681
11-11-2013

Likely dup of JDK-7194897
11-11-2013

This duplicates with jdk8-b115 but does not duplicate with builds jdk8/tl (jdk8/tl currently has several changes queued up for integration into b117).
11-11-2013

Failed JCK test api/java_lang/invoke/SerializedLambda/serial/LambdaSerializationTests.html#LambdaSerializationTests[testSimpleFIMulti]
11-11-2013