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 ; )
Related
when I execute my UDF on a local spark cluster it works as expected. When I execute it on docker VMs I get the following error :
Driver stacktrace:] with root cause
java.lang.IllegalStateException: unread block data
at java.io.ObjectInputStream$BlockDataInputStream.setBlockDataMode(ObjectInputStream.java:2934) ~[na:na]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1704) ~[na:na]
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2431) ~[na:na]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2355) ~[na:na]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2213) ~[na:na]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1669) ~[na:na]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:503) ~[na:na]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:461) ~[na:na]
at org.apache.spark.serializer.JavaDeserializationStream.readObject(JavaSerializer.scala:87) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at org.apache.spark.serializer.JavaSerializerInstance.deserialize(JavaSerializer.scala:129) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:507) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:na]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:na]
at java.lang.Thread.run(Thread.java:750) ~[na:na]
The driver code:
StructType structType = new StructType()
.add("number", DataTypes.IntegerType)
.add("factorial", DataTypes.IntegerType);
List<Row> rows = numbers.stream().map(i -> new GenericRowWithSchema(new Integer[]{i, i}, structType)).collect(Collectors.toList());
JavaRDD<Row> words = sparkContext.parallelize(rows);
UserDefinedFunction factorialFunction = udf(
new Factorial(), DataTypes.LongType
);
sparkSession.udf().register("factorialFunction", factorialFunction);
Dataset<Row> dataFrame = sparkSession.createDataFrame(words, structType);
//>>next line fails in cluster mode. local mode works fine
//https://stackoverflow.com/questions/28186607/java-lang-classcastexception-using-lambda-expressions-in-spark-job-on-remote-ser/28367602#28367602
List<Row> result = dataFrame.select(col("number"), factorialFunction.apply(col("factorial"))).collectAsList();
return result.stream().distinct().collect(Collectors.toMap(e -> (Integer) e.get(0), e -> (Long) e.get(1)));
The Spark configuration:
new SparkConf()
.setAppName(appName)
.setMaster(masterUri)
.setJars(new String[]{"target/hello-spark-0.0.1-SNAPSHOT.jar"})
.set("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
.set("spark.kryo.registrationRequired", "true")
.registerKryoClasses(new Class[]{
Factorial.class,
WordCountService.class,
GenericRowWithSchema.class,
StructType.class,
StructField.class,
StructField[].class,
IntegerType$.class,
Metadata.class,
Integer[].class})
The default spring profile executes on the local cluster, the profile 'local' will connect to one master-spark node which delegates to two worker nodes. I also tried the Java serialization which led me to
java.lang.ClassCastException: cannot assign instance of java.lang.invoke.SerializedLambda to field org.apache.spark.rdd.MapPartitionsRDD.f of type scala.Function3 in instance of org.apache.spark.rdd.MapPartitionsRDD
at java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2301) ~[na:na]
at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1431) ~[na:na]
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2437) ~[na:na]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2355) ~[na:na]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2213) ~[na:na]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1669) ~[na:na]
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2431) ~[na:na]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2355) ~[na:na]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2213) ~[na:na]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1669) ~[na:na]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:503) ~[na:na]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:461) ~[na:na]
at scala.collection.immutable.List$SerializationProxy.readObject(List.scala:527) ~[scala-library-2.12.15.jar:na]
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:na]
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1184) ~[na:na]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2322) ~[na:na]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2213) ~[na:na]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1669) ~[na:na]
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2431) ~[na:na]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2355) ~[na:na]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2213) ~[na:na]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1669) ~[na:na]
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2431) ~[na:na]
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2355) ~[na:na]
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2213) ~[na:na]
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1669) ~[na:na]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:503) ~[na:na]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:461) ~[na:na]
at org.apache.spark.serializer.JavaDeserializationStream.readObject(JavaSerializer.scala:87) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at org.apache.spark.serializer.JavaSerializerInstance.deserialize(JavaSerializer.scala:129) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:83) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at org.apache.spark.scheduler.Task.run(Task.scala:136) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$3(Executor.scala:548) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1504) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:551) ~[spark-core_2.12-3.3.0.jar:3.3.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:na]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:na]
at java.lang.Thread.run(Thread.java:750) ~[na:na]
I also looked up all the corresponding problems on SO. I can see during startup, that the jar file is loaded:
org.apache.spark.SparkContext: Added JAR target/hello-spark-0.0.1-SNAPSHOT.jar at spark://192.168.178.172:54061/jars/hello-spark-0.0.1-SNAPSHOT.jar with timestamp 1656517689330
Please help, I spent 2 days, still no luck.
Kind Regards
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 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