Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class file version error in DSE with SpecificationReader #35

Open
vrichthammer opened this issue May 11, 2021 · 3 comments
Open

Class file version error in DSE with SpecificationReader #35

vrichthammer opened this issue May 11, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@vrichthammer
Copy link
Contributor

When trying to run a standard DSE (EA, SumEvaluator, sequential completion, standard OptimizationModule), we encounter the following error when using the InputModule with input file opendse-tutorial/spec.xml (and other such xml-specs) (tested with Java 11 and 14).

com.google.common.util.concurrent.UncheckedExecutionException: java.lang.IllegalArgumentException: Unsupported class file major version 58' ' [...] at org.opt4j.core.config.Task.call(Task.java:41) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:832)' ' Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 58 at com.google.inject.internal.asm.$ClassReader.<init>(ClassReader.java:176) [...] ... 21 more

  • A DSE with the same opt4j-config works when using InputTgff with the included tgff-spec instead
  • Reading the above-mentioned spec-files in a test class using a newly created instance of the SpecificationReader works as well
@michaelhglass michaelhglass added the bug Something isn't working label May 14, 2021
@michaelhglass
Copy link
Member

I could narrow down the bug a bit: The problem seems to occur when multiple different DSEs are started with different specs from the GUI. I corrected the import of Opt4J to release 3.3.0. Further investigation is required to debug what exactly causes the problem in the SpecificationReader when a second optimization is launched and why a Java version exception ('file major version 58' has to do with Java 14 being used) occurs.

@michaelhglass michaelhglass pinned this issue May 19, 2021
@FedorSmirnov89
Copy link
Member

Could you try it with Odse as present in the bugFixSpecRead branch?

@vrichthammer
Copy link
Contributor Author

vrichthammer commented Jun 15, 2021

opendse-tutorial/specs/Specification*.xml all work for me now with Java 11.

opendse-tutorial/spec.xml no longer causes the major version error, but results in a different set of errors, so there might be a problem with this specific specification:

`va:~$ ./gradlew run

Task :run
Starting Opt4J 3.3.0 (Build 2021-05-06)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/home/va/.gradle/caches/modules-2/files-2.1/com.google.inject/guice/4.2.1/f77dfd89318fe3ff293bafceaa75fbf66e4e4b10/guice-4.2.1.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Searching Modules ... DoneING [4s]
java.lang.IllegalStateException: Problem configuration Exception:
Unable to provision, see the following errors:

  1. Error injecting constructor, java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
    at net.sf.opendse.optimization.io.SpecificationWrapperFilename.(SpecificationWrapperFilename.java:40)
    while locating net.sf.opendse.optimization.io.SpecificationWrapperFilename
    at net.sf.opendse.optimization.io.InputModule.config(InputModule.java:45)
    while locating net.sf.opendse.optimization.SpecificationWrapper
    for the 1st parameter of net.sf.opendse.optimization.SATConstraints.(SATConstraints.java:64)
    at net.sf.opendse.optimization.SATConstraints.class(SATConstraints.java:55)
    while locating net.sf.opendse.optimization.SATConstraints
    for the 4th parameter of net.sf.opendse.optimization.SATCreatorDecoder.(SATCreatorDecoder.java:61)
    at net.sf.opendse.optimization.SATCreatorDecoder.class(SATCreatorDecoder.java:45)
    while locating net.sf.opendse.optimization.SATCreatorDecoder
    for the 1st parameter of net.sf.opendse.optimization.DesignSpaceExplorationCreator.(DesignSpaceExplorationCreator.java:37)
    at org.opt4j.core.problem.ProblemModule.bindProblem(ProblemModule.java:139)
    while locating net.sf.opendse.optimization.DesignSpaceExplorationCreator
    while locating org.opt4j.core.problem.Creator<org.opt4j.core.Genotype>

1 error
at org.opt4j.core.start.Opt4JTask.check(Opt4JTask.java:211)
at org.opt4j.core.start.Opt4JTask.execute(Opt4JTask.java:91)
at org.opt4j.core.config.Task.call(Task.java:123)
at org.opt4j.core.config.Task.call(Task.java:41)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.google.inject.ProvisionException: Unable to provision, see the following errors:

  1. Error injecting constructor, java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
    at net.sf.opendse.optimization.io.SpecificationWrapperFilename.(SpecificationWrapperFilename.java:40)
    while locating net.sf.opendse.optimization.io.SpecificationWrapperFilename
    at net.sf.opendse.optimization.io.InputModule.config(InputModule.java:45)
    while locating net.sf.opendse.optimization.SpecificationWrapper
    for the 1st parameter of net.sf.opendse.optimization.SATConstraints.(SATConstraints.java:64)
    at net.sf.opendse.optimization.SATConstraints.class(SATConstraints.java:55)
    while locating net.sf.opendse.optimization.SATConstraints
    for the 4th parameter of net.sf.opendse.optimization.SATCreatorDecoder.(SATCreatorDecoder.java:61)
    at net.sf.opendse.optimization.SATCreatorDecoder.class(SATCreatorDecoder.java:45)
    while locating net.sf.opendse.optimization.SATCreatorDecoder
    for the 1st parameter of net.sf.opendse.optimization.DesignSpaceExplorationCreator.(DesignSpaceExplorationCreator.java:37)
    at org.opt4j.core.problem.ProblemModule.bindProblem(ProblemModule.java:139)
    while locating net.sf.opendse.optimization.DesignSpaceExplorationCreator
    while locating org.opt4j.core.problem.Creator<org.opt4j.core.Genotype>

1 error
at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:226)
at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1053)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1081)
at org.opt4j.core.start.Opt4JTask.check(Opt4JTask.java:204)
... 7 more
Caused by: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at net.sf.opendse.io.SpecificationReader.read(SpecificationReader.java:116)
at net.sf.opendse.optimization.io.SpecificationWrapperFilename.(SpecificationWrapperFilename.java:40)
at net.sf.opendse.optimization.io.SpecificationWrapperFilename$$FastClassByGuice$$5bfe4e8a.newInstance()
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:62)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:42)
at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:65)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:113)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:42)
at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:65)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:113)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:42)
at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:65)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:113)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:62)
at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1050)
... 9 more
Caused by: java.lang.IllegalArgumentException: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at net.sf.opendse.io.SpecificationReader.toSpecification(SpecificationReader.java:158)
at net.sf.opendse.io.SpecificationReader.read(SpecificationReader.java:114)
... 45 more
Caused by: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
at java.base/java.util.Objects.checkIndex(Objects.java:372)
at java.base/java.util.ArrayList.get(ArrayList.java:459)
at nu.xom.Elements.get(Unknown Source)
at net.sf.opendse.io.SpecificationReader.toSpecification(SpecificationReader.java:130)
... 46 more
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants