Closed mkoncek closed 2 years ago
After fixing it, the readme should also be updated to refer to existing namespace.
Reproducer:
$ ./start.sh -decompile ~/.m2/repository/io/github/mkoncek/classpathless-compiler/2.1/classpathless-compiler-2.1.jar Cfr '.*' -saveas /tmp/cplc -savelike dir
...
$ ./start.sh -compile -cp ~/.m2/repository/io/github/mkoncek/classpathless-compiler/2.1/classpathless-compiler-2.1.jar /tmp/cplc/io/github/mkoncek/classpathless/impl/LoggingSwitch.java -savelike fqn -saveas .
java.lang.RuntimeException: Agent returned error response 'java.lang.RuntimeException: java.io.IOException: java.util.stream.Stream not found on CP' for request 'BYTES\njava.util.stream.Stream'.
at org.jrd.backend.core.DecompilerRequestReceiver.getResponse(DecompilerRequestReceiver.java:152)
at org.jrd.backend.core.DecompilerRequestReceiver.getByteCodeAction(DecompilerRequestReceiver.java:199)
at org.jrd.backend.core.DecompilerRequestReceiver.processRequest(DecompilerRequestReceiver.java:78)
at org.jrd.frontend.frame.main.DecompilationController.submitRequest(DecompilationController.java:550)
at org.jrd.backend.data.Cli.obtainClass(Cli.java:808)
at org.jrd.backend.communication.RuntimeCompilerConnector$JrdClassesProvider.getClass(RuntimeCompilerConnector.java:44)
at io.github.mkoncek.classpathless.util.BytecodeExtractor.extractDependenciesImpl(BytecodeExtractor.java:340)
at io.github.mkoncek.classpathless.util.BytecodeExtractorAccessor.extractDependenciesImpl(BytecodeExtractorAccessor.java:28)
at io.github.mkoncek.classpathless.impl.CompilerJavac.compileClass(CompilerJavac.java:87)
at org.jrd.backend.data.Cli.compile(Cli.java:407)
at org.jrd.backend.data.Cli.consumeCli(Cli.java:211)
at org.jrd.backend.data.Main.main(Main.java:20)
Initialization of class 'java.util.stream.Stream' successful.
java.lang.RuntimeException: Agent returned error response 'java.lang.RuntimeException: java.io.IOException: java.util.stream.Stream not found on CP' for request 'BYTES\njava.util.stream.Stream'.
at org.jrd.backend.core.DecompilerRequestReceiver.getResponse(DecompilerRequestReceiver.java:152)
at org.jrd.backend.core.DecompilerRequestReceiver.getByteCodeAction(DecompilerRequestReceiver.java:199)
at org.jrd.backend.core.DecompilerRequestReceiver.processRequest(DecompilerRequestReceiver.java:78)
at org.jrd.frontend.frame.main.DecompilationController.submitRequest(DecompilationController.java:550)
at org.jrd.backend.data.Cli.obtainClass(Cli.java:808)
at org.jrd.backend.communication.RuntimeCompilerConnector$JrdClassesProvider.getClass(RuntimeCompilerConnector.java:54)
at io.github.mkoncek.classpathless.util.BytecodeExtractor.extractDependenciesImpl(BytecodeExtractor.java:340)
at io.github.mkoncek.classpathless.util.BytecodeExtractorAccessor.extractDependenciesImpl(BytecodeExtractorAccessor.java:28)
at io.github.mkoncek.classpathless.impl.CompilerJavac.compileClass(CompilerJavac.java:87)
at org.jrd.backend.data.Cli.compile(Cli.java:407)
at org.jrd.backend.data.Cli.consumeCli(Cli.java:211)
at org.jrd.backend.data.Main.main(Main.java:20)
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Classes couldn't be loaded.Do you have agent configured?On JDK 9 and higher, did you run the target process with '-Djdk.attach.allowAttachSelf=true'?
at io.github.mkoncek.classpathless.impl.CompilerJavac.compileClass(CompilerJavac.java:142)
at org.jrd.backend.data.Cli.compile(Cli.java:407)
at org.jrd.backend.data.Cli.consumeCli(Cli.java:211)
at org.jrd.backend.data.Main.main(Main.java:20)
Caused by: java.lang.RuntimeException: Classes couldn't be loaded.Do you have agent configured?On JDK 9 and higher, did you run the target process with '-Djdk.attach.allowAttachSelf=true'?
at org.jrd.backend.data.Cli.obtainClass(Cli.java:813)
at org.jrd.backend.communication.RuntimeCompilerConnector$JrdClassesProvider.getClass(RuntimeCompilerConnector.java:54)
at io.github.mkoncek.classpathless.util.BytecodeExtractor.extractDependenciesImpl(BytecodeExtractor.java:340)
at io.github.mkoncek.classpathless.util.BytecodeExtractorAccessor.extractDependenciesImpl(BytecodeExtractorAccessor.java:28)
at io.github.mkoncek.classpathless.impl.CompilerJavac.compileClass(CompilerJavac.java:87)
... 3 more
sh images/target/runtime-decompiler-6.0-0.pre.1-with-decompilers/start.sh -compile -cp ~/.m2/repository/io/github/mkoncek/classpathless-compiler/2.1/classpathless-compiler-2.1.jar:/usr/lib/jvm/java-1.8.0/jre/lib/rt.jar:/home/jvanek/.m2/repository/io/github/mkoncek/classpathless-compiler-api/2.1/classpathless-compiler-api-2.1.jar ~/io.github.mkoncek.classpathless.impl.LoggingSwitch.java -savelike fqn -saveas .
Saved: ./io.github.mkoncek.classpathless.impl.LoggingSwitch$Null.class
Saved: ./io.github.mkoncek.classpathless.impl.LoggingSwitch.class
In case of FS, yo are responsibel for your classpath. Youtr exmaple works agaisnt runtime live cp.
Hower...
sh images/target/runtime-decompiler-6.0-0.pre.1-with-decompilers/start.sh -compile -cp ~/.m2/repository/io/github/mkoncek/classpathless-compiler/2.1/classpathless-compiler-2.1.jar:/home/jvanek/.m2/repository/io/github/mkoncek/classpathless-compiler-api/2.1/classpathless-compiler-api-2.1.jar ~/io.github.mkoncek.classpathless.impl.LoggingSwitch.java -savelike fqn -saveas .
java.lang.RuntimeException: Agent returned error response 'java.lang.RuntimeException: java.io.IOException: java.util.stream.Stream not found on CP' for request 'BYTES\njava.util.stream.Stream'.
at org.jrd.backend.core.DecompilerRequestReceiver.getResponse(DecompilerRequestReceiver.java:152)
at org.jrd.backend.core.DecompilerRequestReceiver.getByteCodeAction(DecompilerRequestReceiver.java:199)
shold be fixable by use hsot classes - so either jrd is not reading that withc, or cpcl is using it wrong.
confirmed. CLI do not read the config.
even after passing proper hostClasses
to cplc, the host system classes are nto used in case of fs-vm. => bug in cplc
Compile tool according to instructions does not work (because of bytecode extraction inside CPLC)