Spring Build ContextLoads FAILED - spring

I have a big problem. When I'm building my Project, I get this Error:
com.eurofunk.RaceComApplicationTests > contextLoads FAILED
java.lang.IllegalStateException
Caused by: org.springframework.beans.factory.BeanCreationException
Caused by: org.springframework.beans.BeanInstantiationException
Caused by: java.lang.UnsatisfiedLinkError
Could you please help me?

A UnsatisfiedLinkError is thrown
if the Java Virtual Machine cannot find an appropriate native-language definition of a method declared native.
So this does not look like a spring related problem.
It looks more like a problem with the JRE or a bean tries to find a native library which does not exist.

Related

Grails Project Suddenly Missing Dependencies

I use multiple grails projects for various reporting and API related tasks. Yesterday when trying to build my projects I started getting various errors related to missing dependencies. I made no code changes to prompt these missing dependencies, some of which are coming from other packages that have been in use for years in my projects without ever complaining of these missing dependencies. Here is a sample of some of such errors:
C:\Users\Public\Grails3\fitment-app\grails-app\controllers\com\gammapowersports\FitmentProductController.groovy: 11: unable to resolve class org.apache.commons.io.FileUtils
And another:
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [grails.boot.config.GrailsApplicationPostProcessor]: Factory method 'grailsApplicationPostProcessor' threw exception; nested exception is org.grails.core.exceptions.GrailsRuntimeException: Failed to introspect class: class grails.plugin.springsecurity.rest.JwtService
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588)
... 23 common frames omitted
Caused by: org.grails.core.exceptions.GrailsRuntimeException: Failed to introspect class: class grails.plugin.springsecurity.rest.JwtService
at grails.core.ArtefactHandlerAdapter.isArtefact(ArtefactHandlerAdapter.java:129)
at grails.core.DefaultGrailsApplication.addOverridableArtefact(DefaultGrailsApplication.java:772)
at org.grails.plugins.AbstractGrailsPluginManager.registerProvidedArtefacts(AbstractGrailsPluginManager.java:310)
at grails.boot.config.GrailsApplicationPostProcessor.performGrailsInitializationSequence(GrailsApplicationPostProcessor.groovy:110)
at grails.boot.config.GrailsApplicationPostProcessor.initializeGrailsApplication(GrailsApplicationPostProcessor.groovy:93)
at grails.boot.config.GrailsApplicationPostProcessor.setApplicationContext(GrailsApplicationPostProcessor.groovy:225)
at grails.boot.config.GrailsApplicationPostProcessor.<init>(GrailsApplicationPostProcessor.groovy:77)
at grails.boot.config.GrailsAutoConfiguration.grailsApplicationPostProcessor(GrailsAutoConfiguration.groovy:69)
at com.gammapowersports.Application.grailsApplicationPostProcessor(Application.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 24 common frames omitted
I can solve these errors by adding dependencies to satisfy the dependencies specifically, which I have done to get my projects building again.
My question is why did these dependencies suddenly start failing? I'm wondering if it is related to the migration away from Bintray as the main plugin provider for Grails. Has anyone else experienced these issues?
The most COMMON issue is just that you need to refresh your dependencies. Run this command:
./gradlew clean;./gradlew build --stacktrace --refresh-dependencies
This should give clean your cache and refresh your dependencies.
For the record, bintray has said they will continue to maintain all the old repos/archives but they will not acept any new ones.

Quarkus migration, rest endpoints test problem - TestInstantiationException because of IllegalArgumentException

I am migrating application to quarkus. To current point with success. But I meet a problem which currently I can not bypass. I have rest endpoints and when I run app they are working perfectly. But when I am trying to use quarkus test framework to test them (#QuarkusTest) I am getting a bit nondescriptive error:
org.junit.jupiter.api.extension.TestInstantiationException: TestInstanceFactory [io.quarkus.test.junit.QuarkusTestExtension] failed to instantiate test class [com.daimler.pia.input.globus.resource.rest.impl.GreetingResourceTest]: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.deployment.steps.ConfigBuildSteps#generateConfigSources threw an exception: java.lang.IllegalArgumentException
at org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:79)
at io.quarkus.gizmo.GizmoClassVisitor.<init>(GizmoClassVisitor.java:22)
at io.quarkus.gizmo.ClassCreator.writeTo(ClassCreator.java:150)
at io.quarkus.gizmo.ClassCreator.close(ClassCreator.java:203)
at io.quarkus.deployment.steps.ConfigBuildSteps.generateConfigSources(ConfigBuildSteps.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:915)
at io.quarkus.builder.BuildContext.run(BuildContext.java:279)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2011)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1535)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1426)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:479)
[...]
[error]: Build step io.quarkus.jaeger.deployment.JaegerProcessor#setupTracer threw an exception: java.lang.IllegalArgumentException
[...]
[error]: Build step io.quarkus.deployment.logging.LoggingResourceProcessor#setupLoggingRuntimeInit threw an exception: java.lang.IllegalArgumentException
[...]
basicly after each [error] stack trace is the same.
I found some cases on web describing problems with IllegalArgumentException and Quarkus, but usually there was some additional information.
I tried to move example from https://github.com/quarkusio/quarkus-quickstarts/tree/master/getting-started-testing to my project, result was the same. Unfortunetly for time being I do not have time to deal with it. But eventually I will have to go back o that problem. Therefore I have decided to post here my problem becasue I propabbly am missing some small thing (or not) and maybe someone already solve that problem.

Getting "Caused by: java.lang.IllegalStateException: HTTP Server cannot be loaded: No implementation of HttpServerFacade found on classpath." error

I am trying out the distributed random forest implementation of H2O using sparkling-water. But I am facing the following error when I run the spark-submit command.
Exception in thread "H2O Launcher thread" java.lang.ExceptionInInitializerError
at water.init.NetworkInit.initializeNetworkSockets(NetworkInit.java:77)
at water.H2O.startLocalNode(H2O.java:1621)
at water.H2O.main(H2O.java:2081)
at water.H2OStarter.start(H2OStarter.java:22)
at water.H2OStarter.start(H2OStarter.java:47)
at org.apache.spark.h2o.backends.internal.InternalBackendUtils$$anonfun$6$$anon$1.run(InternalBackendUtils.scala:173)
Caused by: java.lang.IllegalStateException: HTTP Server cannot be loaded: No implementation of HttpServerFacade found on classpath. Please refer to https://0xdata.atlassian.net/browse/TN-13 for details.
at water.webserver.iface.HttpServerLoader.<clinit>(HttpServerLoader.java:16)
... 6 more
I have tried out the solution mentioned at the location https://0xdata.atlassian.net/browse/TN-13
but for some reason it still isn't able to find the ai.h2o:h2o-jetty-8 on the classpath.
I resolved the issue by adding the following maven coordinates to the packages option in spark-submit
--packages ai.h2o:h2o-jetty-8:3.24.0.3

JAVA Classpath and jersey client

I had this problem for last few weeks and whenever i run a java application the following exception :
java.lang.NoClassDefFoundError: com/sun/jersey/core/util/FeaturesAndProperties
Caused by: java.lang.ClassNotFoundException:
com.sun.jersey.core.util.FeaturesAndProperties
The problem was jerseyclient.jar, jersey.jar and javax.ws.rs.jar was there in JDK classpath and also there a dependency shich had these files so the that caused this exception. Hope it helps someone !!!

Unable to start neo4j afer copying elasticsearch jar files to plugin folder

I am getting below error in neo4j console.log after copying jar files from dependency folder of elasticsearch to plugin folder of neo4j
2015-12-11 08:08:21.697+0000 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase#623dc0b8' was successfully initialized, but failed to start. Please see attach
ed cause exception. Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase#623dc0b8' was successfully initialized, but failed to start. Please see attached cause exception.
org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase#623dc0b8' was successfully initialized, but failed to start. Please see attached cause exceptio
n.
at org.neo4j.server.exception.ServerStartupErrors.translateToServerStartupError(ServerStartupErrors.java:67)
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:234)
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:97)
at org.neo4j.server.CommunityBootstrapper.start(CommunityBootstrapper.java:48)
at org.neo4j.server.CommunityBootstrapper.main(CommunityBootstrapper.java:35)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.server.database.LifecycleManagingDatabase#623dc0b8' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:462)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:111)
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:194)
... 3 more
Caused by: java.lang.RuntimeException: Error starting org.neo4j.kernel.impl.factory.CommunityFacadeFactory, /var/lib/neo4j/data/graph.db
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:143)
at org.neo4j.kernel.impl.factory.CommunityFacadeFactory.newFacade(CommunityFacadeFactory.java:43)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:108)
at org.neo4j.server.CommunityNeoServer$1.newGraphDatabase(CommunityNeoServer.java:66)
at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:95)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:452)
... 5 more
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.extension.KernelExtensions#28d2afd8' failed to initialize. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.init(LifeSupport.java:434)
at org.neo4j.kernel.lifecycle.LifeSupport.init(LifeSupport.java:66)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:102)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:139)
... 10 more
Caused by: org.neo4j.kernel.impl.util.UnsatisfiedDependencyException: java.lang.IllegalArgumentException: No dependency satisfies type class org.neo4j.kernel.impl.util.StringLogger
at org.neo4j.kernel.impl.util.DependenciesProxy$ProxyHandler.invoke(DependenciesProxy.java:79)
at com.sun.proxy.$Proxy6.getStringLogger(Unknown Source)
at org.neo4j.elasticsearch.ElasticSearchKernelExtensionFactory.newKernelExtension(ElasticSearchKernelExtensionFactory.java:39)
at org.neo4j.elasticsearch.ElasticSearchKernelExtensionFactory.newKernelExtension(ElasticSearchKernelExtensionFactory.java:20)
Your problem could be because Neo4j and ElasticSearch using different version of Lucene.
In JVM you can't have one jar with two different versions.

Resources