facebook

cannot hit my breakpoint in jsp scriptlets,when debuging.thx

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

    biiasuo
    Member

    hi!
    I have a web project now.
    I can debug a java class,but I cannot debug a jsp file.
    I can add a breakpoint in a jsp file,however,when runing the jsp file in ie,the debugger just cannot hit the breakpoint.It seems that there’s no breakpoint in the jsp file at all.My web server is Weblogic8.1 and the version of myeclispe is:5.1.0 GA
    Can anyone help me?Thx a lot~

    
    <%@ page language="java" import="java.util.*,com.tjpu_d508.dbclasses.*,java.sql.*" pageEncoding="ISO-8859-1"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <base href="<%=basePath%>">
        
        <title>My JSP 'test.jsp' starting page</title>
        
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">    
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="This is my page">
        <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        -->
    
      </head>
      
      <body>
        This is my test JSP page. <br>
      <%
        DatabaseConnection db=new DatabaseConnection();
        ResultSet rs=db.query("select * from testtable"); // this is where I add a breakpoint
        String str=null;
        if(rs.next())
        {
         str=rs.getString(2);
          //System.out.println(str);
        }
        db.dbClose();
       %>
       <%=str %>
      </body>
    </html>
    
    #274101 Reply

    Loyal Water
    Member

    Was JSP debugging working earlier ? Can you switch to a brand new workspace and try debugging the JSP page again.

    Also, make sure you start the weblogic server in debug mode.

    #274136 Reply

    biiasuo
    Member

    @support-nipun wrote:

    Was JSP debugging working earlier ? Can you switch to a brand new workspace and try debugging the JSP page again.

    Also, make sure you start the weblogic server in debug mode.

    No,i have nerver debuged a jsp file with myeclipse before.uauslly,i just debuged a java class.I have tried a different workspace,but nothing happened .How could i start the weblogic server in debug mode?Do you mean “Window->Preferences->Application Servers->WebLogic 8->Launch->debug mode“.My “Optional Java Vm arguments” is like
    “-ms64m
    -mx64m
    -Djava.library.path=”D:/BEA/weblogic81/server/bin”
    -Dweblogic.management.discover=false
    -Dweblogic.ProductionModeEnabled=false

    #274155 Reply

    Loyal Water
    Member

    Do you mean “Window->Preferences->Application Servers->WebLogic 8->Launch->debug mode”.

    Yes, thats what I meant.

    Also make sure you setup WebLogic 8 to support JSP debugging as noted here:
    https://www.genuitec.com/forums/topic/weblogic-8-jsp-debugging-is-broken-but-it-supports-jsr-45/

    #274184 Reply

    biiasuo
    Member

    @support-nipun wrote:

    Do you mean “Window->Preferences->Application Servers->WebLogic 8->Launch->debug mode”.

    Yes, thats what I meant.

    Also make sure you setup WebLogic 8 to support JSP debugging as noted here:
    https://www.genuitec.com/forums/topic/weblogic-8-jsp-debugging-is-broken-but-it-supports-jsr-45/

    Thx a lot.I have done all that above before,but myeclipse still cannot debug jsp.
    By the way,there’s a warning when starting weblogic,which is like “Warning> <HTTP> <BEA-101248> <[network2007]: Deployment descriptor “web.xml” is malformed. Check against the DTD: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element ‘web-app’. (line 2, column 222).> “.Can you tell me why? Thanks very much~

    #274205 Reply

    Loyal Water
    Member

    Does the server start without errors when started outside MyEclipse ?

    This is something I found in another post where the user was facing a similar problem. You can try this out as well.

    My guess is that your web.xml file is actually a Web 2.4 specification file (look at the top, are you referencing a schema? If you open your project properties, does it say J2EE 1.4 version under MyEclipse-Web?) and WebLogic 8 only supports J2EE 1.3, not 1.4.

    You can create a new J2EE 1.3 project when you create a new web project, be sure to select the correct version of the J2EE spec you wish to follow (default is 1.4)

    #274333 Reply

    biiasuo
    Member

    Today,I found that there were 2 kinds of breakpoints in jsp file.One is just a blue ball which appears in the margin of the left,
    the other is a blue ball with a right mark .Only when the “blue ball with a right mark” appears in the left margin,the program will stop at the breakpoint,the jsp file can be debuged.
    why?what is the differnece between the 2 kind of breakpoints?Thx

    #274395 Reply

    Loyal Water
    Member

    “blue ball” == breakpoint marker
    “blue ball with check box” == break point that is confirmed by the server as break-able.

    For example, if you set a breakpoint in a JSP page for an app server that cannot debug JSP pages, the break point will never get a check box.

    #274425 Reply

    biiasuo
    Member

    @support-nipun wrote:

    “blue ball” == breakpoint marker
    “blue ball with check box” == break point that is confirmed by the server as break-able.

    For example, if you set a breakpoint in a JSP page for an app server that cannot debug JSP pages, the break point will never get a check box.

    thanks for explaining it for me~my app server is weblogic all the time.
    Did you mean that not every line of jsp scriptlet could be debugged?

    #274498 Reply

    Loyal Water
    Member

    It depends on the app server. When a breakpoint is added, the debugger checks with the server in the background to see if that line can be broken on.

    #274536 Reply

    biiasuo
    Member

    @support-nipun wrote:

    It depends on the app server. When a breakpoint is added, the debugger checks with the server in the background to see if that line can be broken on.

    Thx nipun.
    To help me to debug a jsp file,you have given me a weblogic.xml for weblogic8.1 like this:

    
    <!DOCTYPE weblogic-web-app PUBLIC "-//BEA
     Systems, Inc.//DTD Web Application 7.0//EN"
     "http://www.bea.com/servers/wls700/dtd/weblogic700-web-jar.dtd">
     <weblogic-web-app>
        <description>WebLogic Descriptor</description>
        <jsp-descriptor>
           <jsp-param>
              <param-name>debug</param-name>
              <param-value>true</param-value>
           </jsp-param>
        </jsp-descriptor>
     </weblogic-web-app> 
    

    Could you show me another weblogic.xml file for weblogic9.2 like this?thx

    #274592 Reply

    Loyal Water
    Member

    Could you show me another weblogic.xml file for weblogic9.2 like this?

    You can add this to Weblogic 9 as well

    
    <weblogic-web-app> 
        <description>WebLogic Descriptor</description> 
        <jsp-descriptor> 
           <jsp-param> 
              <param-name>debug</param-name> 
              <param-value>true</param-value> 
           </jsp-param> 
        </jsp-descriptor> 
     </weblogic-web-app> 
    
Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: cannot hit my breakpoint in jsp scriptlets,when debuging.thx

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