facebook

Tomcat 5 compiled JSPs

  1. MyEclipse IDE
  2.  > 
  3. Installation, Configuration & Updates
Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • #205738 Reply

    I’m trying to get debugging working using ME 2.7GA and Tomcat 5.0.19. I have added a source folder to look at the compiled JSP files. These files appear in <tomcat>/work/catalina/localhost/<website>. The JSP compiled source uses the package org.apache.jsp as expected, but when trying to debug with a breakpoint in the JPS I get the message:

    “Source not found for welcome_jsp._jspService(HttpServletRequest, HttpServletResponse) line: 138”

    From reading other postings and using Google, my understanding is that for Tomcat 5 the compiled JSP files should be placed in a directory structure that matches the package structure (ie org/apache/jsp/<website>) but this is not happening. So the source folder in Eclipse brings up lots of errors of the form:

    “The declared package does not match the expected package”

    Can anyone help solve these problems (they may even be related).

    Thanks,

    Allen

    #205740 Reply

    Riyad Kalla
    Member

    Allen,
    I think your problem isn’t actually Tomcat related, but Java source related. Can you tell us what your project directory structure is, which dir is your web root, which one is your source folder, and which one is your output path? Also, can you copy the package statement out of one of your files and paste it in here, and tell us exactly the path of the file (so we can see why you are getting the package errors).

    #205741 Reply

    The directory structure is as follows:

    c:\eclipse\workspace\dolphin\src – Java source
    c:\eclipse\workspace\dolphin\public_html – web root
    c:\eclipse\workspace\dolphin\public_html\WEB-INF\classes – Java output directory

    The compiled JSP source goes in the c:\Tomcat\work\catalina\localhost\dolphin directory. I then have set-up a source folder in Eclipse linked to this remote directory.

    The package statement out of one of the compiled JSP files is:
    package org.apache.jsp;
    for a file: /public_html/welcome.jsp

    Does that help ?

    Allen

    #205742 Reply

    Riyad Kalla
    Member

    Allen,
    When you say “setup a source folder in Eclipse linked to remote directory”, do you mean that you added a src directory in Eclipse IN your project, and pointed its contents to this Tomcat directory? I’d say this is your first problem… these files are temporary and compiled by the Application Server for its own use. You are free to open up the .java files if you need to see how your JSPs were translated, but these generated files aren’t intended to be loaded up into an Eclipse project.

    Also I would suggest you upgrade to 2.7.1 as I *believe* the “can’t debug with underscores in path” bug was still in the 2.7 GA release, but fixed in the 2.7.1 release, and I noticed you have an underscore in your name “public_html”.

    So to recap:
    1) Remove that source directory from yoru project that you have linking over to Tomcat
    2) Upgrade MyEclipse to 2.7.1

    Let me know if that fixes your problems.

    #205744 Reply

    I just double checked and I am in fact running 3.7.1. The reason I added the link to the remote Tomcat directory was because another thread had suggested this as a solution to the “Source not found for welcome_jsp._jspService(HttpServletRequest, HttpServletResponse) line: 138” error message.

    BTW I’m running JDK1.4.1_07 (1.4.1_01 gave the same issue).

    The main problem here is how to get it debugging JSP files with breakpoints specified in the JSP. It stops at the breakpoint, but can’t find the source file. How do I resolve that ?

    Allen

    #205745 Reply

    Scott Anderson
    Participant

    Allen,

    What version of Java are you running Eclipse itself with? You can find this out easily by looking in the log file located at <workspace>/.metadata/.log. You should be launching Eclipse with version 1.4.1 also since 1.3.x has some problems with debugging.

    #205747 Reply

    The log file say:

    !SESSION Apr 08, 2004 14:57:45.531 ———————————————
    java.version=1.4.1_07
    java.vendor=Sun Microsystems Inc.

    #205749 Reply

    The full log actually has some errors. Could these give any indication of what might be happening ?

    !SESSION Apr 08, 2004 15:04:30.765 ———————————————
    java.version=1.4.1_07
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB
    !ENTRY org.eclipse.osgi Apr 08, 2004 15:04:30.781
    !MESSAGE Bundle reference:file:d:/eclipse3M7/plugins/org.eclipse.debug.ui_3.0.0 [28] was not resolved
    !ENTRY org.eclipse.osgi Apr 08, 2004 15:04:30.781
    !MESSAGE Bundle reference:file:d:/eclipse3M7/plugins/org.eclipse.jdt.debug_3.0.0 [37] was not resolved

    #205750 Reply

    Riyad Kalla
    Member

    What directory do you have Tomcat installed to? Also are you running Tomcat with the same JDK you are running Eclipse with?

    #205752 Reply

    Tomcat is installed into c:\program files\Apache Software Foundation\Tomcat 5.0

    MyEclipse is set-up for Tomcat 5 to point to JDK 1.4.1_07, so they are running the same one.

    #205754 Reply

    Riyad Kalla
    Member

    Allen,
    Can you do me a favor and reinstall Tomcat to C:\Tomcat 5, we have seen numerous reports (mostly related to the server connectors) that had problems dealing with paths with dir names longer than 8 chars. I’m wondering if this is a similar problem, manifesting itself in a different way. (note: this only seems to occur on Windows).

    Let us know if that fixed the problem, then I can add something to the FAQ about problems with Tomcat and long path names.

    #205757 Reply

    Unfortunately that didn’t help 😥

    #205759 Reply

    The thread here mentions about making the source available by using a link to the Tomcat compiled JSPs. Is that the recommended way, because I couldn’t get it to work !

    #205760 Reply

    Scott Anderson
    Participant

    Allen,

    First, the link folder SHOULD NOT be used because it links to servlet source. Our JSP debugging implementation uses JSP source level debugging for all JSR-045 compliant containers. The thread you reference is for JBoss 3.2.3, and it uses Tomcat 4, which is not JSR-045 compliant. The cases are completely different. For Tomcat 5 source lookups should be happening automatically and even if they don’t, creating the link folder will definately not help and may even hinder the source lookup.

    What I’d suggest is this. Create a new Web project and add use our wizard to add a single JSP to it. The boilerplate from the wizard is fine. Now, deploy this project to Tomcat 5 and ensure the page loads. Next, set a breakpoint in the JSP (be sure to use our JSP editor to do it) and then refresh the page. Did the breakpoint stop and was the source found?

    #205762 Reply

    I did that. The debugger stopped at the breakpoint, but did not find the source code. I was definitely using your JSP editor to set the breakpoint.

Viewing 15 posts - 1 through 15 (of 24 total)
Reply To: Tomcat 5 compiled JSPs

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