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 Apache Server not starting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "Apache Server not starting" Watch "Apache Server not starting" New topic
Author

Apache Server not starting

Arpan Patil
Greenhorn

Joined: Feb 23, 2013
Posts: 9
I know many have posted this question but I am not getting much from already posted answer
I have been trying to solve this problem since few days to no success
The JAVA_HOME environment variable is not defined properly while starting startup.bat file in extracted apache tomcat 6 Folder

It shows following error

C:\Users\HP\Downloads\apache-tomcat-6.0.36-windows-x64\apache-tomcat-6.0.36\bin>startup
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42955
    
  73
Check your environment variables - it seems that either the JAVA_HOME variable is not set, or not set to point to the right directory.
Arpan Patil
Greenhorn

Joined: Feb 23, 2013
Posts: 9
These are my environmental variables

JAVA_HOME in user variables: C:\Program Files (x86)\Java\jdk1.7.0_01;

JRE_HOME in user variables: C:\Program Files (x86)\Java\jre7;

PATH in user variables: C:\Program Files (x86)\Java\jdk1.7.0_01\bin;C:\Users\HP\Downloads\apache-tomcat-6.0.36-windows-x64\apache-tomcat-6.0.36\lib\servlet-api.jar;

CLASSPATH in System variable: C:\mysql-connector-java-5.1.23\mysql-connector-java-5.1.23\mysql-connector-java-5.1.23-bin.jar

The extracted apache folder is at following path

C:\Users\HP\Downloads\apache-tomcat-6.0.36-windows-x64\apache-tomcat-6.0.36\bin
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42955
    
  73
I notice that you have extraneous semi-colons in your JAVA_HOME and JRE_HOME variables.
Arpan Patil
Greenhorn

Joined: Feb 23, 2013
Posts: 9
Here's what I get after removing those extraneous semicolons. I did not get the previous error but server has not started

Using CATALINA_BASE: "C:\Users\HP\Downloads\apache-tomcat-6.0.36-windows-x64\apache-tomcat-6.0.36"

Using CATALINA_HOME: "C:\Users\HP\Downloads\apache-tomcat-6.0.36-windows-x64\apache-tomcat-6.0.36"

Using CATALINA_TMPDIR: "C:\Users\HP\Downloads\apache-tomcat-6.0.36-windows-x64\apache-tomcat-6.0.36\
temp"
Using JRE_HOME: "C:\Program Files (x86)\Java\jre7"
Using CLASSPATH: "C:\Users\HP\Downloads\apache-tomcat-6.0.36-windows-x64\apache-tomcat-6.0.36\
bin\bootstrap.jar"


Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42955
    
  73
Check the log files; there's probably something in there.
Arpan Patil
Greenhorn

Joined: Feb 23, 2013
Posts: 9
commons daemon file shows the following error

[2013-02-23 02:05:30] [info] Commons Daemon procrun (1.0.10.0 64-bit) started
[2013-02-23 02:05:30] [error] Unable to open the Service Manager
[2013-02-23 02:05:30] [error] Access is denied.
[2013-02-23 02:05:30] [error] Commons Daemon procrun failed with exit value: 8 (Failed to install service)
[2013-02-23 02:05:30] [error] Access is denied.
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42955
    
  73
Seems like a permissions problem that has little to do with Tomcat itself. Do you have admin rights on this machine?
Arpan Patil
Greenhorn

Joined: Feb 23, 2013
Posts: 9
I've solved this problem just now
I removed JRE_HOME
and now I've only JAVA_HOME as environment variable

But now I am getting different error in server's prompt as below (while running my application which uses MySql)

Java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
java.lang.NullPointerException
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42955
    
  73
Make sure the respective jar file is in WEB-INF/lib.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Apache Server not starting