Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-6346

module java.base does not "opens java.net" to unnamed module

XMLWordPrintable

    • Hide
      • unzip ejb-remote-over-http.zip from attachment
      • cd ejb-remote-over-http
      • mvn package
      • Copy deployment ejb-remote-server/target/ROOT.jar to wildfly-28.0.0.Final/standalone/deployments
      • Add `user1=9c6d4007dc2213e40840e9608507c8e7` to application-users.properties
      • ./standalone.sh
      • java --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED -jar ./ejb-remote-client.jar localhost:8080
        
      Show
      unzip ejb-remote-over-http.zip from attachment cd ejb-remote-over-http mvn package Copy deployment ejb-remote-server/target/ROOT.jar to wildfly-28.0.0.Final/standalone/deployments Add `user1=9c6d4007dc2213e40840e9608507c8e7` to application-users.properties ./standalone.sh java --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED -jar ./ejb-remote-client.jar localhost:8080

      We are facing this error in our app. Scenario is ejb over http call. Adding add-opens=java.base/java.net=ALL-UNNAMED on client side really helps to fix the issue. But I do not see java.net.InetSocketAddress used in application code. Also we did not see this error on previous versions of server and jdk with same application. Currently we are using jdk17 with wf28. This issue is created to discuss if --add-opens=java.base/java.net=ALL-UNNAMED jpms option should be added e.g. to server script or recommended on client side etc...

      Exception in thread "main" java.lang.reflect.InaccessibleObjectException: Unable to make private void java.net.InetSocketAddress.readObject(java.io.ObjectInputStream) throws java.io.IOException,java.lang.ClassNotFoundException accessible: module java.base does not "opens java.net" to unnamed module @be64738",
          "   at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)",
          "   at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)",
          "   at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)",
          "   at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)",
          "   at org.jboss.marshalling.reflect.JDKSpecific$SerMethods.<init>(JDKSpecific.java:138)",
          "   at org.jboss.marshalling.reflect.SerializableClass.<init>(SerializableClass.java:86)",
          "   at org.jboss.marshalling.reflect.SerializableClassRegistry$1.computeValue(SerializableClassRegistry.java:62)",
          "   at org.jboss.marshalling.reflect.SerializableClassRegistry$1.computeValue(SerializableClassRegistry.java:59)",
          "   at java.base/java.lang.ClassValue.getFromHashMap(ClassValue.java:228)",
          "   at java.base/java.lang.ClassValue.getFromBackup(ClassValue.java:210)",
          "   at java.base/java.lang.ClassValue.get(ClassValue.java:116)",
          "   at org.jboss.marshalling.reflect.SerializableClassRegistry.lookup(SerializableClassRegistry.java:83)",
          "   at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:1089)",
          "   at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1381)",
          "   at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:298)",
          "   at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:231)",
          "   at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:41)",
          "   at org.wildfly.httpclient.ejb.HttpEJBReceiver.readAttachments(HttpEJBReceiver.java:462)",
          "   at org.wildfly.httpclient.ejb.HttpEJBReceiver$2.getResult(HttpEJBReceiver.java:212)",
          "   at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:620)",
          "   at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:551)",
          "   at org.jboss.ejb.protocol.remote.RemotingEJBClientInterceptor.handleInvocationResult(RemotingEJBClientInterceptor.java:57)",
          "   at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:622)",
          "   at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:551)",
          "   at org.jboss.ejb.client.TransactionPostDiscoveryInterceptor.handleInvocationResult(TransactionPostDiscoveryInterceptor.java:148)",
          "   at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:622)",
          "   at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:551)",
          "   at org.jboss.ejb.client.DiscoveryEJBClientInterceptor.handleInvocationResult(DiscoveryEJBClientInterceptor.java:130)",
          "   at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:622)",
          "   at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:551)",
          "   at org.jboss.ejb.client.NamingEJBClientInterceptor.handleInvocationResult(NamingEJBClientInterceptor.java:87)",
          "   at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:622)",
          "   at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:551)",
          "   at org.jboss.ejb.client.AuthenticationContextEJBClientInterceptor.call(AuthenticationContextEJBClientInterceptor.java:59)",
          "   at org.jboss.ejb.client.AuthenticationContextEJBClientInterceptor.handleInvocationResult(AuthenticationContextEJBClientInterceptor.java:52)",
          "   at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:622)",
          "   at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:551)",
          "   at org.jboss.ejb.client.TransactionInterceptor.handleInvocationResult(TransactionInterceptor.java:212)",
          "   at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:622)",
          "   at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:551)",
          "   at org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:1003)",
          "   at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:182)",
          "   at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:116)",
          "   at jdk.proxy2/jdk.proxy2.$Proxy3.increment(Unknown Source)",
      

              ropalka Richard Opalka
              mchoma@redhat.com Martin Choma
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: