I have a webstart application which connects to a web service. The manifest has:
Permissions: all-permissions
And the jnlp has:
<security>
<all-permissions/>
</security>
However when the connection to the web service is created I get a java.lang.SecurityException: setContextClassLoader (full stack trace below). When I run the application directly (without webstart) it works fine. Is there anything that I should check or change in my setup to fix the problem?
Note: I am using Java 8. The application was working fine with build 121 but fails with build 123, 124 or 125 (the most recent one). So either my setup is fine and a bug has been introduced between b121 and b123 or a bug has been fixed in b123 which exposes a problem in my setup.
org.glassfish.hk2.api.MultiException: A MultiException has 2 exceptions. They are:
1. java.lang.SecurityException: setContextClassLoader
2. java.lang.IllegalStateException: Unable to perform operation: create on org.jvnet.hk2.internal.DynamicConfigurationServiceImpl
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:362) ~[na:na]
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:454) ~[na:na]
at org.jvnet.hk2.internal.SingletonContext.findOrCreate(SingletonContext.java:119) ~[na:na]
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2296) ~[na:na]
at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:590) ~[na:na]
at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:577) ~[na:na]
at org.glassfish.hk2.utilities.ServiceLocatorUtilities.enablePerThreadScope(ServiceLocatorUtilities.java:89) ~[na:na]
at org.glassfish.jersey.internal.inject.Injections._createLocator(Injections.java:144) ~[na:na]
at org.glassfish.jersey.internal.inject.Injections.createLocator(Injections.java:137) ~[na:na]
at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:352) ~[na:na]
at org.glassfish.jersey.client.ClientConfig$State.access$000(ClientConfig.java:85) ~[na:na]
at org.glassfish.jersey.client.ClientConfig$State$3.get(ClientConfig.java:117) ~[na:na]
at org.glassfish.jersey.client.ClientConfig$State$3.get(ClientConfig.java:114) ~[na:na]
at org.glassfish.jersey.internal.util.collection.Values$LazyValue.get(Values.java:311) ~[na:na]
at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:669) ~[na:na]
at org.glassfish.jersey.client.ClientRequest.getConfiguration(ClientRequest.java:214) ~[na:na]
at org.glassfish.jersey.client.JerseyInvocation.validateHttpMethodAndEntity(JerseyInvocation.java:124) ~[na:na]
at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:97) ~[na:na]
at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:90) ~[na:na]
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:396) ~[na:na]
at org.glassfish.jersey.client.JerseyInvocation$Builder.get(JerseyInvocation.java:296) ~[na:na]
at com.assylias.fund.master.impl.DefaultUserMaster.authenticate(DefaultUserMaster.java:55) ~[na:na]
at com.assylias.bigblue.gui.javafx.users.Login$AuthenticationTask.call(Login.java:342) ~[na:na]
at com.assylias.bigblue.gui.javafx.users.Login$AuthenticationTask.call(Login.java:325) ~[na:na]
at javafx.concurrent.Task$TaskCallable.call(Unknown Source) ~[na:na]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.8.0-ea]
at java.util.concurrent.CompletableFuture$AsyncRun.exec(Unknown Source) ~[na:1.8.0-ea]
at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) ~[na:1.8.0-ea]
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) ~[na:1.8.0-ea]
at java.util.concurrent.ForkJoinPool.scan(Unknown Source) ~[na:1.8.0-ea]
at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) ~[na:1.8.0-ea]
at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) ~[na:1.8.0-ea]
Caused by: java.lang.SecurityException: setContextClassLoader
at java.util.concurrent.ForkJoinWorkerThread$InnocuousForkJoinWorkerThread.setContextClassLoader(Unknown Source) ~[na:1.8.0-ea]
at org.glassfish.hk2.utilities.reflection.ReflectionHelper$2.run(ReflectionHelper.java:1049) ~[na:na]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0-ea]
at org.glassfish.hk2.utilities.reflection.ReflectionHelper.setContextClassLoader(ReflectionHelper.java:1045) ~[na:na]
at org.glassfish.hk2.utilities.reflection.ReflectionHelper.makeMe(ReflectionHelper.java:1101) ~[na:na]
at org.jvnet.hk2.internal.ClazzCreator.createMe(ClazzCreator.java:261) ~[na:na]
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:336) ~[na:na]
I should have read the stacktrace more carefully. The exception is thrown by java.util.concurrent.ForkJoinWorkerThread$InnocuousForkJoinWorkerThread.setContextClassLoader which is a default, no-permission, worker thread. The change has been made following this post and this is the diff.
I was accessing the web service with:
CompletableFuture.runAsync(accessWebservice());
which uses the default ForkJoinPool threadpool, which itself relies on the new InnocuousForkJoinWorkerThread, which throws an exception if setContextClassLoader is called.
Workaround:
CompletableFuture.runAsync(accessWebservice(), executor); //provide an executor
Related
I have a merchant certificate from Apple Pay Service, I need to use it to make a POST request on the Apple Pay Service Gateway. I am trying to configure Java Spring Framework RestTemplate. I did a .pem file with certificate and encrypted key to use it in configuration.
To write a code I am using the correct answer from this question.
Error stacktrace:
Caused by: java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: IOException : DerValue.getBigIntegerInternal, not expected 48
at java.base/sun.security.rsa.RSAKeyFactory.engineGeneratePrivate(RSAKeyFactory.java:252) ~[na:na]
at java.base/java.security.KeyFactory.generatePrivate(KeyFactory.java:390) ~[na:na]
at com.removed.applecert.ConnectionFactoryCreator.generatePrivateKeyFromDER(ConnectionFactoryCreator.java:69) ~[classes/:na]
at com.removed.applecert.ConnectionFactoryCreator.getSocketFactory(ConnectionFactoryCreator.java:43) ~[classes/:na]
at com.removed.applecert.SSLConfiguration.sslSocketFactory(SSLConfiguration.java:41) ~[classes/:na]
at com.removed.applecert.SSLConfiguration$$EnhancerBySpringCGLIB$$f2e321da.CGLIB$sslSocketFactory$4(<generated>) ~[classes/:na]
at com.removed.applecert.SSLConfiguration$$EnhancerBySpringCGLIB$$f2e321da$$FastClassBySpringCGLIB$$2b1ce4c.invoke(<generated>) ~[classes/:na]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.3.14.jar:5.3.14]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.3.14.jar:5.3.14]
at com.removed.applecert.SSLConfiguration$$EnhancerBySpringCGLIB$$f2e321da.sslSocketFactory(<generated>) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.3.14.jar:5.3.14]
... 25 common frames omitted
Caused by: java.security.InvalidKeyException: IOException : DerValue.getBigIntegerInternal, not expected 48
at java.base/sun.security.pkcs.PKCS8Key.decode(PKCS8Key.java:133) ~[na:na]
at java.base/sun.security.pkcs.PKCS8Key.<init>(PKCS8Key.java:94) ~[na:na]
at java.base/sun.security.rsa.RSAPrivateCrtKeyImpl.<init>(RSAPrivateCrtKeyImpl.java:152) ~[na:na]
at java.base/sun.security.rsa.RSAPrivateCrtKeyImpl.newKey(RSAPrivateCrtKeyImpl.java:89) ~[na:na]
at java.base/sun.security.rsa.RSAKeyFactory.generatePrivate(RSAKeyFactory.java:343) ~[na:na]
at java.base/sun.security.rsa.RSAKeyFactory.engineGeneratePrivate(RSAKeyFactory.java:248) ~[na:na]
... 39 common frames omitted
Note: Not sure if this could play a role, but if you read the key as an array of bytes, the first value [0] is 48.
Perhaps this can be done without reassembling the certificate or in some other way, I will be grateful for any recommendations.
Our team just started testing AMQ7 and the application I implemented no longer connects to the broker since we migrated from AMQ6 to AMQ7. After reading over documentation I noticed the uri string is completely different then before where it doesn't need the service or rmi embedded in the uri to connect. Below is the code I'm using to connect but causing the errors.
java.net.MalformedURLException: Service URL must start with service:jmx:
at java.management/javax.management.remote.JMXServiceURL.<init>(JMXServiceURL.java:169) ~[na:na]
at com.ups.aaa.doss.MsgAudtingRunner.run(MsgAudtingRunner.java:110) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93) ~[spring-context-5.0.9.RELEASE.jar:5.0.9.RELEASE]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:830) ~[na:na]
This is the code which the error happens at:
JMXServiceURL url = new JMXServiceURL(brkerInfo.getValue());
JMXConnector connector = JMXConnectorFactory.connect(url, environment);
Is there another Class I need to reference instead of JMXServiceURL which I know expects the uri to have service as a prefix.
Check out the example that ships with the broker in examples/features/standard/jmx (also available in GitHub). It demonstrates how to connect to the broker programmatically using JMX. It does, in fact, use JMXServiceURL and JMXConnectorFactory and the URL does use "service" and "rmi", e.g.:
service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
i have a client and a server on a kubernetes cluster in the same namespace.
I try to access the server with this code:
public GetDataResponse getData() throws JsonProcessingException {
GetDataResponseXML response = (GetDataResponseXML) getWebServiceTemplate()
.marshalSendAndReceive(REQUEST_PARAMETER, new SoapActionCallback(""));
log.info("Get response data: " + Mapper.objectMapper.writeValueAsString(response));
return mapper.dataResponseXMLToJPAEntity(response);
}
I connect to the endpoint with the DNS
http://<serviceOfServer>.<namespace>.svc.cluster.local/data
But i get always this output:
2020-06-25 07:44:36.128 ERROR 7 --- [ scheduling-1] o.s.s.s.TaskUtils$LoggingErrorHandler : Unexpected error occurred in scheduled task
java.lang.NullPointerException: null
at org.springframework.ws.transport.http.AbstractHttpWebServiceMessageSender.supports(AbstractHttpWebServiceMessageSender.java:63) ~[spring-ws-core-3.0.7.RELEASE.jar!/:na]
at org.springframework.ws.client.support.WebServiceAccessor.createConnection(WebServiceAccessor.java:107) ~[spring-ws-core-3.0.7.RELEASE.jar!/:na]
at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:551) ~[spring-ws-core-3.0.7.RELEASE.jar!/:na]
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:390) ~[spring-ws-core-3.0.7.RELEASE.jar!/:na]
at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:383) ~[spring-ws-core-3.0.7.RELEASE.jar!/:na]
at com.my.adapter.client.SOAPClient.getData(SOAPClient.java:40) ~[classes!/:0.0.1-SNAPSHOT]
at com.my.adapter.scheduler.Scheduler.consumeScheduler(Scheduler.java:33) ~[classes!/:0.0.1-SNAPSHOT]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84) ~[spring-context-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.2.0.RELEASE.jar!/:5.2.0.RELEASE]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na]
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[na:na]
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
I have this networkpolicy, so the np cannot be the reason
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-all-egress
spec:
podSelector: {}
egress:
- {}
ingress:
- {}
policyTypes:
- Egress
- Ingress
If i do port-forwarding to the server or service, i can access it with my local client. So it should be ok.
I have absolut not a clue why i get a nullpointer exception.
Have anyone an idea?
Thanks a lot for any help!
I have the solution. I dont know why my DNS didn't work, but when i call it only with the service
http://<serviceOfServer>:<port>
It works.....
I have an executable jar, it was compiled with java 6 and in this project datanucleus is used as ORM (an old version, 1.1.6).
The jar runs fine with java 6, 7, 8 but not with 9 (10): running it I get a lot or errors like this one on various classes:
javax.jdo.JDOFatalUserException: A property named javax.jdo.PersistenceManagerFactoryClass must be specified, or a jar file with a META-INF/services/javax.jdo.PersistenceManagerFactory entry must be in the classpath, or a property named javax.jdo.option.PersistenceUnitName must be specified.
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:856) ~[jdo2-api-2.3-eb.jar:na]
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:698) ~[jdo2-api-2.3-eb.jar:na]
at app.services.DatabaseService.inizializza(DatabaseService.java:193) ~[MyJar.jar:na]
at app.startup.DatabaseLoader.load(DatabaseLoader.java:49) ~[MyJar.jar:na]
at app.startup.Startup.inizializzaDatabasePrincipale(Startup.java:148) [MyJar.jar:na]
at app.startup.Startup.start(Startup.java:47) [MyJar.jar:na]
at app.Test.main(Test.java:81) [MyJar.jar:na]
Caused by: javax.jdo.JDOException: Exception during population of metadata for MyClass1
at org.datanucleus.jdo.JDOPersistenceManagerFactory.initialiseProperties(JDOPersistenceManagerFactory.java:429) ~[datanucleus-core-1.1.6.jar:na]
at org.datanucleus.jdo.JDOPersistenceManagerFactory.<init>(JDOPersistenceManagerFactory.java:260) ~[datanucleus-core-1.1.6.jar:na]
at org.datanucleus.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:173) ~[datanucleus-core-1.1.6.jar:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Unknown Source) ~[na:na]
at javax.jdo.JDOHelper$16.run(JDOHelper.java:1956) ~[jdo2-api-2.3-eb.jar:na]
at java.base/java.security.AccessController.doPrivileged(Native Method) ~[na:na]
at javax.jdo.JDOHelper.invoke(JDOHelper.java:1951) ~[jdo2-api-2.3-eb.jar:na]
at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1159) ~[jdo2-api-2.3-eb.jar:na]
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:839) ~[jdo2-api-2.3-eb.jar:na]
... 6 common frames omitted
Caused by: org.datanucleus.exceptions.NucleusUserException: Exception during population of metadata for app.dati.MyClass1
at org.datanucleus.metadata.MetaDataManager$1.run(MetaDataManager.java:2331) ~[datanucleus-core-1.1.6.jar:na]
at java.base/java.security.AccessController.doPrivileged(Native Method) ~[na:na]
at org.datanucleus.metadata.MetaDataManager.populateAbstractClassMetaData(MetaDataManager.java:2316) ~[datanucleus-core-1.1.6.jar:na]
at org.datanucleus.metadata.MetaDataManager.populateFileMetaData(MetaDataManager.java:2153) ~[datanucleus-core-1.1.6.jar:na]
at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaDataForUse(MetaDataManager.java:864) ~[datanucleus-core-1.1.6.jar:na]
at org.datanucleus.metadata.MetaDataManager.loadPersistenceUnit(MetaDataManager.java:794) ~[datanucleus-core-1.1.6.jar:na]
at org.datanucleus.jdo.JDOPersistenceManagerFactory.initialiseProperties(JDOPersistenceManagerFactory.java:425) ~[datanucleus-core-1.1.6.jar:na]
... 17 common frames omitted
Caused by: java.lang.NullPointerException: null
at java.base/java.util.Arrays.binarySearch(Unknown Source) ~[na:na]
at org.datanucleus.store.types.TypeManager.isDefaultEmbeddedType(TypeManager.java:225) ~[datanucleus-core-1.1.6.jar:na]
at org.datanucleus.metadata.AbstractMemberMetaData.populate(AbstractMemberMetaData.java:477) ~[datanucleus-core-1.1.6.jar:na]
at org.datanucleus.metadata.ClassMetaData.populateMemberMetaData(ClassMetaData.java:543) ~[datanucleus-core-1.1.6.jar:na]
at org.datanucleus.metadata.ClassMetaData.populate(ClassMetaData.java:206) ~[datanucleus-core-1.1.6.jar:na]
at org.datanucleus.metadata.MetaDataManager$1.run(MetaDataManager.java:2322) ~[datanucleus-core-1.1.6.jar:na]
... 23 common frames omitted
javax.jdo.JDOFatalUserException: A property named javax.jdo.PersistenceManagerFactoryClass must be specified, or a jar file with a META-INF/services/javax.jdo.PersistenceManagerFactory entry must be in the classpath, or a property named javax.jdo.option.PersistenceUnitName must be specified.
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:856)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:698)
at app.services.DatabaseService.inizializza(DatabaseService.java:193)
at app.startup.DatabaseLoader.load(DatabaseLoader.java:49)
at app.startup.Startup.inizializzaDatabasePrincipale(Startup.java:148)
at app.startup.Startup.start(Startup.java:47)
at app.Test.main(Test.java:81)
NestedThrowablesStackTrace:
javax.jdo.JDOException: Exception during population of metadata for app.dati.MyClass1
at org.datanucleus.jdo.JDOPersistenceManagerFactory.initialiseProperties(JDOPersistenceManagerFactory.java:429)
at org.datanucleus.jdo.JDOPersistenceManagerFactory.<init>(JDOPersistenceManagerFactory.java:260)
at org.datanucleus.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:173)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at javax.jdo.JDOHelper$16.run(JDOHelper.java:1956)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javax.jdo.JDOHelper.invoke(JDOHelper.java:1951)
at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1159)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:839)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:698)
at app.services.DatabaseService.inizializza(DatabaseService.java:193)
at app.startup.DatabaseLoader.load(DatabaseLoader.java:49)
at app.startup.Startup.inizializzaDatabasePrincipale(Startup.java:148)
at app.startup.Startup.start(Startup.java:47)
at app.Test.main(Test.java:81)
NestedThrowablesStackTrace:
Exception during population of metadata for app.dati.MyClass1
org.datanucleus.exceptions.NucleusUserException: Exception during population of metadata for app.dati.MyClass1
at org.datanucleus.metadata.MetaDataManager$1.run(MetaDataManager.java:2331)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.datanucleus.metadata.MetaDataManager.populateAbstractClassMetaData(MetaDataManager.java:2316)
at org.datanucleus.metadata.MetaDataManager.populateFileMetaData(MetaDataManager.java:2153)
at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaDataForUse(MetaDataManager.java:864)
at org.datanucleus.metadata.MetaDataManager.loadPersistenceUnit(MetaDataManager.java:794)
at org.datanucleus.jdo.JDOPersistenceManagerFactory.initialiseProperties(JDOPersistenceManagerFactory.java:425)
at org.datanucleus.jdo.JDOPersistenceManagerFactory.<init>(JDOPersistenceManagerFactory.java:260)
at org.datanucleus.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:173)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at javax.jdo.JDOHelper$16.run(JDOHelper.java:1956)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javax.jdo.JDOHelper.invoke(JDOHelper.java:1951)
at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1159)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:839)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:698)
at app.services.DatabaseService.inizializza(DatabaseService.java:193)
at app.startup.DatabaseLoader.load(DatabaseLoader.java:49)
at app.startup.Startup.inizializzaDatabasePrincipale(Startup.java:148)
at app.startup.Startup.start(Startup.java:47)
at app.Test.main(Test.java:81)
Caused by: java.lang.NullPointerException
at java.base/java.util.Arrays.binarySearch(Unknown Source)
at org.datanucleus.store.types.TypeManager.isDefaultEmbeddedType(TypeManager.java:225)
at org.datanucleus.metadata.AbstractMemberMetaData.populate(AbstractMemberMetaData.java:477)
at org.datanucleus.metadata.ClassMetaData.populateMemberMetaData(ClassMetaData.java:543)
at org.datanucleus.metadata.ClassMetaData.populate(ClassMetaData.java:206)
at org.datanucleus.metadata.MetaDataManager$1.run(MetaDataManager.java:2322)
... 23 more
Nested Throwables StackTrace:
java.lang.NullPointerException
at java.base/java.util.Arrays.binarySearch(Unknown Source)
at org.datanucleus.store.types.TypeManager.isDefaultEmbeddedType(TypeManager.java:225)
at org.datanucleus.metadata.AbstractMemberMetaData.populate(AbstractMemberMetaData.java:477)
at org.datanucleus.metadata.ClassMetaData.populateMemberMetaData(ClassMetaData.java:543)
at org.datanucleus.metadata.ClassMetaData.populate(ClassMetaData.java:206)
at org.datanucleus.metadata.MetaDataManager$1.run(MetaDataManager.java:2322)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.datanucleus.metadata.MetaDataManager.populateAbstractClassMetaData(MetaDataManager.java:2316)
at org.datanucleus.metadata.MetaDataManager.populateFileMetaData(MetaDataManager.java:2153)
at org.datanucleus.metadata.MetaDataManager.initialiseFileMetaDataForUse(MetaDataManager.java:864)
at org.datanucleus.metadata.MetaDataManager.loadPersistenceUnit(MetaDataManager.java:794)
at org.datanucleus.jdo.JDOPersistenceManagerFactory.initialiseProperties(JDOPersistenceManagerFactory.java:425)
at org.datanucleus.jdo.JDOPersistenceManagerFactory.<init>(JDOPersistenceManagerFactory.java:260)
at org.datanucleus.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:173)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at javax.jdo.JDOHelper$16.run(JDOHelper.java:1956)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javax.jdo.JDOHelper.invoke(JDOHelper.java:1951)
at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1159)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:839)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:698)
at app.services.DatabaseService.inizializza(DatabaseService.java:193)
at app.startup.DatabaseLoader.load(DatabaseLoader.java:49)
at app.startup.Startup.inizializzaDatabasePrincipale(Startup.java:148)
at app.startup.Startup.start(Startup.java:47)
at app.Test.main(Test.java:81)
MyClass and all the classes where I get the error are classes that were enhanced via datanucleus enhancer.
Reading something around I tried this:
java --illegal-access=permit --add-opens java.base/java.lang=ALL-UNNAMED -jar MyJar.jar
but same result.
I am just interested to run this executable jar with java 9 not to recompile the code with java 9.
I know it's a difficult from just an error message to give an answer but someone have some hint?
The code is old, the libraries used are old too but it runs fine on java 8, it's something that changed on java 9 that cause the problem.
UPDATE:
updated with the full stacktrace as requested
I have an error while accessing localhost:9000 the very first time. this is my first 'play run' command. I'm new in play framework and in browser it is written: Compilation failed without reporting any problem!?.
Controller`s code is default:
public class Application extends Controller {
public static Result index() {
return ok(index.render("Your new application is ready."));
}
}
Version of play 2.0.
And my stacktrace in log file is folowing:
2012-06-22 10:25:29,937 - [INFO] - from play in main
Listening for HTTP on port 9001...
2012-06-22 10:25:43,292 - [ERROR] - from application in New I/O server worker #1-1
! Internal server error, for request [GET /] ->
play.api.UnexpectedException: Unexpected exception [Compilation failed without reporting any problem!?]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$2$$anonfun$apply$11$$anonfun$apply$13.apply(PlayReloade r.scala:225) ~[na:na]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$2$$anonfun$apply$11$$anonfun$apply$13.apply(PlayReloade r.scala:225) ~[na:na]
at scala.Option.getOrElse(Option.scala:108) ~[scala-library.jar:0.11.2]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$2$$anonfun$apply$11.apply(PlayReloader.scala:224) ~ [na:na]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$2$$anonfun$apply$11.apply(PlayReloader.scala:221) ~[na:na]
at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.2]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$2.apply(PlayReloader.scala:221) ~[na:na]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$2.apply(PlayReloader.scala:219) ~[na:na]
at scala.Either$LeftProjection.map(Either.scala:183) ~[scala-library.jar:0.11.2]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3.apply(PlayReloader.scala:219) ~[na:na]
at sbt.PlayReloader$$anon$2$$anonfun$reload$3.apply(PlayReloader.scala:214) ~[na:na]
at scala.Option.getOrElse(Option.scala:108) ~[scala-library.jar:0.11.2]
at sbt.PlayReloader$$anon$2.reload(PlayReloader.scala:214) ~[na:na]
at play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:110) ~[play_2.9.1.jar:2.0]
at play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:110) ~[play_2.9.1.jar:2.0]
at akka.dispatch.Future$$anon$3.liftedTree1$1(Future.scala:195) ~[akka-actor.jar:2.0]
at akka.dispatch.Future$$anon$3.run(Future.scala:194) ~[akka-actor.jar:2.0]
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:83) ~[akka-actor.jar:2.0]
at akka.jsr166y.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1381) ~[akka-actor.jar:2.0]
at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259) ~[akka-actor.jar:2.0]
at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:997) ~[akka-actor.jar:2.0]
at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1495) ~[akka-actor.jar:2.0]
at akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) ~[akka-actor.jar:2.0]
sbt.compiler.CompileFailed: null
at sbt.compiler.JavaCompiler$$anon$1.apply(JavaCompiler.scala:26) ~[na:na]
at sbt.AggressiveCompile$$anonfun$5$$anonfun$compileJava$1$1.apply$mcV$sp(AggressiveCompile.scala:76) ~[na:na]
at sbt.classfile.Analyze$.apply(Analyze.scala:93) ~[na:na]
at sbt.AggressiveCompile$$anonfun$5.compileJava$1(AggressiveCompile.scala:75) ~[na:na]
at sbt.AggressiveCompile$$anonfun$5.apply(AggressiveCompile.scala:79) ~[na:na]
at sbt.AggressiveCompile$$anonfun$5.apply(AggressiveCompile.scala:57) ~[na:na]
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:21) ~[na:na]
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:19) ~[na:na]
at sbt.inc.Incremental$.cycle(Incremental.scala:33) ~[na:na]
at sbt.inc.Incremental$.compile(Incremental.scala:20) ~[na:na]
at sbt.inc.IncrementalCompile$.apply(Compile.scala:17) ~[na:na]
at sbt.AggressiveCompile.compile2(AggressiveCompile.scala:87) ~[na:na]
at sbt.AggressiveCompile.compile1(AggressiveCompile.scala:41) ~[na:na]
at sbt.AggressiveCompile.apply(AggressiveCompile.scala:28) ~[na:na]
at sbt.Compiler$.apply(Compiler.scala:107) ~[na:na]
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:479) ~[na:na]
at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:479) ~[na:na]
at sbt.Scoped$$anonfun$hf2$1.apply(Structure.scala:473) ~[na:na]
at sbt.Scoped$$anonfun$hf2$1.apply(Structure.scala:473) ~[na:na]
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:41) ~[scala-library.jar:0.11.2]
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$11.apply(Structure.scala:295) ~[na:na]
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$11.apply(Structure.scala:295) ~[na:na]
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40) ~[na:na]
at sbt.std.Transform$$anon$5.work(System.scala:67) ~[na:na]
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:221) ~[na:na]
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:221) ~[na:na]
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18) ~[na:na]
at sbt.Execute.work(Execute.scala:227) ~[na:na]
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:221) ~[na:na]
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:221) ~[na:na]
at sbt.CompletionService$$anon$1$$anon$2.call(CompletionService.scala:26) ~[na:na]
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) ~[na:1.7.0_01]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.7.0_01]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[na:1.7.0_01]
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) ~[na:1.7.0_01]
at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.7.0_01]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_01]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_01]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_01]
Maybe you use another different java version. I created a project A and compiled it using java 6. Now I update my java to 7. So problem occur! Then I run it using java 6! Problem dealt;
But I don't know how to run it in java7. I have tried to clean and compile but also failed. Let me try other methods!
Have you tried going to http://localhost:9001? Since your server is Listening for HTTP on port 9001... this may be the right path ; )