How to solve this ThrowableProxy exception on spring - spring

I have spring (gradle) application: spring version 1.5.2 and 2 java jar modules.
when I deployed on the server (amazon ami Linux) all is ok, but after ~2 minutes throw this exception
Exception in thread "http-nio-8585-exec-7" java.lang.NoClassDefFoundError: Exception in thread "http-nio-8585-exec-7" java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy
at ch.qos.logback.classic.spi.LoggingEvent.<init>(LoggingEvent.java:119)
at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:419)
at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:383)
at ch.qos.logback.classic.Logger.log(Logger.java:765)
at org.slf4j.bridge.SLF4JBridgeHandler.callLocationAwareLogger(SLF4JBridgeHandler.java:221)
at org.slf4j.bridge.SLF4JBridgeHandler.publish(SLF4JBridgeHandler.java:303)
at java.util.logging.Logger.log(Logger.java:738)
at java.util.logging.Logger.doLog(Logger.java:765)
at java.util.logging.Logger.logp(Logger.java:1042)
at org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:181)
at org.apache.juli.logging.DirectJDKLog.error(DirectJDKLog.java:147)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1451)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
How to solve this problem.
Thanks.

Related

Sometimes spring boot is not able to load a service or repository

Whenever my Spring Boot app starts I need to do sanitise some data.
So I've overridden the following method from CommandLineRunnner:
#Override
public void run(String... args) throws Exception {
Here I just call a repository (and also tried with a service with class the repository), it works in a few cases, but in a few cases, Tomcat is not able to boot my app.
All I get from catalina.log is:
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:756)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:986)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
BTW: it works on my machine (OS X) but the issue only appears when it is deployed to AWS (tomcat8).

Spring boot application fails to start on jboss eap 6.3

I have updated my project gradle dependency to spring boot 1.5.9 version.
After creating war application fails to start.
In startup I can see it is trying to start with spring boot 2.1 autoconfigurer.
There are many errors starts with Could not index class.
Also I have included hibernate 4.3 jar in gradle dependency but its importing hibernate core entity manager & validator 5.X jar in packaged war.
Any pointers on below issue would be of great help.
Final error is as highlighted below not sure what is the use of this jar.
JBAS018104: Deployment error processing SCI for jar: tomcat-embed-websocket-9.0.12.jar
17:34:47,921 WARN [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015852: Could not index class org/springframework/boot/autoconfigure/jms/artemis/ArtemisEmbeddedServerConfiguration.class at xxx/WEB-INF/lib/spring-boot-autoconfigure-2.1.0.RELEASE.jar: java.lang.IllegalStateException: Unknown tag! pos=20 poolCount = 270
at org.jboss.jandex.Indexer.processConstantPool(Indexer.java:606) [jandex-1.0.3.Final-redhat-2.jar:1.0.3.Final-redhat-2]
at org.jboss.jandex.Indexer.index(Indexer.java:640) [jandex-1.0.3.Final-redhat-2.jar:1.0.3.Final-redhat-2]
at org.jboss.as.server.deployment.annotation.ResourceRootIndexer.indexResourceRoot(ResourceRootIndexer.java:100) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
at org.jboss.as.server.deployment.annotation.AnnotationIndexProcessor.deploy(AnnotationIndexProcessor.java:51) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_181]
at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_181]
18:26:08,119 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-11) MSC000001: Failed to start service jboss.deployment.unit."Test-1.0.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."Test-1.0.war".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment "Test-1.0.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_181]
at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_181]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018104: Deployment error processing SCI for jar: tomcat-embed-websocket-9.0.12.jar
at org.jboss.as.web.deployment.ServletContainerInitializerDeploymentProcessor.loadSci(ServletContainerInitializerDeploymentProcessor.java:210)
at org.jboss.as.web.deployment.ServletContainerInitializerDeploymentProcessor.deploy(ServletContainerInitializerDeploymentProcessor.java:131)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [jboss-as-server-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]
... 5 more
**Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018104: Deployment error processing SCI for jar: tomcat-embed-websocket-9.0.12.jar**
at org.jboss.as.web.deployment.ServletContainerInitializerDeploymentProcessor.loadSci(ServletContainerInitializerDeploymentProcessor.java:202)
... 7 more

Getting java.lang.NoClassDefFoundError: org.elasticsearch.ElasticsearchException while run analysis on sonarqube

I'm constantly getting below error while running code analysis on sonarqube
Please help me to resolve it. Please find the Exception below;
java.lang.NoClassDefFoundError: org.elasticsearch.ElasticsearchException
at org.elasticsearch.action.support.AdapterActionFuture.rethrowExecutionException(AdapterActionFuture.java:91)
at org.elasticsearch.action.support.AdapterActionFuture.actionGet(AdapterActionFuture.java:46)
at org.sonar.server.es.request.ProxyRefreshRequestBuilder.get(ProxyRefreshRequestBuilder.java:42)
at org.sonar.server.es.request.ProxyRefreshRequestBuilder.get(ProxyRefreshRequestBuilder.java:32)
at org.sonar.server.es.BulkIndexer.stop(BulkIndexer.java:109)
at org.sonar.server.component.index.ComponentIndexer.delete(ComponentIndexer.java:117)
at org.sonar.server.computation.dbcleaner.IndexPurgeListener.onComponentsDisabling(IndexPurgeListener.java:44)
at org.sonar.db.purge.PurgeDao.purgeDisabledComponents(PurgeDao.java:143)
at org.sonar.db.purge.PurgeDao.purge(PurgeDao.java:73)
at org.sonar.server.computation.dbcleaner.ProjectCleaner.doPurge(ProjectCleaner.java:91)
at org.sonar.server.computation.dbcleaner.ProjectCleaner.purge(ProjectCleaner.java:64)
at org.sonar.server.computation.task.projectanalysis.step.PurgeDatastoresStep.execute(PurgeDatastoresStep.java:78)
at org.sonar.server.computation.task.projectanalysis.step.PurgeDatastoresStep.access$000(PurgeDatastoresStep.java:40)
at org.sonar.server.computation.task.projectanalysis.step.PurgeDatastoresStep$1.visitProject(PurgeDatastoresStep.java:65)
at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visitNode(DepthTraversalTypeAwareCrawler.java:70)
at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visitImpl(DepthTraversalTypeAwareCrawler.java:51)
at org.sonar.server.computation.task.projectanalysis.component.DepthTraversalTypeAwareCrawler.visit(DepthTraversalTypeAwareCrawler.java:39)
at org.sonar.server.computation.task.projectanalysis.step.PurgeDatastoresStep.execute(PurgeDatastoresStep.java:72)
at org.sonar.server.computation.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:64)
at org.sonar.server.computation.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:52)
at org.sonar.server.computation.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:75)
at org.sonar.ce.taskprocessor.CeWorkerImpl.executeTask(CeWorkerImpl.java:92)
at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:59)
at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:35)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
It is resolved after I remove indexes of elastic search
Removed ${SONARQUBE-HOME}/data/es
and restart sonarqube server
it resolved problem

ReflectionUtils.makeAccessible() in different .jar files lead to java.lang.NoSuchMethodError Exception on openJDK

i have the following problem: we raised our application from java6 with tomcat6 to java8 with tomcat8. Starting the application on our local machines with Oracle Java 8 worked witouth problem. But on our server we get
java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.makeAccessible(Ljava/lang/reflect/Constructor;)V
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:125)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:104)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:251)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4720)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:917)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1701)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
We investigated the problem and the ReflectionUtils.makeAccessible() Method is provided by spring-core-2.0.8.jar and org.springframework.core-3.0.4.RELEASE.jar
Our server is running OpenJDK 8 instead of Oracle Java 8 and it seems like the application tries to use makeAccessible() from the spring-core-2.0.8.jar instead of the org.springframework.core-3.0.4.RELEASE.jar. When we delete the spring-core-2.0.8.jar in our lib Folder the application starts without a problem. Unfortunately the spring-core-2.0.8.jar comes as a maven transitive dependency from a maven hibernate dependency, therefore we need this jar.
Do you have any ideas how to solve this?
Thanks in advance, best regards

Unable to find data for class 'org/springframework/boot/context/web/SpringBootServletInitializer'

I am getting this strange error while trying to start Spring Boot application in Servlet container.
The same WAR starts normally in standalone Tomcat server, but gives the error seen below if started using Gretty Gradle plugin
Any ideas that it means?
Spring-boot 1.3.3, Gradle 2.12, Gretty 1.2.4, Tomcat 8
java.lang.RuntimeException: Reloading agent exited via exception, please raise a jira
at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:104)
at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
...
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5066)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1399)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springsource.loaded.UnableToLoadClassException: Unable to find data for class 'org/springframework/boot/context/web/SpringBootServletInitializer'
at org.springsource.loaded.Utils.loadSlashedClassAsBytes(Utils.java:787)
at org.springsource.loaded.TypeRegistry.getDescriptorFor(TypeRegistry.java:311)
at org.springsource.loaded.TypeDescriptorExtractor$ExtractionVisitor.getTypeDescriptorFor(TypeDescriptorExtractor.java:124)
at org.springsource.loaded.TypeDescriptorExtractor$ExtractionVisitor.findTypeDescriptor(TypeDescriptorExtractor.java:140)
at org.springsource.loaded.TypeDescriptorExtractor$ExtractionVisitor.walkHierarchyForCatchersAndSuperDispatchers(TypeDescriptorExtractor.java:152)
at org.springsource.loaded.TypeDescriptorExtractor$ExtractionVisitor.computeCatchersAndSuperdispatchers(TypeDescriptorExtractor.java:219)
at org.springsource.loaded.TypeDescriptorExtractor$ExtractionVisitor.getTypeDescriptor(TypeDescriptorExtractor.java:81)
at org.sprce.loaded.TypeDescriptorExtractor.extract(TypeDescriptorExtractor.java:51)
at org.springsource.loaded.TypeRegistry.addType(TypeRegistry.java:912)
at org.springsource.loaded.agent.SpringLoadedPreProcessor.preProcess(SpringLoadedPreProcessor.java:302)
at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:102)
... 42 more
Apparently there is a bug in Gretty related to classloading.
Starting Gretty with WAR e.g. gradlew appRunWar allows to work around it.
There are multiple bugs opened for it:
https://github.com/akhikhl/gretty/issues/199
https://github.com/akhikhl/gretty/issues/209
https://github.com/akhikhl/gretty/issues/148

Resources