I have changed the scope of my maven dependencies to provided and manually copied to tomcat/lib (to reduce my war file size).
My app now fails to deploy with a dreaded out of memory error.
java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "http-bio-8080-exec-3
It is a java/spring/hibernate app. Two itneresting errors on stacktrace
Dec 27, 2012 2:22:37 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [spring] in context with path [] threw exception [Handler processing failed; nested exception is java.lang.OutOfMemoryError: PermGen space] with root cause
java.lang.OutOfMemoryError: PermGen space
followed by
Dec 27, 2012 2:22:38 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [spring] in context with path [] threw exception [java.lang.ClassNotFoundException: org.apache.jsp.jsp.myLogin_jsp] with root cause
java.lang.ClassNotFoundException: org.apache.jsp.jsp.myLogin_jsp
This is outside of my IDE, when I run using intellij it works fine ... ?
setting CATALINA_OPTS in my start up script fixes the problem, why ?
Add for example -XX:MaxPermSize=128M JVM parameter, and see what's happening.
There is one interesting of this what you did. It is descrebed here. Shortly, the war would be smaller, but runtime memory consumption would be higher.
Related
I'm running a Gradle project in Docker and when I try to hit an endpoint through Postman I receive the following error. When I run it locally through Gradle it works fine and I can hit the endpoint no problem.
SEVERE: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: javax.sql.rowset.RowSetProvider] with root cause
java.lang.ClassNotFoundException: javax.sql.rowset.RowSetProvider
I've tried adding the Gradle dependency implementation 'javax.sql:rowset:1.0.1' but had no success as it throws a Gradle build error Could not find javax.sql.rowset:com.springsource.javax.sql.rowset:1.0.1.
On every server startup I get the following error:
GRAVE: Unable to process Jar entry
Mai 15, 2017 10:39:31 AM org.apache.catalina.startup.ContextConfig processAnnotationsJar
GRAVE: Unable to process Jar entry [fr/package/model/someClass.class] from Jar [jar:file:/C:/Folder-dev/work/eclipse/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/web/WEB-INF/lib/package-model-0.0.1-SNAPSHOT.jar!/] for annotations
java.io.EOFException
This was a well known error that was caused by some incompatibility issues between TOMCAT 7 & JDK <= 6.
In my case I'm working with this configurations:
Server number: 8.0.9.0
Server version: Apache Tomcat/8.0.9
Architecture: amd64
JVM Version: 1.8.0_131-b11
Can anyone help me to solve this issue ?
I upgraded to tomcat 8.5 and everything works fine.
I am using Grails Frame work and when i create a war file and deploy it on Tomcat-7, I am getting the below error. But some time the deployment is success.
Jul 29, 2016 10:19:23 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Jul 29, 2016 10:19:23 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [] startup failed due to previous errors
2016-07-29 10:19:23,951 [localhost-startStop-1] WARN lifecycle.ShutdownOperations - Error occurred running shutdown operation: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Jul 29, 2016 10:19:23 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Jul 29, 2016 10:19:23 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
Jul 29, 2016 10:19:23 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [net.sf.ehcache.CacheManager#6b0bbde6] but has failed to stop it. This is very likely to create a memory leak.
I am not able to understand why this is happening. Can anybody tell me what is the problem here ? I believe this error is coming because its not able to connect to mysql database due to some problem.
If you Google for this phrase: SEVERE: Error listener You'll get some explanation why this is happening.
Tomcat doesn't display by default log/exception messages in Listeners and Filters initialization code.
Try adding a logging.properties file and place it to WEB-INF/classes in your war with the following content:
org.apache.catalina.core.ContainerBase.[Catalina].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].handlers = java.util.logging.ConsoleHandler
to make it easier you can do it automatically in BuildConfig.groovy in the following way:
grails.war.resources = { stagingDir, args ->
def tomcatLoggingProperties = '''org.apache.catalina.core.ContainerBase.[Catalina].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].handlers = java.util.logging.ConsoleHandler'''
new File("${stagingDir}/WEB-INF/classes/logging.properties").write tomcatLoggingProperties
}
After deploying the war to Tomcat inspect your catalina.out log file. It should now give more feedback about the problem.
My project used tomcat 7 ,jdk 1.6 and spring 3.0.4. I changed tomcat version to 8, jdk to 1.7. It works perfectly in Luna IDE with tomcat installer.(Of course I changed servlet.jar to javax.servlet-api-3.1.0.jar because of an error)
My project is running perfectly with the tomcat8 (binary version) for windows, but the war file is not running with tomcat 8 (linux binary version) at linux server and its error is:
Jun 14, 2015 5:32:47 PM org.apache.catalina.core.StandardContext
listenerStart SEVERE: Exception sending context initialized event to
listener instance of class utils.SysParams
org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Failed to import bean definitions from relative
location [hibernate-beans.xml] Offending resource: ServletContext
resource [/WEB-INF/applicationContext.xml]; nested exception is
org.springframework.beans.factory.BeanDefinitionStoreException:
Unexpected exception parsing XML document from ServletContext resource
[/WEB-INF/hibernate-beans.xml]; nested exception is
java.lang.NoSuchMethodError:
org.springframework.beans.MutablePropertyValues.add(Ljava/lang/String;Ljava/lang/Object;)Lorg/springframework/beans/MutablePropertyValues;
Its a Spring 3.0 method which should work in your case as it works on localhost. I guess your linux tomcat has pre-3.0 Spring versions somewhere in classpath- which could be from this project or legacy project. On linux tomcat check your classpath, search for spring 2* jars and try deleting work/temp folders..
I am getting this error while clicking on the neo4j.bat file in Windows. I tried other answers on stackoverflow but none of them is working. I set all variables in path JAVA_HOME & JRE_HOME. It says database incorrectly shutdown, performing recovery. And then console goes off. I have installed jdk 1.7 & jre7.
Sep 15, 2013 11:52:57 PM org.neo4j.server.logging.Logger log
INFO: Setting startup timeout to: 120000ms based on -1
Sep 15, 2013 11:52:58 PM org.neo4j.server.logging.Logger log
SEVERE:
java.lang.RuntimeException: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.StoreLockerLifecycleAdapter#3e890800' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:280)
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:106)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:88)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:207)
at org.neo4j.kernel.impl.recovery.StoreRecoverer.recover(StoreRecoverer.java:114)
at org.neo4j.server.preflight.PerformRecoveryIfNecessary.run(PerformRecoveryIfNecessary.java:59)
at org.neo4j.server.preflight.PreFlightTasks.run(PreFlightTasks.java:70)
at org.neo4j.server.AbstractNeoServer.runPreflightTasks(AbstractNeoServer.java:280)
at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:160)
at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:86)
at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:49)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.StoreLockerLifecycleAdapter#3e890800' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:497)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:104)
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:258)
... 10 more
Caused by: org.neo4j.kernel.StoreLockException: Could not create lock file
at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:74)
at org.neo4j.kernel.StoreLockerLifecycleAdapter.start(StoreLockerLifecycleAdapter.java:40)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:491)
... 12 more
Sep 15, 2013 11:52:58 PM org.neo4j.server.logging.Logger log
SEVERE: Failed to start Neo Server on port [7474]
Most likely, you have an instance already running. Kill any Java processes and try again.