facebook

Deployment with Tomcat [Closed]

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #218799 Reply

    wseubert
    Member

    I have been using MyEclipse successfully to learn enough about J2EE stuff to feel comfortable starting my project. I have always launched Tomcat via MyEclipse so I decided to actually try starting the service and testing my web app that way.

    My test app does a little of a lot of different stuff. One of the things it does is utilize the realms which are setup in an Access dBase. When I try to run my web app by starting the Tomcat service directly and logging into a protected area I get:

    (localhost_log.2004-11-03.txt)
    ApplicationDispatcher[/HelloWorldJSP] Servlet.service() for servlet jsp threw exception
    Unable to find a javac compiler;
    com.sun.tools.javac.Main is not on the classpath.
    Perhaps JAVA_HOME does not point to the JDK

    -and-

    (Stdout.log)
    Nov 3, 2004 3:37:05 PM org.apache.catalina.authenticator.FormAuthenticator authenticate
    WARNING: Unexpected error forwarding to error page
    org.apache.jasper.JasperException: Unable to compile class for JSP

    I have JAVA_HOME pointing to my C:\j2sdk1.4.2_05 which is the default location.

    Does anyone have a clue what I might me doing wrong?
    Why is it different when I start Tomcat via MyEclipse?

    Thanks in advance…

    #218806 Reply

    Scott Anderson
    Participant

    The problem is that the version of Java being found in the Tomcat script is not the version that JAVA_HOME points to. Basically, a different JRE (not a JDK) is being found on your path when the service tries to run Java.

    #218814 Reply

    wseubert
    Member

    OK, two things…

    1. You are right, there is more than one version of Java in my path. I can’t change that because one of my apps (PVCS) needs it that way so I’m going to look for a way to tell Tomcat which version to use. If you can push me in the right direction that would be helpful.

    2. Is this the type of thing you pick up through experience or was there a hint in the error logs?

    Thanks again…

    #218818 Reply

    Riyad Kalla
    Member

    1. Off the top of my head I can’t think of one since you are using the service and not the bat file, otherwise I’d say just hard code it.

    2. You see it enough times to recognize that when Tomcat complains about the javac problem, a JRE is likely being used to run Tomcat and not a JDK, that means tools.jar and javac will not be accessible to Tomcat, which means it can’t compile its JSP pages. Tomcat 5.5 works around this by integrating the Eclipse JDT compiler, so it has its own compiler now.

    #219001 Reply

    wseubert
    Member

    Thanks for the tip on using the startup.bat file. For some reason using the bat file works but starting the service doesn’t. Oh well, I’ve got it working so I’ll just forget about the service…

    Thanks again for helping me with something that’s outside the scope of your product.
    Wally

    #219002 Reply

    Riyad Kalla
    Member

    No problem Wally, we do what we can.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Deployment with Tomcat [Closed]

You must be logged in to post in the forum log in