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

[native-image] class java.net.TwoStacksPlainSocketImpl not found on Windows #1870

Closed
znbang opened this issue Nov 22, 2019 · 7 comments
Closed

Comments

@znbang
Copy link

znbang commented Nov 22, 2019

Tested with graalvm-ce-java11-windows-amd64-19.3.0.

Test.java:

public class Test {
  public static void main(String[] args) throws Exception {
    java.net.Socket s = new java.net.Socket("localhost", 12345);
  }
}

Error messages:

C:\>java -version
openjdk version "11.0.5" 2019-10-15
OpenJDK Runtime Environment (build 11.0.5+10-jvmci-19.3-b05-LTS)
OpenJDK 64-Bit GraalVM CE 19.3.0 (build 11.0.5+10-jvmci-19.3-b05-LTS, mixed mode, sharing)
C:\>javac Test.java
C:\>native-image Test
[Test:9636]    classlist:   3,697.39 ms
[Test:9636]        (cap):   6,826.52 ms
[Test:9636]        setup:  11,013.38 ms
[Test:9636]     analysis:  18,083.82 ms
Fatal error: com.oracle.svm.core.util.VMError$HostedError: class java.net.TwoStacksPlainSocketImpl not found
        at com.oracle.svm.core.util.VMError.guarantee(VMError.java:85)
        at com.oracle.svm.core.jdk.JNIRegistrationUtil.clazz(JNIRegistrationUtil.java:71)
        at com.oracle.svm.core.jdk.JNIRegistrationUtil.fields(JNIRegistrationUtil.java:84)
        at com.oracle.svm.hosted.jdk.JNIRegistrationJavaNet.registerPlainSocketImplInitProto(JNIRegistrationJavaNet.java:229)
        at com.oracle.svm.hosted.ReachabilityHandlerFeature.duringAnalysis(ReachabilityHandlerFeature.java:114)
        at com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$8(NativeImageGenerator.java:710)
        at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:63)
        at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:710)
        at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:530)
        at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:445)
        at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Error: Image build request failed with exit status 1
@nightscape
Copy link
Contributor

Did anybody discover a workaround? The problem also occurs on graalvm-ce-java8-windows-amd64-19.3.0.

@pejovica
Copy link
Member

pejovica commented Dec 6, 2019

@nightscape, could you provide a stack trace of the error on JDK 8. I'm working on a fix, so it might be useful.

@nightscape
Copy link
Contributor

@pejovica sorry, my bad. Something had gone wrong when switching from the JDK 11 to the JDK 8 version and I was apparently still using the JDK 11 version of native-image.
I ran the example from @znbang again with the JDK 8 version and it worked.

@pejovica
Copy link
Member

Fixed in 123a027.

@mcred
Copy link

mcred commented Dec 16, 2019

@pejovica When do you expect 123a027 to be released?

@pejovica
Copy link
Member

@mcred In GraalVM 20.0 early next year.

@mbbee
Copy link

mbbee commented Jan 12, 2020

Why not in 19.3.1 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants