This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
My setup includes current Linux Mint with JDK 1.6 and NB6.1rc1. I'm able to produce this problem as follows. I created an Enterprise application called "TestJ2EE" and then added JavaServer Faces framework to the TestJ2EE-war subproject. I then added a JSF managed bean called "TestBean" (using the JSF managed bean wizard). Inside this bean, I created an action method: public String processButton() { Logger.getLogger(TestBean.class.getName()).info("Made it to TestBean.processButton()"); return null; } I then added an h:form and h:commandButton to the welcomeJSF.jsp page that was created by NetBeans when I added the JSF framework. The body of welcomeJSF.jsp looks like this: <body> <f:view> <h1><h:outputText value="JavaServer Faces" /></h1> <h:form> <h:commandButton value="Press Me" action="#{TestBean.processButton}"/> </h:form> </f:view> </body> With this setup, I am getting very flaky breakpoint/debugger behavior. In order of what I have experienced: 1. I first deployed the application by selecting "Debug" from the TestJ2EE project's context menu, to deploy it to a running instance of Glassfish (which had previously been started in debug mode and which had another J2EE Enterprise application deployed at the time). When I then tried to set a breakpoint on either or both of the lines in the processButton() action method, I got the following in the Debugger Console: Not able to submit breakpoint LineBreakpoint TestBean.java : 21, reason: The breakpoint is set outside of any class. Invalid LineBreakpoint TestBean.java : 21 Just to make sure the application was working, I clicked the "Press Me" button and verified that the log message "Made it to TestBean.processButton()" was written to the log. I then tried various ways to re-deploy the app: I tried Undeploy/Redeploy from the context menu, tried "Debug" again, tried undeploying the application by selecting it from the Glassfish server node and selecting undeploy. None of these actions made any difference. I then undeployed both applications from the Glassfish instance by selecting "Undeploy" from the Glassfish Enterprise Applications context menu. I then shutdown Glassfish and restarted it in debug mode. I then deployed the test application again by selecting Debug from its context menu. This time when I tried to set a breakpoint on either of the two code lines in the processButton() method, the breakpoints showed up in the editor margin. However, when I clicked the "Press Me" button, the breakpoints were ignored. I then set a method breakpoint. When I clicked the "Press Me" button, execution stopped, at the "Logger.getLogger(TestBean.class.getName()).info("Made it to TestBean.processButton()");" line inside the method. Please see below the full TestBean.java JSF managed bean file, the welcomeJSF.jsp file, and the web.xml and faces-config.xml config files. TestBean.java: import java.util.logging.Logger; public class TestBean { public TestBean() { } public String processButton() { Logger.getLogger(TestBean.class.getName()).info("Made it to TestBean.processButton()"); return null; } } welcomeJSF.jsp: <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%> <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <f:view> <h1><h:outputText value="JavaServer Faces" /></h1> <h:form> <h:commandButton value="Press Me" action="#{TestBean.processButton}"/> </h:form> </f:view> </body> </html> faces-config.xml: <?xml version='1.0' encoding='UTF-8'?> <!-- =========== FULL CONFIGURATION FILE ================================== --> <faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"> <managed-bean> <managed-bean-name>TestBean</managed-bean-name> <managed-bean-class>TestBean</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean> </faces-config> web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <context-param> <param-name>com.sun.faces.verifyObjects</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>com.sun.faces.validateXml</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>client</param-value> </context-param> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping> <session-config> <session-timeout> 30 </session-timeout> </session-config> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>
I tried your scenario in NB 6.1 RC2 and: 1) I'm able to submit breakpoint anywhere, both bean and jsp, w/o any problem. 2) Breakpoints in jsp works, but in bean they don't.
After further examination, it seems its related to glassfish status, when it's in debug mode, sometimes breakpoint can't be set, but when it's stopped, or restared all is ok. About ignoring breakpoint, it seems there's some problem, because for Visual JSF Button debugging works fine.
I've reproduced the problem. It looks like debugger does not detect that the class was loaded and therefore does not try to submit the breakpoint. It needs further investigation to find out what's going on...
*** Issue 134458 has been marked as a duplicate of this issue. ***
Did a bit more testing on this last night, using my project..... breakpoint in JSP is fine breakpoint in Facade is fine breakpoint in a utility class is fine breakpoint in Backing Bean ignored The breakpoint I added in the Facade was in a method called by another in the same facade, and the parent method was the one being called from the Backing Bean line that I added the breakpoint to. When it's stopped at the Facade breakpoint, if I change back to the Backing Bean code, the line is marked with the gray triangle showing the origin. The project is an Enterprise app consisting of the 3 projects, the EJB project, and the WEB project, and the umbrella project (Backing beans and JSP in the WEB, Facade and utility class in the EJB). I did try looking at the sample projects, but I couldn't find a project of this structure. I tried the JSFJPA project with a breakpoint in UserManager.createUser, that works.
Created attachment 61429 [details] Contains the Enterprise project, the table, a text file of where the breakpoints are and the 3 log outputs including the breakpoint submissions
Another update!!! If you add a field breakpoint to your Backing Bean then use CTRL + F5 to start, the breakpoints are registered and execution stops in the Backing Bean. Also, if you start with CTRL + F5, then stop the deubgger, SHIFT + F5, then re-attach the debugger (Run menu) then line breakpoints work in your Backing Bean.
This bug seems to be fixed by fix of issue 134276 now. Closing as fixed.
Reporter, can you please try to verify the fix in the latest NB daily build? You can download the bits here http://bits.netbeans.org/dev/nightly/latest/ Thanks for your help.
v. in build 20080514055548
*** Issue 134547 has been marked as a duplicate of this issue. ***
*** Issue 136832 has been marked as a duplicate of this issue. ***