#1
  1. dont click here
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    409
    Rep Power
    12

    Help setting up Tomcat 4 w/ Apache 2


    Well i got it setup, and it runs, BUT

    it wont compile anything. I get an exception thrown saying unable to compile and a classname.

    I looked at the tomcat window and it says can not find
    com.sun.javac.Main
    JAVA_HOME might not point to the JDK, but
    JAVA_HOME is set to
    c:\j2sdk1.4.1_01
    where my jdk.

    i even tried setting JAVA_HOME to c:\j2sdk1.4.1_01\bin

    Any ideas on this?


    EDIT: Ok Servlets are working fine. Well those that came with the examples are working (were they precompiled??)

    But no JSP pages work.

    Here is the exact error i get
    Code:
    type Exception report
    
    message 
    
    description The server encountered an internal error () that prevented it from fulfilling this request.
    
    exception 
    
    org.apache.jasper.JasperException: Unable to compile class for JSP
    
    An error occurred at line: -1 in the jsp file: null
    
    Generated servlet error:
        [javac] Compiling 1 source file
    Last edited by Shocka; December 23rd, 2002 at 03:26 AM.
  2. #2
  3. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    I could swear I've run into this before, but specifics are escaping me right now.

    How is your classpath set? I think you need the tools.jar file in there in order to compile stuff.

    Also, I seem to remember the Tomcat 4.1 install figuring all that stuff out for itself... Maybe I was just lucky.
    -james
  4. #3
  5. dont click here
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    409
    Rep Power
    12
    i tired
    CLASSPATH C:\j2sdk1.4.1_01\lib
    and
    CLASSPATH C:\j2sdk1.4.1_01

    neither worked.

    I have JAVA_HOME set I have CATALINA_HOME set

    JAVA_HOME c:\j2sdk1.4.1_01

    CATALINA_HOME c:\Program Files\Apache Group\Tomcat 4

    i cant figure out whats wrong?


    reading the error from the Tomcat server screen it says basically can not find tools.javac.Main in classpath but its set..

    Oh well ill keep trucking.
  6. #4
  7. dont click here
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    409
    Rep Power
    12
    OK NOW i am even more confused I just decided to run tomcat

    by using catalina.bat run

    and IT WORKS!!!!

    but their start tomcat link it created doesnt work.. Now im confused and the next step is to figure out how to start tomcat so the command window isnt there.

    oh well..
  8. #5
  9. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    The only way to get rid of the command window (as far as I know) is to run it as a service.
    -james
  10. #6
  11. dont click here
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    409
    Rep Power
    12
    Originally posted by bricker42
    The only way to get rid of the command window (as far as I know) is to run it as a service.
    yah i gotta figure out how to get this to work. I have it as a service but it starts and stops. No idea why..
  12. #7
  13. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    Well, I just did a fresh install with jdk 1.4.0 and Tomcat 4.1.

    I don't have any environment variables set, and I have the jdk installed on my D: drive.

    The setup found the jdk, asked me what I wanted to install (nt service, etc.), and where I wanted to install it (D:, again). It installed, started the service, and now http://localhost:8080/index.jsp has some info about jakarta apache tomcat etc.

    So, my recommendation to you (since this has been taking forever ), is to uninstall tomcat, java, etc. Install the 1.4.x jdk. Grab the latest windows binary for tomcat at http://mirrors.theonlinerecordstore....cat-4.1.18.exe and install. It should go seemlessly .
    -james
  14. #8
  15. dont click here
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    409
    Rep Power
    12
    Originally posted by bricker42
    Well, I just did a fresh install with jdk 1.4.0 and Tomcat 4.1.

    I don't have any environment variables set, and I have the jdk installed on my D: drive.

    The setup found the jdk, asked me what I wanted to install (nt service, etc.), and where I wanted to install it (D:, again). It installed, started the service, and now http://localhost:8080/index.jsp has some info about jakarta apache tomcat etc.

    So, my recommendation to you (since this has been taking forever ), is to uninstall tomcat, java, etc. Install the 1.4.x jdk. Grab the latest windows binary for tomcat at http://mirrors.theonlinerecordstore....cat-4.1.18.exe and install. It should go seemlessly .
    advice taken will do after i get back from india in 3 weeks
  16. #9
  17. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    Ahhhh, man. But that's, like, practically forever!

    Let me know how it goes.
    -james
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2002
    Location
    Mexicali Mexico
    Posts
    23
    Rep Power
    0
    I ran into exactly the same problem

    My conclusions are that, the default installation of the Service done by the installer is incorrect, there must be a missing parameter.

    What I did is that, I stopped the Service, wich was displayed as Apache Tomcat 4.1 on my win2k Pro machine

    then, I ran the startup.bat file, and everything ran just fine, so I tought maybe the service was not installed correctly

    well, Then, I ran the shutdown.bat file, and started the Service, everything ran fine, except for the Add User Database option in the Administration web interface for tomcat, so I suppossed some parameter was not working

    what I did is that I run the uninstall method of the tomcat.exe to delete the apache tomcat 4.1 service, as this with the command line, I was located at the bin directory of the tomcat installation

    Code:
    tomcat.exe -uninstall "Apache Tomcat 4.1"
    Then I typed manually, well, I did not really type it, I did a copy paste from a URL I found through a google search at https://instruct.unc.edu/wcb/schools...ssages/11.html

    The trick is that everything has to be in one line, (with quotes and everything, as it is here bellow)

    Code:
    "%CATALINA_HOME%\bin\tomcat.exe" -install Tomcat "%JAVA_HOME%\jre\bin\client\jvm.dll"  -Djava.class.path="%CATALINA_HOME%\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar" -Dcatalina.home="%CATALINA_HOME%" -Xrs -start org.apache.catalina.startup.Bootstrap -params start -stop org.apache.catalina.startup.Bootstrap -params stop -out "%CATALINA_HOME%"\logs\stderr.log
    The new service is now named Tomcat, and everything runs just fine.

    I am happy at last !!!!

    Happy coding

IMN logo majestic logo threadwatch logo seochat tools logo