0

I have a Java EE 5 application which consists of three web projects. I'm using JBoss 5.1 web server and NetBeans 7.2 IDE.

I have the following problems:

  1. I cannot start application in Debug mode. That I know of, there are two (best) approaches in NetBeans and Java: Remote debugging and debugging via shared memory. I read this post How to debug JBOSS application in netbeans? and I set debug parameters in Jboss configuration(I also know there are different parameter sets for shared memory and remote debugging), but when I go to attach debugger I got following errors:

    • If I use remote debugging I got error "Connection refused";

    • If I use shared memory I got error similar to this text "dt_shmem:file path could not be found".

These errors occur when I start JBoss by running run.bat file. If I start JBoss from Netbeans IDE, I can attach to remote process (still have problem with shared memory approach), but then I have other problems, regarding variable primitives and model binding in page life cycle (I will not write about that now).

How can I solve these problems so I can debug application? At least, how can I find a better error message when it fails. I could not find too much on the Net by looking for "Connection refused" error only.

  1. Why I cannot just press run main project(or web project) and that netbeans start application, open it in new browser tab(as localhost) and start debug mode? I'm coming from .net background and VS is offering this as out of the box tool (called ASP .NET development server). Why I have to use external web server and with every change deploy new application and then attach to it? Why Netbeans cannot by default use JVM for running application, and later when I deploy application I will choose which web server to use!?

I hope someone will make this clear to me :)

Thanks

added Note at 03.01.2013.

Well, when I changed VM options in project.properties file of web project (added run.args.extra=-J-Xms256m -J-Xmx756m), I succeeded to debug application and heat breakpoint when executing the code. However, I still have strange problem with Managed Bean properties. I have select list on page, and it is connected to Boolean property. When nothing is selected it should be set to null value by default (and it is when I start JBoss server by running run.bat file), but its value is by default set to false! I checked parameters post values in firebug and there is no problem in posting parameters to bean. It looks to me that problem is when JSF framework is trying to map post values to Managed Beans properties, but I cannot find out why this is happening. I also checked faces-config.xml, but did not find any specific rule for mapping to this specific property. Any tips?

Community
  • 1
  • 1
Minja
  • 1,222
  • 1
  • 19
  • 28
  • I work on eclipse IDE mostly but am familiar with Netbeans too. I right click the project before running, debugging, running unit tests, etc. You can do the same or from the server's window start jboss in debug mode and then add the project. Also, you don't need to restart the server if you;ve made changes to jsp or html files. You will still not need to manually restart the server as the server will detect context changes and restart automatically to publish the new changes. The java files or resource files like properties files or xml files will require a restart. – Mukus Dec 28 '12 at 17:07
  • Hmm, not working in my case. If I press debug on web project, it starts debug mode, but application fails very soon with the following message http://stackoverflow.com/questions/11682878/a-fatal-error-has-been-detected-by-the-java-runtime-environment-while-running-my If I start JBoss in debug mode from Netbeans I can attach to process, but then I have problem with Boolean data model binding, by default it map Boolean value to false, instead it should be Null. If I start JBoss by running run.bat then I cannot attach to process. – Minja Jan 03 '13 at 12:43

0 Answers0