• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Hot Deploy and Debug EAR in Netbeans

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to figure out how to hot deploy and debug an application with Apache Netbeans 12. I have JBoss installed and I can set breakpoints and stop on them if I manually deploy my EAR to the JBoss deployment directory then attach the IDE to the running process. However with this method, I am unable to see into the variables (get message "Variable information is not available, source compiled without -g option. Value of "myVar" is not known."). I can only stop and step through the code. I'm using Maven to build if that makes a difference. I'd like to select the project I want to debug and have it deploy the EAR from the deployment project and run it on the configured JBoss instance.


My project layout is something like this:
App
 - common
 - utilities
 - service
   - proj1
   - proj2
 - deployment   <-- maven builds/packages the EAR here

So I can't figure out how to tie the jar built in say proj1 to the EAR built in deployment. If I try to debug proj1 it will attempt to deploy the proj1 jar to my JBoss instance which will fail because of the missing dependencies. In summary:
1. I can manually deploy my EAR and attach say proj1 to the running instance and stop/step through the program but not see the variables
2. I can select proj1 for debug and have it deploy the proj1 jar to the configured JBoss instance but it will fail because it's missing all of the dependencies from the other projects

Alternatively, I'd be happy deploying the EAR manually and attaching the debugger if I could see the contents of the variables.

Edit
---------
Building in Netbeans with these options
skipTests=true
maven.compiler.debuglevel=lines,source,vars



 
Marshal
Posts: 74042
332
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please avoid coloured text as much as possible; some people cannot read red text. I have changed it to bold black.
 
Marc Li
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The resolution was to add "-Dmaven.compiler.debug=true" to my Maven command string.

Once this is done, I manually deploy it to my local instance of JBoss then my Debugger to it (Debug -> Attach Debugger) and voila! I can see all variables.

What I didn't realize before was I was seeing variables but only the ones passed into a particular method, none of the local variables were showing. Adding that compiler option fixed me.

I realize this isn't technically a resolution to the problem, i.e. being able to build and hot deploy my EAR from within Netbeans but being able to debug/step into the code/watch variables will do.
 
reply
    Bookmark Topic Watch Topic
  • New Topic