Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Tomcat startup errors
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
msb21
n00b
n00b


Joined: 24 Aug 2002
Posts: 47

PostPosted: Mon Jan 19, 2004 4:44 pm    Post subject: Tomcat startup errors Reply with quote

I emerged tomcat and am unable to start. I checked in catalina.log and here is the output.
Code:

Jan 19, 2004 10:39:58 AM org.apache.commons.modeler.Registry loadRegistry
INFO: Loading registry information
Jan 19, 2004 10:39:59 AM org.apache.commons.modeler.Registry getRegistry
INFO: Creating new Registry instance
Jan 19, 2004 10:40:00 AM org.apache.commons.modeler.Registry getServer
INFO: Creating MBeanServer
Jan 19, 2004 10:40:01 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on port 8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1.24
Exception during startup processing
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Caused by: java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start(Native Method)
        at org.apache.catalina.startup.HostConfig.threadStart(HostConfig.java:788)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:722)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:358)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
        at org.apache.catalina.core.StandardService.start(StandardService.java:497)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
        at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
        at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
        ... 5 more
Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start(Native Method)
        at java.lang.Shutdown.runHooks(Shutdown.java:126)
        at java.lang.Shutdown.sequence(Shutdown.java:165)
        at java.lang.Shutdown.exit(Shutdown.java:210)
        at java.lang.Runtime.exit(Runtime.java:90)
        at java.lang.System.exit(System.java:715)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:208)


My localhost_log.2004-01-19.txt reads,

Code:

2004-01-19 10:40:08 HostConfig[localhost] Error deploying web application directory webdav
java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start(Native Method)
        at org.apache.catalina.session.StandardManager.threadStart(StandardManager.java:832)
        at org.apache.catalina.session.StandardManager.start(StandardManager.java:661)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:3570)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
        at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:307)
        at org.apache.catalina.core.StandardHost.install(StandardHost.java:772)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:559)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:401)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:718)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:358)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
        at org.apache.catalina.core.StandardService.start(StandardService.java:497)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
        at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
        at org.apache.catalina.startup.Catalina.process(Catalina.java:180)



This appears to say that I am out of memory or that the JVM is out of memory... Here is the output of free,

Code:

root@zeus tomcat # free
             total       used       free     shared    buffers     cached
Mem:        514744     480580      34164          0      89452     202428
-/+ buffers/cache:     188700     326044
Swap:       506036          0     506036


I am not swapping, and have free RAM... does anyone have any thoughts? Thank you. Matt
Back to top
View user's profile Send private message
isaacpeel
n00b
n00b


Joined: 27 Jun 2005
Posts: 12

PostPosted: Fri Jul 22, 2005 2:27 pm    Post subject: Similare Error Reply with quote

I'm having a very similar error though its on a totally different version of Tomcat and quite some time has passed. Did you ever end up solving this problem?

My catalina.out file looks like this:

Code:
Jul 22, 2005 10:16:31 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jul 22, 2005 10:16:31 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 5258 ms
Jul 22, 2005 10:16:32 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jul 22, 2005 10:16:32 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.0.27
Jul 22, 2005 10:16:32 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Jul 22, 2005 10:16:32 AM org.apache.catalina.core.StandardHost getDeployer
INFO: Create Host deployer for direct deployment ( non-jmx )
Jul 22, 2005 10:16:32 AM org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:/etc/tomcat5/Catalina/localhost/manager.xml
Jul 22, 2005 10:16:35 AM org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:/etc/tomcat5/Catalina/localhost/admin.xml
Jul 22, 2005 10:16:37 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
Jul 22, 2005 10:16:37 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
Jul 22, 2005 10:16:39 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.webapp.admin.ApplicationResources', returnNull=true
Jul 22, 2005 10:16:45 AM org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:/etc/tomcat5/Catalina/localhost/balancer.xml
Jul 22, 2005 10:16:46 AM org.apache.catalina.core.StandardHostDeployer install
INFO: Installing web application at context path  from URL file:/opt/tomcat5/webapps/ROOT
Jul 22, 2005 10:16:46 AM org.apache.catalina.core.StandardHostDeployer install
INFO: Installing web application at context path /webdav from URL file:/opt/tomcat5/webapps/webdav
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:284)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:422)
Caused by: java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start(Native Method)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.<init>(ThreadPool.java:642)
        at org.apache.tomcat.util.threads.ThreadPool.openThreads(ThreadPool.java:515)
        at org.apache.tomcat.util.threads.ThreadPool.start(ThreadPool.java:148)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.startEndpoint(PoolTcpEndpoint.java:284)
        at org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:171)
        at org.apache.coyote.tomcat5.CoyoteConnector.start(CoyoteConnector.java:1527)
        at org.apache.catalina.core.StandardService.start(StandardService.java:489)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
        ... 6 more


I've completely removed tomcat and re-installed it and can't seem to get rid if this error. Any thoughts?
Back to top
View user's profile Send private message
rex123
Apprentice
Apprentice


Joined: 21 Apr 2004
Posts: 272

PostPosted: Fri Jul 22, 2005 3:03 pm    Post subject: Reply with quote

Tomcat outOfMemory errors are horrible. I've been dealing with them on and off for ages, and I'm not much closer to understanding them.

The JVM has memory limits, though, which you can set. By default the memory limit for a jvm is quite small.
To tweak them, edit /etc/conf.d/tomcat, and set something like CATALINA_OPTS="-Xmx512M -Xss256k -server -Xms140M"
Don't just use those values - look in man java for explanations of -Xmx, -Xss and -Xms, then see whether tweaking them works for you. The settings we use kind of work, but context restarts are a killer - better to restart the whole of tomcat. Also, top shows a huge memory usage for java more or less all the time, but I have a feeling it's partially spurious due to some weird kernel memory reporting anomolies. If anyone has any more experience of dealing with java/tomcat memory management on gentoo, I'd love to know.
Back to top
View user's profile Send private message
isaacpeel
n00b
n00b


Joined: 27 Jun 2005
Posts: 12

PostPosted: Fri Jul 22, 2005 3:06 pm    Post subject: Reply with quote

rex123, thank you for your reply, I just figured out what I was doing wrong. I had gone through the security handbook and had limited the number of threads any given user could use.

See: https://forums.gentoo.org/viewtopic-t-326640-highlight-tomcat+memory.html

I've fixed this problem by tweaking the settings as mentioned in the article.

thank you again
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum