I am trying to get Tomcat 4.0.6 to work with Idea 3.0 (build 676) to work using the Tomcat 4.0.6 integration shipped with the release (my machine is a Compaq laptop Evo N600c with 1 Gig
RAM and plenty of hard disk space to spare off a 20 Gig disk, the operating system is Windows 2000 Professional). For some reason, the debugger never stops at the break point that I
have set up. Here is how I have set-up and example project:
1. The Plugins folder under IDEA_HOME has the "tomcatintegration" folder, which, in turn, has "doc" and "lib" folders (I didn't do this the install program did this). The "docs" folder
has nothing in it whereas the "lib" folder contains the "tomcatIntegration.jar.". I guess that I am using the third method of Idea's Plugins documentation which states that any jar files
found in the lib folder will automatically be added to the classpath.
2. I set up a project call "apress" which is out of James Goodwill's "Apache Jakarta-Tomcat" book in chapter two. This a basic "web" app that displays a "login.jsp" and upon the user
typing in the username and passwords displays a welcome message in "welcome.jsp." The project is set up in the "apress" folder which is under the "webapps" folder. The "webapps"
folder exists under "Tomcat406" folder off the root. Therefore its complete path is "C:\Tomcat406\webapps\apress".
3. My idea is configured to use jdk 1.3.1_03 which is shipped with BEA's WebLogic version 7.0 (you can see where I am headed, ultimately, I would love to use IDEA 3.0 with BEA
WebLogic 7.0, right now, I will be satisfied with Tomcat and Idea). Weblogic 7.0 is installed in the BEA folder off the root drive "C:\" by default and the JDK lives in the jdk131_03 folder
off the BEA folder. Therefore its complete path is "C:\bea\jdk131_03". My project ".ipr" file, i.e. apress.ipr is stored in the \apress folder (complete path is
C:\Tomcat406\webapps\apress\apress.ipr"). The compiler output path is set to point to "C:\Tomcat406\webapps\WEB-INF\classes" this is where the project package is stored.
4. My project path is set to "C:\Tomcat406\webapps\apress"
5. My source path shows the two entries: C:\Tomcat406\webapps\apress\WEB-INF\classes and another entry as . I have not downloaded the source for the JDK therefore this
entry doesn't have anything in it (I plan on doing that later once I have this basic set-up working).
6. My classpath shows the entry "C:\Tomcat406\webapps\WEB-INF\classes" under the folder. The following JAR files under the JDK folder (automatically added when I chose
this JDK): C:\jdk131_03\jre\lib\i18n.jar, C:\jdk131_03\jre\lib\jaws.jar, C:\jdk131_03\jre\lib\rt.jar, C:\jdk131_03\jre\lib\sunrsasign.jar. I have added weblogic.jar with the path
C:\bea\weblogic700\server\lib\weblogic.jar (the reason that I had to add this is because all javax J2EE packages are found in the weblogic.jar file and since WebLogic is my primary server, I
like to stay with its JDK and JARs as much as possible).
7. I configured a web application in the folder "C:\Tomcat406\webapps\apress" with the name "apress" and with "Enable Web application support" check-box "checked."
8. Next, I selected "Project Properties" selection from the "File" menu and chose "Run/Debug" off it. Next I clicked on the "WebApp" tab. I have the following settings in the resulting
dialog box: I chose "apress" as the name. I chose "apress" in the Web Application drop-down that I had configured in step 7 above. Debuggee Host is "localhost" by default. Debuggee
port is 5050 by default. I have the "Launch server before debugger attaches" check-box checked. Catalina Home is set to "C:\Tomcat406" which automatically set "Path to Catalina
Configs" to "C:\Tomcat406\conf". Next I picked "/apress" from the "Application Context Path" drop-down. I should point out the I had edited the "server.xml" file in the folder
"C:\Tomcat406\conf" and added the following entry within the element with the name "localhost": ]]>. I
don't have anything in the VM parameters box. I have the "Include Project classpath" check-box checked. Finally, "Display settings before running/debugging" and "Make project before
running/debugging" check-boxes are both checked.
9. I opened the "login.java" servlet file open in my editor which extends HttpServlet class in the javax.servlet.http.* package. This servlet overrides the doPost method. With doPost,
there is a call to a private method getUser which takes username and password parameters and returns a string. I set the break-point by clicking on the editor bar to the left of this line.
This shows a small "Red" circle next to it with this line of source code (String user = getUser(username, password);) highlighted in a dull red color.
10. I launch my project by clicking the "Run" button (same as shift+F10). This dutifully shows the dialog box "Run - apress" with all my previous settings as described in the step 8
above. Clicking on the "Run" button launches the Tomcat server correctly which shows the following output in the "Run - apress" window:
C:\bea\jdk131_03\bin\javaw.exe -Djava.endorsed.dirs=C:\Tomcat406\bin;C:\Tomcat406\common\lib -Dcatalina.base=C:\Documents and
Settings\BRuparel\.IntelliJIdea\system\tomcat_apress_33dd9932 -Dcatalina.home=C:\Tomcat406 -Djava.io.tmpdir=C:\Tomcat406\temp -classpath
Starting service Tomcat-Standalone
Starting service Tomcat-Apache
11. Next, I start my browser and type in the following line in the Address box: http://localhost:8080/apress/login.jsp. This correctly brings up the login.jsp form. The form is called
"loginForm" with the attributes method="post" and action="servlet/chapter2.login". This form simply presents username and login text boxes and has a submit button. So far so good.
12. After filling in the user name and password text boxes, when I click on the submit button, the program merrily marches on to the welcome.jsp page! In other words, it does not break
any my break-point and simply runs through my doPost method. I know that it is executing the login.java servlet since I have added to "System.out.println()" calls before and after the line
where I have set the break point. This two comments show up the the message window correctly!
13 I know I am so close but yet not there!!!!!
Any help will be greatly appreciated.