You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dan Armbrust <da...@gmail.com> on 2012/03/12 20:12:54 UTC

Hanging on startup?

Ok, I must be doing something silly...   I've deployed tomcat hundreds
of times, and never had something like this happen.

Just needed to test something simple on a new system.

Grabbed tomcat 7.0.26, unzipped it.

Configured it to run with my local java:

java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)

Changed the ports in server.xml from default, so it wouldn't collide
with anything.

Startup, and it hangs on app deploy:


Using CATALINA_BASE:   /stuff/utils/apache-tomcat-7.0.26
Using CATALINA_HOME:   /stuff/utils/apache-tomcat-7.0.26
Using CATALINA_TMPDIR: /stuff/utils/apache-tomcat-7.0.26/temp
Using JRE_HOME:
/stuff/utils/apache-tomcat-7.0.26/bin/../../java/jdk_x64_1.6.0_30/jre
Using CLASSPATH:
stuff/utils/apache-tomcat-7.0.26/bin/bootstrap.jar:/stuff/utils/apache-tomcat-7.0.26/bin/tomcat-juli.jar
Mar 12, 2012 7:07:39 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal
performance in production environments was not found on the
java.library.path: <snip>
Mar 12, 2012 7:07:39 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-9090"]
Mar 12, 2012 7:07:39 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-9099"]
Mar 12, 2012 7:07:39 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 944 ms
Mar 12, 2012 7:07:39 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mar 12, 2012 7:07:39 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
Mar 12, 2012 7:07:39 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory
/stuff/utils/apache-tomcat-7.0.26/webapps/ROOT


Nothing of interest in the log files, at all.

If I take out my specified JVM, and just let it find whatever happens
to be default on the system:

java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build pxa6460sr8-20100409_01(SR8))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux amd64-64
jvmxa6460sr8-20100401_55940 (JIT enabled, AOT enabled)
J9VM - 20100401_055940
JIT  - r9_20100401_15339
GC   - 20100308_AA)
JCL  - 20100408_01

Then it starts up and runs fine.

What could be causing this?  Is there a compatibility issue with this JVM?

Thanks,

Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Hanging on startup?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dan Armbrust [mailto:daniel.armbrust.list@gmail.com] 
> Subject: Re: Hanging on startup?

> I see Sun/Oracle  was as helpful as ever on this one:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6521844
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6202721

Can't comment in public...

> Anything that Tomcat could do to prevent itself from getting 
> stuck like this?

Not sure if it's possible, but I suppose the bootstrap mechanism could check for /dev/urandom in the system property and substitute /dev/./urandom.  Might even be able to introduce a "double secret probation" config tag to make /dev/./urandom the default unless otherwise specified.  Not sure if that would help a lot of people, since they'd likely still have to go through the debugging phase to figure out what was taking so long.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Hanging on startup?

Posted by Dan Armbrust <da...@gmail.com>.
Yep.

JAVA_OPTS=-Djava.security.egd=file:/dev/./urandom

prevents the hang.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Hanging on startup?

Posted by Dan Armbrust <da...@gmail.com>.
On Mon, Mar 12, 2012 at 2:34 PM, Caldarale, Charles R
<Ch...@unisys.com> wrote:
>> From: Dan Armbrust [mailto:daniel.armbrust.list@gmail.com]
>> Subject: Hanging on startup?
>
>> Startup, and it hangs on app deploy:
>
> Waiting for entropy to build up?  Take a few thread dumps with jstack to see who's waiting on what.  If it is entropy, see this discussion:
>
> http://marc.info/?l=tomcat-user&m=132769606728228&w=2
>
>
>  - Chuck
>
>

I think your right.

Here is the stack I just dug out:

"pool-2-thread-1" prio=10 tid=0x0000000040c4a800 nid=0x250e runnable
[0x00007f3895203000]
   java.lang.Thread.State: RUNNABLE
	at java.io.FileInputStream.readBytes(Native Method)
	at java.io.FileInputStream.read(FileInputStream.java:220)
	at sun.security.provider.SeedGenerator$URLSeedGenerator.getSeedBytes(SeedGenerator.java:493)
	at sun.security.provider.SeedGenerator.generateSeed(SeedGenerator.java:117)
	at sun.security.provider.SecureRandom.engineGenerateSeed(SecureRandom.java:114)
	at sun.security.provider.SecureRandom.engineNextBytes(SecureRandom.java:171)
	- locked <0x00000007d8b0ee08> (a sun.security.provider.SecureRandom)
	at java.security.SecureRandom.nextBytes(SecureRandom.java:433)
	- locked <0x00000007d8b0ee60> (a java.security.SecureRandom)
	at java.security.SecureRandom.next(SecureRandom.java:455)
	at java.util.Random.nextInt(Random.java:189)
	at org.apache.catalina.util.SessionIdGenerator.createSecureRandom(SessionIdGenerator.java:246)
	at org.apache.catalina.util.SessionIdGenerator.getRandomBytes(SessionIdGenerator.java:183)
	at org.apache.catalina.util.SessionIdGenerator.generateSessionId(SessionIdGenerator.java:153)
	at org.apache.catalina.session.ManagerBase.startInternal(ManagerBase.java:574)
	at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:466)
	- locked <0x00000007d8a327c8> (a org.apache.catalina.session.StandardManager)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	- locked <0x00000007d8a327c8> (a org.apache.catalina.session.StandardManager)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5282)
	- locked <0x00000007d89ca578> (a org.apache.catalina.core.StandardContext)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	- locked <0x00000007d89ca578> (a org.apache.catalina.core.StandardContext)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)

   Locked ownable synchronizers:
	- <0x00000007d89c1290> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)

Sigh.

I see Sun/Oracle  was as helpful as ever on this one:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6521844
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6202721

I'll try the workarounds in the thread you pointed out, thanks.

Anything that Tomcat could do to prevent itself from getting stuck like this?

Thanks,

Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Hanging on startup?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dan Armbrust [mailto:daniel.armbrust.list@gmail.com] 
> Subject: Hanging on startup?

> Startup, and it hangs on app deploy:

Waiting for entropy to build up?  Take a few thread dumps with jstack to see who's waiting on what.  If it is entropy, see this discussion:

http://marc.info/?l=tomcat-user&m=132769606728228&w=2


 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org