facebook

Debuggin JSP – Source not found message

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

    Hello,
    I cannot get MyEclipse debug my JSP pages and will appreciate any help or pointers on this issue. I have an ant script that compiles my java files and uses war task to create a war file. That war file is then copied over to Weblogic’s application directory (<drive>:\bea\user_projects\domains\<domain_name>\applications). Since my Weblogic is configured to hot deploy, the war file gets deployed. Now when I set a breakpoint (on line 15) in the Jsp file and run the application, the IDE stops at the breakpoint and then it says “Source not found for __filename._jspService(HttpServletRequest, HttpServletResponse) line: 15”. However, when I set the breakpoint in a Java file (like action class), the debug works fine. It is really weird because I can see the generated source for the JSP files in the <drive>:\bea\user_projects\domains\<domain_name>\<server_name>\.wlnotdelete\extract\<server_name>___appsdir_<war_name>_war_<war_name> directory with line number information.

    This is portion of my weblogic.xml file.
    <weblogic-web-app>
    <jsp-descriptor>
    <jsp-param>
    <param-name>debug</param-name>
    <param-value>true</param-value>
    </jsp-param>
    <jsp-param>
    <param-name>compileCommand</param-name>
    <param-value>javac</param-value>
    </jsp-param>
    <jsp-param>
    <param-name>pageCheckSeconds</param-name>
    <param-value>5</param-value>
    </jsp-param>
    <jsp-param>
    <param-name>keepgenerated</param-name>
    <param-value>true</param-value>
    </jsp-param>
    </jsp-descriptor>
    <context-root>war_name</context-root>
    </weblogic-web-app>

    I have read some posts on the Myeclipse forum and made the suggested changes. However, I cannot get the debugger step through the JSP file. Is there a way to tell IDE to look for the source at this directory?

    Thanks,
    Balaji

    This is the configuration information. I didn’t see anything in the log file that could be relevant to this problem.

    *** Date: Thu Dec 08 10:07:10 MST 2005

    *** System properties:
    OS=WindowsXP
    OS version=5.1
    Java version=1.4.2_10

    *** MyEclipse details:
    MyEclipse Enterprise Workbench

    Version: 4.0.3 GA
    Build id: 20051025-4.0.3-GA

    *** Eclipse details:
    Eclipse SDK

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Platform

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse RCP

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Java Development Tools

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Plug-in Development Environment

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse Project SDK

    Version: 3.1.1
    Build id: M20050929-0840

    Eclipse startup command=-os
    win32
    -ws
    win32
    -arch
    x86
    -launcher
    C:\eclipse\eclipse.exe
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    d28_38
    -vm
    C:\Program Files\Java\j2re1.4.2_10\bin\javaw.exe

    #242884 Reply

    Riyad Kalla
    Member

    Balaji,
    IS your project a web project? If so you should be using MyEclipse to deploy your project, not Ant. The reason for this is MyEclipse needs to map the returned source maps from WebLogic back to a file, in the same location, within it’s own project. So if WebLogic returns a map like:

    /index.jsp:<source map data>

    and your project is actually like this:
    /Project/index.jsp

    and you don’t have a WebRoot set, then MyEclipse cannot find the index.jsp file in your project. That is why setting the WebRoot dir in the WebProject is important.

    #242888 Reply

    Thanks for the reply.

    Yes it is a Web project and I have MyEclipse generate the project. It has Webroot and all my JSP’s are in the pages directory under webroot. Should all the JSP’s be under WebRoot and not in pages directory?

    I agree that I should be using MyEclipse to deploy. But I have to use ant for this project. Do you think the debugging will not work if I use ANT? Is there a way to see the information (source maps) returned by WebLogic?

    Thanks,
    Balaji

    #242893 Reply

    Riyad Kalla
    Member

    Yes it is a Web project and I have MyEclipse generate the project. It has Webroot and all my JSP’s are in the pages directory under webroot. Should all the JSP’s be under WebRoot and not in pages directory?

    That’s ok, as long as they are also under the pages directory on the server.

    I agree that I should be using MyEclipse to deploy. But I have to use ant for this project. Do you think the debugging will not work if I use ANT? Is there a way to see the information (source maps) returned by WebLogic?

    As long as your dirs match up, it should work. No there is no way to see the source maps. Let me ask another person if they know what is going on.

    #242911 Reply

    Scott Anderson
    Participant

    What I would suggest to isolate the issue is this:
    1) ensure the weblogic.xml file is in the WEB-INF/ subdirectory under the webroot, not the META-INF directory
    2) Use the MyEclipse deployer (as a test) to deploy the application.
    3) Set a breakpoint in a JSP page and hit it with a browser.
    4) Is the source found as expected?

    If the above thest works, the issue is with your Ant script not specifying ‘debug’ in the appropriate so that compilation symbols are being from the compiled JSP or java files when it builds your WAR.

    #242926 Reply

    Hello Guys,
    Thanks for your help. I created a new web project with same folder hierarchy and used the same ant build file and weblogic.xml files to build and deploy the war file. In this new test project, I COULD successfully debug the jsps. The only difference between the two projects is that the first project uses struts tiles and I had breakpoint set in a jsp file which is included in a different file. Can MyEclipse debug through included files?

    Balaji

    #242939 Reply

    Scott Anderson
    Participant

    Balaji,

    Directly hitting breakpoints in included JSPs isn’t supported because when the breakpoint is set it’s impossible to know the inclusion context (as it might be included by 1000 other pages). What page that includes the fragment should really have a breakpoint? All? More information on this and simple workarounds are included here: http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-858-highlight-debugging+included+jsp.html

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Debuggin JSP – Source not found message

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