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.
Remote debugging doesn't work in Netbeans 3.4. This bug should be fixed with highest priority and released in a Q- Build, and 3.4.1 too. I had a discussion in the forum and alot of people were having problems with remote debugging as I was having. So I am explaining the steps that I am doing to help u reproduce the problem. My Environment ============== Windows 2000 JDK 1.4.1 Netbeans 3.4 Tomcat 4.1.2 installed on C drive Project Source Code on D drive 1)I compile my servlet class using ant (with debugging information turned on) 2) Then I deploy the .war file in the Tomcat 4.1.2 webapps folder. 3) I start Tomcat 4.1.2 in debug mode using the following string all in one line -Xdebug -Xnoagent - Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1 2999 4) The .war file then gets extracted automatically with appropiate web folder structure. Hello -> WEB-INF -> classes -> HelloWorld.class the web.xml file is located right under the WEB-INF folder 5) Now I attach the debugger using a socket Connector (dt_socket) with the following values Host: "sagi" (name of my computer) Port: "12999" 6) After attaching the debugger, my debugger Console displays the following message... Connecting to sagi:12999 Connection established and the "Finish" option under the Debug menu is enabled. So this proves that my debugger is attached properly. 6) In my java source file (HelloWorld.java) I have breakpoints on simple line which has the following code out.println("<font face = 'arial' size = '2'>Hello, what a nice World</font><br />"); Now when I call the Helloworld.class from my browser, the browser doesn't display anything, but the browser icon on the right hand corner keeps on spinning, making me feel that the debugger hit the breakpoint. But when I check Netbeans, I see something really wierd. I get this message on on my debugger console mentioning "Breakpoint reached at line ? in class HelloWorld by thread Thread-5." There should be an arrow right next to where I have set my breakpoint, but there is no arrow. The editor doesn't highlight the line that I have set the break point either. I have also checked that my breakpoints have their status set to "enabled" I get this message when I want to step over. "Source of class has not been found in mounted filesystems." My Project source code is in D drive (which contains the break points), and Tomcat is running on C drive. The generated .class file is in C drive in Tomcat 4.1.2 webapps folder. There is nothing wrong in my folder structure cause when I run the execute the servlet in normal mode, everything runs fine. Now I tried remote debugging this same servlet using IntelliJ IDEA, and Jbuilder using the the exact steps, and both of them worked fine. It seems that Netbeans has severe bug in Remote Debugging. Please fix this and make it available in Q-build and in Netbeans 3.4.1. I am having lots of difficulties cause I cannot perform remote debugging. Ana von Klopp suggested me to attach my ant file.. So here it is. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE project SYSTEM "antstructure.dtd" > <project name="HelloWorld Project" basedir="." default="buildApp"> <!-- ============== --> <!-- Global Properties --> <!-- ============== --> <!-- home.dir property --> <property name="home.dir" value="${basedir}"/> <!-- src.dir property --> <property name="src.dir" value="${home.dir}\src"/> <!-- build.dir property --> <property name="output.dir" value="${home.dir} \classes"/> <!-- lib.dir property --> <property name="lib.dir" value="${home.dir}\lib"/> <!-- build.dir property --> <property name="build.dir" value="${home.dir} \defaultroot"/> <!-- dist.dir property --> <property name="dist.dir" value="${home.dir}\dist"/> <!-- ======= --> <!-- init target --> <!-- ======= --> <target name="init" description=""> <!-- Display Ant version --> <echo><![CDATA[ ${TODAY}]]></echo> <echo><![CDATA[ Build tool: ${ant.version} ]] ></echo> <!-- Display Project Directory Information --> <echo><![CDATA[ Project Home directory: ${home.dir} ]]></echo> <echo><![CDATA[ Project Source directory: ${src.dir} ]]></echo> <echo><![CDATA[ Project Lib directory: ${lib.dir} ]]></echo> <!-- Create Timestamp --> <tstamp/> </target> <!-- =========== --> <!-- clean target --> <!-- =========== --> <target name="clean" description="delete all generated files"> <echo><![CDATA[ Delete all generated class files ]]></echo> <delete dir="${output.dir}"/> <echo><![CDATA[ Delete defaultroot directory ]] ></echo> <delete dir="${build.dir}"/> <echo><![CDATA[ Delete dist directory ]]></echo> <delete dir="${dist.dir}"/> </target> <!-- =========== --> <!-- prepare target --> <!-- =========== --> <target name="prepare" description="create output directory"> <mkdir dir="${output.dir}"/> </target> <!-- =========== --> <!-- compile target --> <!-- =========== --> <target name="compile" depends="init, prepare" description="compile all source file"> <javac srcdir="${src.dir}" destdir="${output.dir}" debug="on"> <classpath> <pathelement location="${lib.dir}/servlet.jar"/> </classpath> </javac> </target> <!-- ============ --> <!-- buildApp target --> <!-- ============ --> <target name="buildApp" depends="compile" description="build the Application"> <mkdir dir="${build.dir}" description="create application root directory"/> <mkdir dir="${build.dir}/WEB-INF" description="create WEB-INF directory "/> <mkdir dir="${build.dir}/WEB-INF/classes" description="create the WEB-INF/classes directory"/> <copy todir="${build.dir}/WEB-INF/classes" description="copy the application's class files to the WEB-INF/classes directory"> <fileset dir="${output.dir}" includes="**/*.class"/> </copy> <mkdir dir="${build.dir}/WEB-INF/src" description="create the WEB-INF/src directory"/> <copy todir="${build.dir}/WEB-INF/src" description="copy the application's source files to the WEB-INF/src directory"> <fileset dir="${src.dir}" includes="**/*.java"/> </copy> <mkdir dir="${build.dir}/WEB-INF/lib" description="create the WEB-INF/lib directory"/> <copy todir="${build.dir}/WEB-INF/lib" description="copy the application's jar files to the WEB-INF/lib directory"> <fileset dir="${lib.dir}" excludes="servlet.jar"/> </copy> </target> <!-- =========== --> <!-- DIST TARGET --> <!-- =========== --> <target name="dist" depends="buildApp" description="generate the archive for the distribution"> <mkdir dir="${dist.dir}"/> <war warfile="${dist.dir}/HelloWorld.war" basedir="${build.dir}" includes="**" webxml="${home.dir}/web.xml"/> </target> <target name="deploy" description="deploy"> <!-- Copy war to server here --> <copy file="${dist.dir}/HelloWorld.war" todir="C:\tomcat-4.1.x\webapps" /> </target> </project>
reassigned
"Breakpoint reached at line ?" can be caused by 2 things: - there is no debugger info code in the servlet - the servlet/java source with some peckage is badly mounted in the IDE
can you confirm that all these 2 things are OK?
The answer 2 of your questions - there is no debugger info code in the servlet Yes, of course there IS debugger info code in the servlet. - the servlet/java source with some peckage is badly mounted in the IDE The project for the source file is on D drive and is mounted as a filesystem properly. The filesystem contains a src directory which contains the source file. Please view the ant script and u will understand how the source file is compiled using ANT (with debug info turned on of course).
OK; it looks like problem with the mounting can you confirm that you see for example this in the IDE explorer: Explorer[FileSystems] -[]-C:\temp |-xxx |-yyy |-myJava.java and the package is xxx.yyy so the class identifier is xxx.yyy.myJava.java or do you see "src" folder in the mounted FS?
Created attachment 7871 [details] HelloWorld.zip contains a small test case to help u reproduce the bug on your machine
Okay.. I have attached a small zip file for u to help u reproduce the bug on your machine. Unzip HelloWorld.zip. Mount HelloWorld as a filesystem. You will see "build.xml" under the HelloWorld filesystem which is an Ant script Expand the build.xml so that u can see the targets Step 1: Execute the "buildApp" target. (This will create a folder called "defaultroot" under the HelloWorld filesystem and will contain all files and folders that will be nessary to be deployed to the servlet engine). Step 2: Execute the "dist" target. (This will create a folder called "dist" under the HelloWorld filesystem that will contain the .war file ) Step 3: Edit the "deploy" target and change the todir attribute to the path of the Tomcat's webapps folder on your machine. Step 4: Execute the "deploy" target. (This will deploy the .war file in tomcat's webapps folder. Then start Tomcat (I am using 4.1.2) in debug mode. Go to Tomcat's webapps folder and check for yourself whether the HelloWorld.war has been extracted to HelloWorld folder containing the proper web folder structure with the required files. Now go to Netbeans 3.4 and attach your debugger. Place breakpoints in the HelloWorld.java file which is in the src folder of the HelloWorld filesystem. Now call the servlet from your browser. http://<computer_name>:8080/HelloWorld/servlet/HelloWorld You will see the following message on your debugger console "Breakpoint reached at line ?" There should be an arrow right next to where u have set your breakpoint, but there isn't any. The editor doesn't highlight the line that u have set the break point either. This is the Bug. Note: If u execute the tomcat in normal mode, the servlet is displayed properly, so there is nothing wrong with the file structrue.
If you mount "hello world" as the file system then you have folder "src" and HelloWorld.java file. So you mounted HelloWorld.java with package "src" into the IDE. That is why the debugging does not work. So please add a package "src" into the HelloWorld.java source and recompile or mount the "src" folder into the IDE as a file system. BTW your working style is not recomended and supported in the IDE. Usual way is: - mount a FS - convert to web module - create a servlet in the web-inf/lib - execute the servlet
As more people are using ANT to build their web applications, it seems like this is an issue that is likely to come up frequently. We should create a FAQ entry, and perhaps add to the online docs as well. (Troubleshooting).
I am not sure there is some good solution/advice/FAQ to use ant source structure and Ant for building with the NB34. For NB34 I would recommend to do not use ant and the IDE together. New projects (NB40) will automatically fix problem with bad packages. And new projects will be compatible with the Ant source structure. What do yout think?
Well if using ANT and the Netbeans IDE together is not a good solution, then this information must published somewhere where users can be aware of this. Cause this is a vital problem that I am sure, that apart from me, many others are going through. We also had discussions on this in the forum where many users considered this to be a bug. Can you kindly confirm to me that the next version of Netbeans which is 4.0, will be compatible with Ant source structure?
I think it's way too strong to say that ANT does not work for web modules it Netbeans - it can be made to work but since it's not obvious how to do it, and it is not well supported, the onus is on us to explain it. This is an item for the FAQ as far as I am concerned. It clearly does work and by writing the ANT script and structuring the source in a certain way, developers can make it work quite well. For example, we can publish recommendations that the ANT script is set up to build an expanded WAR directory as well as the WAR file itself, and that developers mount the expanded WAR directory in the IDE and use that as the basis of execution. Also, we need to recommed that any Java sources directory is mounted as a file system in the IDE. Voila - full Netbeans functionality. Also, in my experience, it's never safe to assume that just because we are hoping to introduce a feature that may deal with some aspects of different source structuring, there is no guarantee that a specific case is covered. The reporter doesn't say that he or she uses a specific source structure such as the one recommended by Jakarta (which we are hoping to support) but that the source is built through an ANT script (which has been clearly stated will not be the basis of project support). So this is a separate problem.
Resolved for 3.4.x or earlier, no new info since then -> verify.
Resolved for 3.4.x or earlier, no new info since then -> closing.