Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed yesterday.
Improve this question
My application was running smoothly and all of sudden after restart it shows such error. I havent changed anything in UserRepo, Entity or OAuth Config
Caused by: org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract void com.ayush.mobilepos.repo.UserRepo.linkUserWithOffice(java.lang.Long,java.lang.Long); Reason: null; nested exception is java.lang.NullPointerException
at org.springframework.data.repository.query.QueryCreationException.create(QueryCreationException.java:101) ~[spring-data-commons-2.7.8-20230216.231505-41.jar:2.7.8-SNAPSHOT]
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.lookupQuery(QueryExecutorMethodInterceptor.java:107) ~[spring-data-commons-2.7.8-20230216.231505-41.jar:2.7.8-SNAPSHOT]
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.lambda$mapMethodsToQuery$1(QueryExecutorMethodInterceptor.java:95) ~[spring-data-commons-2.7.8-20230216.231505-41.jar:2.7.8-SNAPSHOT]
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[na:na]
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133) ~[na:na]
at java.base/java.util.Collections$UnmodifiableCollection$1.forEachRemaining(Collections.java:1054) ~[na:na]
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na]
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[na:na]
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.mapMethodsToQuery(QueryExecutorMethodInterceptor.java:97) ~[spring-data-commons-2.7.8-20230216.231505-41.jar:2.7.8-SNAPSHOT]
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.lambda$new$0(QueryExecutorMethodInterceptor.java:87) ~[spring-data-commons-2.7.8-20230216.231505-41.jar:2.7.8-SNAPSHOT]
at java.base/java.util.Optional.map(Optional.java:265) ~[na:na]
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.(QueryExecutorMethodInterceptor.java:87) ~[spring-data-commons-2.7.8-20230216.231505-41.jar:2.7.8-SNAPSHOT]
at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:365) ~[spring-data-commons-2.7.8-20230216.231505-41.jar:2.7.8-SNAPSHOT]
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.lambda$afterPropertiesSet$5(RepositoryFactoryBeanSupport.java:323) ~[spring-data-commons-2.7.8-20230216.231505-41.jar:2.7.8-SNAPSHOT]
at org.springframework.data.util.Lazy.getNullable(Lazy.java:231) ~[spring-data-commons-2.7.8-20230216.231505-41.jar:2.7.8-SNAPSHOT]
at org.springframework.data.util.Lazy.get(Lazy.java:115) ~[spring-data-commons-2.7.8-20230216.231505-41.jar:2.7.8-SNAPSHOT]
at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:329) ~[spring-data-commons-2.7.8-20230216.231505-41.jar:2.7.8-SNAPSHOT]
at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:144) ~[spring-data-jpa-2.7.8-20230216.231902-43.jar:2.7.8-SNAPSHOT]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863) ~[spring-beans-5.3.25.jar:5.3.25]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800) ~[spring-beans-5.3.25.jar:5.3.25]
... 67 common frames omitted
Caused by: java.lang.NullPointerException: null
at org.springframework.data.jpa.repository.query.QueryUtils.createCountQueryFor(QueryUtils.java:607) ~[spring-data-jpa-2.7.8-20230216.231902-43.jar:2.7.8-SNAPSHOT]
at org.springframework.data.jpa.repository.query.DefaultQueryEnhancer.createCountQueryFor(DefaultQueryEnhancer.java:49) ~[spring-data-jpa-2.7.8-20230216.231902-43.jar:2.7.8-SNAPSHOT]
at org.springframework.data.jpa.repository.query.StringQuery.deriveCountQuery(StringQuery.java:119) ~[spring-data-jpa-2.7.8-20230216.231902-43.jar:2.7.8-SNAPSHOT]
at org.springframework.data.jpa.repository.query.AbstractStringBasedJpaQuery.(AbstractStringBasedJpaQuery.java:72) ~[spring-data-jpa-2.7.8-20230216.231902-43.jar:2.7.8-SNAPSHOT]
at org.springframework.data.jpa.repository.query.NativeJpaQuery.(NativeJpaQuery.java:53) ~[spring-data-jpa-2.7.8-20230216.231902-43.jar:2.7.8-SNAPSHOT]
at org.springframework.data.jpa.repository.query.JpaQueryFactory.fromMethodWithQueryString(JpaQueryFactory.java:51) ~[spring-data-jpa-2.7.8-20230216.231902-43.jar:2.7.8-SNAPSHOT]
at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$DeclaredQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:169) ~[spring-data-jpa-2.7.8-20230216.231902-43.jar:2.7.8-SNAPSHOT]
at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:253) ~[spring-data-jpa-2.7.8-20230216.231902-43.jar:2.7.8-SNAPSHOT]
at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:93) ~[spring-data-jpa-2.7.8-20230216.231902-43.jar:2.7.8-SNAPSHOT]
at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.lookupQuery(QueryExecutorMethodInterceptor.java:103) ~[spring-data-commons-2.7.8-20230216.231505-41.jar:2.7.8-SNAPSHOT]
... 89 common frames omitted
I tried maven dependecies re importing and dropping databse
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.
I upgraded spring boot from 2.2.5 to 2.5.7 and I'am using MongoDB. Since compilation failed i removed spring-boot-starter-mongo and i added below dependencies which resolved my compilation issues
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver</artifactId>
<version>3.11.2</version>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-sync</artifactId>
<version>3.11.0</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
<version>2.2.5.RELEASE</version>
With all above changes if i run application i am facing java.lang.ClassNotFoundException: org.springframework.data.mongodb.MongoDatabaseFactory
Also adding runtime log:
Need inputs to resolve this issue
2021-12-21 20:16:00.263 ERROR [ht-ui-api : ] 19004 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed
java.lang.IllegalArgumentException: Could not find class [org.springframework.data.mongodb.MongoDatabaseFactory]
at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:334) ~[spring-core-5.3.13.jar:5.3.13]
at org.springframework.core.annotation.TypeMappedAnnotation.adapt(TypeMappedAnnotation.java:446) ~[spring-core-5.3.13.jar:5.3.13]
at org.springframework.core.annotation.TypeMappedAnnotation.getValue(TypeMappedAnnotation.java:369) ~[spring-core-5.3.13.jar:5.3.13]
at org.springframework.core.annotation.TypeMappedAnnotation.asMap(TypeMappedAnnotation.java:284) ~[spring-core-5.3.13.jar:5.3.13]
at org.springframework.core.annotation.AbstractMergedAnnotation.asAnnotationAttributes(AbstractMergedAnnotation.java:193) ~[spring-core-5.3.13.jar:5.3.13]
at org.springframework.core.type.AnnotatedTypeMetadata.getAnnotationAttributes(AnnotatedTypeMetadata.java:106) ~[spring-core-5.3.13.jar:5.3.13]
at org.springframework.context.annotation.AnnotationConfigUtils.attributesFor(AnnotationConfigUtils.java:285) ~[spring-context-5.3.13.jar:5.3.13]
at org.springframework.context.annotation.AnnotationBeanNameGenerator.determineBeanNameFromAnnotation(AnnotationBeanNameGenerator.java:102) ~[spring-context-5.3.13.jar:5.3.13]
at org.springframework.context.annotation.AnnotationBeanNameGenerator.generateBeanName(AnnotationBeanNameGenerator.java:81) ~[spring-context-5.3.13.jar:5.3.13]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.registerBeanDefinitionForImportedConfigurationClass(ConfigurationClassBeanDefinitionReader.java:169) ~[spring-context-5.3.13.jar:5.3.13]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:150) ~[spring-context-5.3.13.jar:5.3.13]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:129) ~[spring-context-5.3.13.jar:5.3.13]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:343) ~[spring-context-5.3.13.jar:5.3.13]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247) ~[spring-context-5.3.13.jar:5.3.13]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311) ~[spring-context-5.3.13.jar:5.3.13]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112) ~[spring-context-5.3.13.jar:5.3.13]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746) ~[spring-context-5.3.13.jar:5.3.13]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) ~[spring-context-5.3.13.jar:5.3.13]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.7.jar:2.5.7]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:765) ~[spring-boot-2.5.7.jar:2.5.7]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:445) ~[spring-boot-2.5.7.jar:2.5.7]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[spring-boot-2.5.7.jar:2.5.7]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-2.5.7.jar:2.5.7]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-2.5.7.jar:2.5.7]
at com.htds.api.HtUiApiApplication.main(HtUiApiApplication.java:15) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[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:564) ~[na:na]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) ~[spring-boot-devtools-2.5.7.jar:2.5.7]
Caused by: java.lang.ClassNotFoundException: org.springframework.data.mongodb.MongoDatabaseFactory
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[na:na]
at java.base/java.lang.Class.forName0(Native Method) ~[na:na]
at java.base/java.lang.Class.forName(Class.java:468) ~[na:na]
at org.springframework.boot.devtools.restart.classloader.RestartClassLoader.loadClass(RestartClassLoader.java:145) ~[spring-boot-devtools-2.5.7.jar:2.5.7]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[na:na]
at java.base/java.lang.Class.forName0(Native Method) ~[na:na]
at java.base/java.lang.Class.forName(Class.java:468) ~[na:na]
at org.springframework.util.ClassUtils.forName(ClassUtils.java:284) ~[spring-core-5.3.13.jar:5.3.13]
at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:324) ~[spring-core-5.3.13.jar:5.3.13]
... 29 common frames omitted
Why you "upgrade spring boot to 2.5.7"? (why, today, not 2.6.1?;) But why do you leave spring-data-mongodb: 2.2.5.RELEASE ?
Please align
I.e.: Confirm spring-data-mongodb version with spring-boot version (or vice versa)! In case of 2.5.7, these would be:
org.mongodb:mongodb-driver-sync:4.2.3
org.springframework.data:spring-data-mongodb:3.2.7
...proof for both. #
For upgrading spring-data-mongodb (or not!) 2.x -> 3.x, (which is obviously required by upgrading to spring-boot:2.XXX), please refer to Reference Documentation#upgrading.2-3.
Hopefully also helpful: (latest) Spring Boot Release Notes (with quick links to previous releases, Ctrl+F, mongo... data;)
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
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 ; )