Could not load [java.lang.Math] - java

i've upgraded my tomcat and jdk to apache-tomcat-8.5.12 and jdk1.8.0_121. but seems i hit error after start it.
Please refer my error below :
09-Jun-2017 00:37:31.776 INFO [Timer-0] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [java.lang.Math]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [java.lang.Math]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1305)
at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1293)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1158)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
at org.apache.commons.pool.impl.GenericObjectPool.calculateDeficit(GenericObjectPool.java:1647)
at org.apache.commons.pool.impl.GenericObjectPool.ensureMinIdle(GenericObjectPool.java:1621)
at org.apache.commons.pool.impl.GenericObjectPool.access$700(GenericObjectPool.java:190)
at org.apache.commons.pool.impl.GenericObjectPool$Evictor.run(GenericObjectPool.java:1758)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Exception in thread "Timer-0" java.lang.NoClassDefFoundError: java/lang/Math
at org.apache.commons.pool.impl.GenericObjectPool.calculateDeficit(GenericObjectPool.java:1647)
at org.apache.commons.pool.impl.GenericObjectPool.ensureMinIdle(GenericObjectPool.java:1621)
at org.apache.commons.pool.impl.GenericObjectPool.access$700(GenericObjectPool.java:190)
at org.apache.commons.pool.impl.GenericObjectPool$Evictor.run(GenericObjectPool.java:1758)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: java.lang.ClassNotFoundException: Illegal access: this web application instance has been stopped already. Could not load [java.lang.Math]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1295)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1158)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
... 6 more
Caused by: java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [java.lang.Math]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1305)
at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1293)
... 8 more

This is a misleading error message by Tomcat and is not your root cause of the problem. Your instance has already stopped at this point due to something else going wrong.
Look in the Catalina (or any other) logs for something going wrong before this, which will be your root cause. This error message is just an annoying side-effect.
Lastly, a good rule when upgrading Tomcat is to remove the extracted webapp from the webapps folder to prevent caching issues and letting Tomcat do a fresh autodeploy the web archive.

Related

getting Exception in thread "main" java.lang.NoClassDefFoundError: weblogic.descriptor.BeanUpdateListener after applying weblogic 10.3.6 patch

getting error while applying patch on web logic 10.3.6 version .
Exception in thread "main" java.lang.NoClassDefFoundError:
weblogic.descriptor.BeanUpdateListener
Caused by: java.lang.ClassNotFoundException: weblogic.descriptor.BeanUpdateListener
this is the error in log file after applying patch . you need to give the execute permission at /prod/applc/bea1036/wlserver/server/lib directory to newly created .jar files.

NoClassDefFoundError during Tomcat graceful shutdown

We are getting NoClassDefFoundErrors during Tomcat graceful shutdown process (i.e. using catalina.sh stop command). We are using Tomcat version 6.0.44.
Note that this error can not be reproduced consistently. Another question suggests class loader related problems during execution of JVM shutdown hook. But in this case, the error is raised during the execution of the ServletFilter::destroy(...) method.
Could you please provide any insight?
java.lang.NoClassDefFoundError: com/google/common/cache/RemovalCause
at com.google.common.cache.LocalCache$Segment.remove(LocalCache.java:3147)
at com.google.common.cache.LocalCache.remove(LocalCache.java:4236)
at org.apache.curator.framework.imps.NamespaceWatcherMap.remove(NamespaceWatcherMap.java:71)
at org.apache.curator.framework.imps.CuratorFrameworkImpl.clearWatcherReferences(CuratorFrameworkImpl.java:189)
at org.apache.curator.framework.recipes.cache.PathChildrenCache.close(PathChildrenCache.java:376)
at org.apache.hadoop.security.token.delegation.ZKDelegationTokenSecretManager.stopThreads(ZKDelegationTokenSecretManager.java:456)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenManager.destroy(DelegationTokenManager.java:152)
at org.apache.hadoop.security.token.delegation.web.DelegationTokenAuthenticationHandler.destroy(DelegationTokenAuthenticationHandler.java:153)
at org.apache.hadoop.security.authentication.server.AuthenticationFilter.destroy(AuthenticationFilter.java:401)
at org.apache.solr.servlet.SolrHadoopAuthenticationFilter.destroy(SolrHadoopAuthenticationFilter.java:177)
at org.apache.catalina.core.ApplicationFilterConfig.release(ApplicationFilterConfig.java:360)
at org.apache.catalina.core.StandardContext.filterStop(StandardContext.java:4111)
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4880)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1279)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1385)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:307)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1392)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1656)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1665)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1645)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.google.common.cache.RemovalCause
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)

Exception - NoClassDefFoundError: org.apache.xml.security.Init

Hi may i know which library files am i missing in order to solve this exception ? Please help, thanks.
included : xmlsec-1.4.3
ERROR ] SRVE0777E: Exception thrown by application class 'org.apache.jasper.runtime.PageContextImpl.handlePageException:701'
com.ibm.websphere.servlet.error.ServletErrorReport: java.lang.NoClassDefFoundError: org.apache.xml.security.Init (initialization failure)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:701)
at [internal classes]
at com.ibm._jsp._newlistener._jspService(_newlistener.java:223)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:101)
at [internal classes]
Caused by: java.lang.NoClassDefFoundError: org.apache.xml.security.Init (initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:168)
at com.rexit.easc.SoapSender.sentSOAP(SoapSender.java:93)
at com.rexit.easc.testingXML.checkIsmNcd_value(testingXML.java:2815)
at com.rexit.easc.testingXML.proc_MOTOR(testingXML.java:517)
at com.rexit.easc.testingXML.processInput(testingXML.java:269)
at com.ibm._jsp._newlistener._jspService(_newlistener.java:182)
The problem seems to be that Init class can not be initialized (first loaded in JVM), it says initalization failure. From the code the only thing that happens during class initialization (some static code to be called) is creating Log. According to this article IBM WebShere has built-in Apache commons logging. LogFactory might not be created because of WebSphere configuration.

catalina.out logging same error continuously

I am getting the following error when deploying to Tomcat
org.apache.tomcat.util.net.JIoEndpoint$Acceptor run
INFO: Illegal access: this web application instance has been stopped already.
Could not load org.bouncycastle.crypto.modes.CBCBlockCipher.
The eventual following stack trace is caused by an error thrown for debugging purposes
as well as to attempt to terminate the thread which caused the illegal access,
and has no functional impact.
java.lang.IllegalStateException
and then
SEVERE: Socket accept failed
java.lang.NoClassDefFoundError: org/bouncycastle/crypto/modes/CBCBlockCipher
at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher.engineSetMode(Unknown Source)
at javax.crypto.Cipher$Transform.setModePadding(Cipher.java:357)
at javax.crypto.Cipher.chooseProvider(Cipher.java:847)
at javax.crypto.Cipher.init(Cipher.java:1348)
at sun.security.ssl.CipherBox.(CipherBox.java:175)
at sun.security.ssl.CipherBox.newCipherBox(CipherBox.java:208)
...
at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:352)
at java.lang.Thread.run(Thread.java:722)
The NoClassDefFoundError exception is being logged into catalina.out continuously (looping) and catalina.out gets full in short time.
Tomcat version is 6.0.24.
You should obviously remove the class causing the issues, since that is the expected behavior of tomcat if this Thread is frequently being invoked.

ClassNotFoundException after instrumenting with cobertura

Using JBoss AS 7.1.1 I want to get code coverage after testing of my project, deployed as an .war.
It seemingly works as expected until the point where I am starting the server. Here is the error message:
13:20:49,571 SEVERE [net.sourceforge.cobertura.coveragedata.TouchCollector] (MSC service thread 1-8) Exception when registering class: com/project/Creator: java.lang.ClassNotFoundException: com.project.Creator from [Module "org.jboss.as.server:main" from local module loader #30c01f1c (roots: C:\Jboss\jboss-as-7.1.1.Final\modules)]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
at
An important part may be that without using --auxClasspath argument, I did get errors instrumenting this class because of dependencies. This should be fixed by the mentioned argument though.
Edit:
There are in two situations where I get problems.
During instrumentation, using the following command for instrumentation
C:\cobertura\cobertura-2.0.3\cobertura-instrument.bat" --basedir C:\Jboss\jboss-as-7.1.1.Final\standalone\deployments project.war --datafile C:\Jboss\jboss-as-7.1.1.Final\bin\cobertura.ser --auxClasspath ""C:\workspace\jboss-build\src\com\arbitrage\j2ee\common\dto\TypeData.java
which gives me the error
java.lang.RuntimeException: java.lang.ClassNotFoundException: com.arbitrage.j2ee.common.dto.TypeData
at net.sourceforge.cobertura.instrument.CoberturaClassWriter.getCommonSuperClass(CoberturaClassWriter.java:35)
But, when I start up JBoss, it does so without giving any errors.
However, when I stop JBoss I get this error:
ERROR [stderr] Exception in thread "Thread-45" java.lang.NoClassDefFoundError: net/sourceforge/cobertura/coveragedata/TouchCollector$ApplyToClassDataLightClassmapListener
In the second case instrumentation goes well with the following command
C:\cobertura\cobertura-2.0.3\cobertura-instrument.bat" addInstrumentationToArchive C:\Jboss\jboss-as-7.1.1.Final\standalone\deployments\screator.war --includeClasses "com.project.*" --datafile C:\Jboss\jboss-as-7.1.1.Final\bin\cobertura.ser --auxClasspath "C:.m2\repository\com\project\1\project-1.jar
Which gives me an OK
INFO: Cobertura: Saved information on 41 classes.
Now the problem occurs when starting up JBoss
SEVERE net.sourceforge.cobertura.coveragedata.TouchCollector Exception when registering class: com/project/Creator: java.lang.ClassNotFoundException: com.project.Creator from [Module "org.jboss.as.server:main" from local module loader #30c01f1 (roots: C:\Jboss\jboss-as-7.1.1.Final\modules)].
etc etc.
I have added -Djboss.shutdown.forceHalt=false to the VM arguments.
Help is much appreciated,
Thanks!

Categories