Menu

#172 Java 9 version parse failure with 3.11

3.x
closed-fixed
None
5
2021-01-25
2017-07-23
pre sto
No

I see that "Added basic Java 9 support" in 3.11, but I still get this error coming from xstream with 3.11

Caused by: java.lang.ExceptionInInitializerError
at com.thoughtworks.xstream.XStream.<init>(XStream.java:145)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:181)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:169)
at net.sf.launch4j.config.ConfigPersister.<init>(ConfigPersister.java:73)
at net.sf.launch4j.config.ConfigPersister.<clinit>(ConfigPersister.java:66)
at net.sf.launch4j.ant.Launch4jTask.execute(Launch4jTask.java:104)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at jdk.internal.reflect.GeneratedMethodAccessor421.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
... 68 more
Caused by: java.lang.StringIndexOutOfBoundsException: begin 0, end 3, length 1
at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3116)
at java.base/java.lang.String.substring(String.java:1885)
at com.thoughtworks.xstream.core.JVM.getMajorJavaVersion(JVM.java:25)
at com.thoughtworks.xstream.core.JVM.<clinit>(JVM.java:12)
... 79 more

Discussion

  • Grzegorz Kowal

    Grzegorz Kowal - 2017-07-23

    Yes, I have to investigate this problem. The basic support meant that launch4j is able to run your application on Java 9, as the registry keys changed the older versions will not see this JRE.

    Grzegorz

     
  • pre sto

    pre sto - 2017-07-24

    Could be that lib/xstream.jar needs to be upgraded

    http://x-stream.github.io/changes.html

    They have "Current Java 9 implementation reports itself as version 9 now." in 1.4.10

     
  • Grzegorz Kowal

    Grzegorz Kowal - 2017-07-25

    Most probably, I also have to check if this version does not require anu changes in launch4j itself.

     
  • karsten-r-spt

    karsten-r-spt - 2019-06-18

    This still happens with 3.12 and Java 12. I tried to use the latest xstream.jar and that seemed to work fine, though a warning is printed about an "illegal reflective access operation". But I guess this is something the xstream team has to take care of.

     
  • Grzegorz Kowal

    Grzegorz Kowal - 2021-01-25
    • status: open --> closed-fixed
    • assigned_to: Grzegorz Kowal
     
  • Grzegorz Kowal

    Grzegorz Kowal - 2021-01-25

    Updated XStream to 1.4.15.

     

Log in to post a comment.