NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Netbeans 6.9 Maven Web App, can't debug

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
duncan



Joined: 02 Aug 2010
Posts: 2

PostPosted: Tue Aug 03, 2010 12:50 am    Post subject: Netbeans 6.9 Maven Web App, can't debug Reply with quote

Hi,

I'm using the default installation of Netbeans 6.9 (Build 201006101454), I've downloaded the "Java" package which includes, Glassfish, EE and all that other goodness.

The problem I am having is that when I create a new maven web application and I try to debug it, it simply wont let me. Now, I don't know if it's a bug in Netbeans or I am doing something wrong. So what I am hoping is that someone on here can confirm either one of those two assumptions.

Here's a step by step way of reproducing the problem.

New -> Project
Maven -> Maven Web Application

Accept defaults or enter an app name

Expand the newly created project and select
New -> Other
Web -> Servlet

Accept default classname or enter a name
use the same package structure you entered or left as default when creating the project
next

tick "Add information to deployment descriptor (web.xml)"
finish

expand Web Pages -> Web-INF
double click web.xml
click Servlets
enter 1 in the startup order

double click on the new servlet and paste this code in the file
Code:

@Override
public void init(ServletConfig config) throws ServletException {
    try{
        System.out.println("Hello Cruel World");
    }catch(Exception ex){
        ex.printStackTrace();
    }
}


Put a breakpoint on the System out.

Right click the project and select debug.
When it prompts you for a server, select glassfish v3

The breakpoint never gets executed. But the system out appears in the logs. So I know for a fact that the line is being executed, but it doesn't stop at the breakpoint.

Now, if I create a "normal" web application not a "maven web application" and follow the same steps, then I can debug everything as I would expect.

If I look at the log messages from the maven build output, then it looks like it's attempting to start the thing in debug mode.

<maven output snip>
NetBeans: Deploying on GlassFish Server 3
profile mode: false
debug mode: true
force redeploy: true
Starting GlassFish Server 3
</maven ouput snip>

<glassfish snip>
INFO: Perform lazy SSL initialization for the listener 'http-listener-2'
INFO: Created HTTP listener http-listener-2 on port 8181
INFO: Grizzly Framework 1.9.18-k started in: 16ms listening on port 8181
INFO: Hello Cruel World
INFO: Loading application com.mycompany_mavenproject4_war_1.0-SNAPSHOT at /mavenproject4
</glassfish snip>

EDIT : I should probably add that this is on Windows XP
Back to top
duncan



Joined: 02 Aug 2010
Posts: 2

PostPosted: Tue Aug 03, 2010 6:35 am    Post subject: Reply with quote

Update...

Kind of figured it out, you can't debug a project. You can only debug a file i.e. Ctrl + Shift + F5.

Must be an undocumented "feature" of maven.
Back to top
Jesse Glick
Posted via mailing list.





PostPosted: Wed Aug 04, 2010 10:20 am    Post subject: Netbeans 6.9 Maven Web App, can't debug Reply with quote

On 08/02/2010 08:51 PM, duncan wrote:
Quote:
when I create a new maven web application and I try to debug it, it simply wont let me. Now, I don't know if it's a bug in Netbeans or I am doing something wrong.

If a similar scenario works with an Ant-based project then I don't see any particular reason why it shouldn't work with a Maven-based project. Assume it is a bug and file
it please, with all the steps to reproduce you gave here. Product 'javaee', component 'maven'.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo