This week's book / license giveaways are in the JDBC and Relational Databases and Java in General forums.
We're giving away four copies each of PostGIS in Action and Java Advanced Topics Training and have the authors on-line!
See this thread and this one for details.
The moose likes Tomcat and the fly likes Tomcat Hangs during startup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat Hangs during startup" Watch "Tomcat Hangs during startup" New topic
Author

Tomcat Hangs during startup

Tim-Ting Chang
Greenhorn

Joined: Jan 13, 2009
Posts: 25
My OS is winVista ultimate, I downloaded tomcat 6.0.18 and installed fine. when i run "startup" command, the dos window outputs a bunches of error regarding access denied when writing to log files. I don't want to paste the error code here because it is too long; what should i do now to find the problem?

I tried to start the server in netBean, it took a long time. and finally says it fails on startup. my netbean runs fine with pre-packaged glassfish.

how do i find out the ports to which the tomcat server listens to?
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

ting yun wrote:. I don't want to paste the error code here because it is too long; what should i do now to find the problem?

At least you can paste the part of error message, which can be helpful.

ting yun wrote:

how do i find out the ports to which the tomcat server listens to?


Look at the CATALINA_HOME/conf/server.xml, edit it to change port address.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Tim-Ting Chang
Greenhorn

Joined: Jan 13, 2009
Posts: 25
Original error output from netBean output window:



Note: netBean informed me that tomcat failed on startup. when i tried to started again, netbean say port 8080 is already in use. there is no other application server running. when i open IE and type http://localhost:8080/ it hangs there for a long time (more than five minutes).

i also installed the glassfish that came with netBean and it worked fine when i start it under netBean.

I set TOMCAT_HOME = tomcat installation directory, and my JAVA_HOME is set to my J2SE sdk1.6.




Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Seems like you deleted some file, log files.

The only problem I think is to uninstall tomcat & reinstall..
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

ting yun wrote:Original error output from netBean output window:


first,start tomcat without using netbeans(using startup.bat) ,you get any error?
Tim-Ting Chang
Greenhorn

Joined: Jan 13, 2009
Posts: 25
When I typed "startup" under tomcat/bin another windows pop up with a lot of error msgs, eventhough it says "INFO: Server startup in 112ms", it still isn't working.

I open IE 7, Firefox and typed "http://localhost:8080". The browser just keep loading and loading and never finishes.

First time i tried using Windows service install, the second time unzip directory to c drive undre the default install directory. Both of them display same error. The reason i start tomcat under netBean is so that I can copy the error msg. but they are basically saying the same thing.

I installed websphere and ibm java 1.5 sdk. i thought it might conflict with tomcat so i removed the java 1.5 sdk implemented by ibm. when i read the output from tomcat, it also stated that it runs on sun's jre. It doesn't mention anything about sdk (or i am not awared of).

I am out of ideas now. usually we either install from .msi/.exe or unzip the binary, and that's all right? what else did i miss?

ting
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

First uninstall all the instances of tomcat from your machine and then unzipped the tomcat which can be downloaded from tomcat.apache.org site on c drive and then run..
Tim-Ting Chang
Greenhorn

Joined: Jan 13, 2009
Posts: 25
Cool. I got it working.

I stepped down from 6.0 to 5.5 and use windows msi install. Everything works perfectly.

Thanks for the response. Much appriciated!

Ting
Stefaan Huysentruyt
Greenhorn

Joined: Dec 16, 2005
Posts: 3

Tim-Ting Chang wrote:Original error output from netBean output window:

[code]Using CATALINA_BASE: C:\Program Files\Apache Software Foundation\apache-tomcat-6.0.18
Using CATALINA_HOME: C:\Program Files\Apache Software Foundation\apache-tomcat-6.0.18
Using CATALINA_TMPDIR: C:\Program Files\Apache Software Foundation\apache-tomcat-6.0.18\temp
WARNING: Unexpected exception resolving reference
java.io.FileNotFoundException: C:\Program Files\Apache Software Foundation\apache-tomcat-6.0.18\conf\tomcat-users.xml.new (Access is denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
...
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)


The user running Tomcat has no create nor write permissions to the conf, log and mayby work or temp directories.


-- "Be liberal in what you accept, and conservative in what you send."
-- Jon Postel (August 6, 1943 - October 16, 1998) Internet Pioneer
-- http://www.postel.org/postel.html
Shanky Sohar
Ranch Hand

Joined: Mar 17, 2010
Posts: 1051

please download zip files it is more effective..I think so


SCJP6.0,My blog Ranchers from Delhi
D Martinez
Greenhorn

Joined: Aug 02, 2011
Posts: 4

I know this post has been here a while, but hope my answer is at least somewhat helpful to anyone else running into this issue

I do not have a solution for the netBeans issue. I will be doing my development using Eclipse. But I may do a test with netBeans to see if I can come up with anything.

But for executing startup in command prompt (Windows 7 Professional here), I appear to have gotten rid of the error message and stack trace. I did this by doing "Run As..." and chosing my administrator account in Windows. So it seems when I first ran the command in DOS, I was running as a regular user, and had to tell Windows to run with higher privileges.

I'll keep this thread posted if I happen to run into anything that might help on netBeans. (unless someone else has found the solution already? )
Luis Cunha
Greenhorn

Joined: Sep 15, 2013
Posts: 1

In Netbean (I am using version 7.3):

In Windows 7 64-bit:

try exit the IDE and then restart it as Administrator

(right click the netbeans icon and select "run as admin")

solved the problem for me: no need for obscure changes in tomcat's files, paths, etc.

hope it helps
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat Hangs during startup