ObjectInputStream is not working when changing java version from 8u77 to 8u91

397 views
Skip to first unread message

Nicola Atzei

unread,
May 10, 2016, 6:57:22 AM5/10/16
to Java™ Pathfinder
Hello everyone,

I need to use ObjectInputStream/ObjectOutputStream within my System Under Test (SUT).
Unfortunatly something changes updating java from 8u77 to 8u91 version (there aren't other subversions between 77 and 91).

The error found by JPF (running within a JVM 8u91) is

error details: java.lang.NoSuchMethodException: sun.misc.SharedSecrets.setJavaObjectInputStreamAccess(Lsun/misc/JavaObjectInputStreamAccess;)V
    at java
.io.ObjectInputStream.<clinit>(ObjectInputStream.java:3578)
   
...(my classes here)

whereas there is no error in older java versions.
I have already seen that JPF re-implements sun.misc.SharedSecrets, so the fix could be straightforward (or maybe not).

Thanks

Nicola

Teodoro Filippini

unread,
May 10, 2016, 10:13:48 AM5/10/16
to Java™ Pathfinder
I've been getting mad all day about the exact same error. I have just downloaded jpg, and after all proper checks I ran ant build and obtained
/Users/TF/Desktop/JPF-files/jpf-core/build.xml:451: if=test.failed

 and the .txt report reads:
====================================================== error 1
gov.nasa.jpf.vm.NoUncaughtExceptionsProperty
java.lang.NoSuchMethodException: sun.misc.SharedSecrets.setJavaObjectInputStreamAccess(Lsun/misc/JavaObjectInputStreamAccess;)V
at java.io.ObjectInputStream.<clinit>(ObjectInputStream.java:3578)
at gov.nasa.jpf.test.java.io.ObjectStreamTest.testSimpleReadbackOk(ObjectStreamTest.java:88)
at java.lang.reflect.Method.invoke(gov.nasa.jpf.vm.JPF_java_lang_reflect_Method)
at gov.nasa.jpf.util.test.TestJPF.runTestMethod(TestJPF.java:648)

Should I downgrade Java? 

Nicola Atzei

unread,
May 10, 2016, 11:25:32 AM5/10/16
to Java™ Pathfinder
Hi Teodoro,

yes I think you should. You can download old Java versions from http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html
It requires you to register.

Cheers

Nicola

Teodoro Filippini

unread,
May 11, 2016, 2:28:27 AM5/11/16
to Java™ Pathfinder
I fixed this by removing the newest jdk from the JavaVirtualMachines folder, as I had older versions there, too, now it works. Thanks

nastaran

unread,
May 25, 2016, 6:38:21 PM5/25/16
to Java™ Pathfinder
Hi all, 

This issue has been resolved now. I had to update the model class sun.misc.SharedSecrets to make it compatible with the updates in jdk8u75. By updating your jpf-core, you should be fine switching back to the newer version. 

Thanks,
Nastaran

Nicola Atzei

unread,
May 27, 2016, 9:19:56 AM5/27/16
to java-pa...@googlegroups.com
Thank you, my application works again.

Cheers,

Nicola

--

---
You received this message because you are subscribed to a topic in the Google Groups "Java™ Pathfinder" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/java-pathfinder/z261CEmCFhw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to java-pathfind...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Gyori

unread,
Jun 21, 2016, 10:48:45 AM6/21/16
to Java™ Pathfinder
Hi Nastaran,

Unfortunately, it seems that for jdk8u74 and earlier compilation breaks now. Here is the relevant part of my log when running ant:

Compiling 84 source files to /home/gyori/research/jpf/jpf-core/build/classes
   
[javac] /home/gyori/research/jpf/jpf-core/src/classes/sun/misc/SharedSecrets.java:60: error: cannot find symbol
   
[javac]   private static JavaObjectInputStreamAccess javaObjectInputStreamAccess;
   
[javac]                  ^
   
[javac]   symbol:   class JavaObjectInputStreamAccess
   
[javac]   location: class SharedSecrets


Best,
Alex

Nicola Atzei

unread,
Jun 22, 2016, 8:50:28 AM6/22/16
to Java™ Pathfinder
Hi Alex,
I think that you should update your jdk or downgrade JPF (before changeset 31:0069194b1048).
It seems difficult to me to support all the minor version of the jdk, considering that JPF reimplement a lot of sun.* classes. But I could be wrong.

Cheers,

Nicola

Chelsea Metcalf

unread,
Jun 24, 2016, 1:08:05 PM6/24/16
to Java™ Pathfinder
How do you download a jpf specific version? How do you use the changeset?

Thanks,
Chelsea

Nicola Atzei

unread,
Jun 24, 2016, 1:25:25 PM6/24/16
to java-pa...@googlegroups.com

You download JPF as usual (hg clone ...), then checkout to the changeset you want (hg checkout 29).

Nicola

--
Reply all
Reply to author
Forward
0 new messages