Olá quando tento rodar a aplicação para publicar o endpoint recebo esse erro:
java.security.PrivilegedActionException: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String,[B,int,int,java.lang.ClassLoader,java.security.ProtectionDomain)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:573)
at com.sun.xml.ws.model.Injector.<clinit>(Injector.java:105)
at com.sun.xml.ws.model.WrapperBeanGenerator.createRequestWrapperBean(WrapperBeanGenerator.java:295)
at com.sun.xml.ws.model.RuntimeModeler.getRequestWrapperClass(RuntimeModeler.java:375)
at br.com.caelum.estoque.ws.PublicaWebService.main(PublicaWebService.java:12)
Caused by: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String,[B,int,int,java.lang.ClassLoader,java.security.ProtectionDomain)
at java.base/java.lang.Class.getMethod(Class.java:2227)
at com.sun.xml.ws.model.Injector$3.run(Injector.java:109)
at com.sun.xml.ws.model.Injector$3.run(Injector.java:105)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
... 21 more
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.sun.xml.ws.model.WrapperBeanGenerator.createRequestWrapperBean(WrapperBeanGenerator.java:295)
at com.sun.xml.ws.model.RuntimeModeler.getRequestWrapperClass(RuntimeModeler.java:375)
at com.sun.xml.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:801)
at com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:731)
at com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:491)
at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:320)
at com.sun.xml.ws.db.DatabindingImpl.<init>(DatabindingImpl.java:100)
at com.sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:74)
at com.sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:58)
at com.sun.xml.ws.db.DatabindingFactoryImpl.createRuntime(DatabindingFactoryImpl.java:120)
at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:521)
at com.sun.xml.ws.server.EndpointFactory.create(EndpointFactory.java:300)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:164)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:578)
at javax.xml.ws.Endpoint.publish(Endpoint.java:254)
at br.com.caelum.estoque.ws.PublicaWebService.main(PublicaWebService.java:12)
Caused by: javax.xml.ws.WebServiceException: java.security.PrivilegedActionException: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String,[B,int,int,java.lang.ClassLoader,java.security.ProtectionDomain)
at com.sun.xml.ws.model.Injector.<clinit>(Injector.java:123)
... 20 more
Suppressed: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @307f6b8c
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 com.sun.xml.ws.model.Injector.getMethod(Injector.java:133)
at com.sun.xml.ws.model.Injector.access$000(Injector.java:62)
at com.sun.xml.ws.model.Injector$1.run(Injector.java:79)
at com.sun.xml.ws.model.Injector$1.run(Injector.java:75)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
at com.sun.xml.ws.model.Injector.<clinit>(Injector.java:74)
... 20 more
Caused by: java.security.PrivilegedActionException: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String,[B,int,int,java.lang.ClassLoader,java.security.ProtectionDomain)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:573)
at com.sun.xml.ws.model.Injector.<clinit>(Injector.java:105)
... 20 more
Caused by: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String,[B,int,int,java.lang.ClassLoader,java.security.ProtectionDomain)
at java.base/java.lang.Class.getMethod(Class.java:2227)
at com.sun.xml.ws.model.Injector$3.run(Injector.java:109)
at com.sun.xml.ws.model.Injector$3.run(Injector.java:105)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
... 21 more
Pode ser alguma dependência?