Idea 3.0 Tomcat Plug-in
1 posts in topic
Flat View  Flat View

Posted By:   Bharat_Ruparel
Posted On:   Wednesday, November 13, 2002 12:49 PM

Where in Idea 3.0 online documentation (or elsewhere) are the instructions for using Tomcat Plug-in?

Re: Idea 3.0 Tomcat Plug-in

Posted By:   Bharat_Ruparel  
Posted On:   Wednesday, November 20, 2002 01:42 PM

I have done more work and I am fairly close but not quite there. I have documented the steps that I followed to setup TomCat and Idea 3.0 plug-in and a sample project. Unfortunately the debugger doesn't quite work :(. My documentation is as follows. Any help is quite appreciated:


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 thee "webapps" folder. The "webapps" folder exists under "Tomcat406" folder off the root. Therefore its complete path is "C:Tomcat406webappsapress".

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:eajdk131_03". My project ".ipr" file, i.e. apress.ipr is stored in the apress folder (complete path is C:Tomcat406webappsapressapress.ipr"). The compiler output path is set to point to "C:Tomcat406webappsWEB-INFclasses" this is where the project package is stored.

4. My project path is set to "C:Tomcat406webappsapress".

5. My source path shows the two entries: C:Tomcat406webappsapressWEB-INFclasses 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:Tomcat406webappsWEB-INFclasses" under the folder. The following JAR files under the JDK folder (automatically added when I chose this JDK): C:jdk131_03jrelibi18n.jar, C:jdk131_03jrelibjaws.jar, C:jdk131_03jrelib
t.jar, C:jdk131_03jrelibsunrsasign.jar. I have added weblogic.jar with the path C:eaweblogic700serverlibweblogic.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:Tomcat406webappsapress" 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:Tomcat406conf". 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:Tomcat406conf" 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 "" 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:eajdk131_03injavaw.exe -Djava.endorsed.dirs=C:Tomcat406in;C:Tomcat406commonlib -Dcatalina.base=C:Documents and SettingsBRuparel.IntelliJIdeasystem omcat_apress_33dd9932 -Dcatalina.home=C:Tomcat406 emp -classpath C:eajdk131_03lib ools.jar;C:Tomcat406inootstrap.jar;C:Tomcat406commonlibactivation.jar;C:Tomcat406commonlibjdbc2_0-stdext.jar;C:Tomcat406commonlibjndi.jar;C:Tomcat406commonlibjta-spec1_0_1.jar;C:Tomcat406commonlibmail.jar;C:Tomcat406commonlib
aming-resources.jar;C:Tomcat406commonlibservlet.jar;C:Tomcat406commonlib ools.jar;C:Tomcat406commonlib yrex-;C:Tomcat406commonlibxerces.jar;C:Tomcat406serverlibcatalina.jar;C:Tomcat406serverlibcommons-logging.jar;C:Tomcat406serverlibjakarta-regexp-1.2.jar;C:Tomcat406serverlibservlets-common.jar;C:Tomcat406serverlibservlets-default.jar;C:Tomcat406serverlibservlets-invoker.jar;C:Tomcat406serverlibservlets-manager.jar;C:Tomcat406serverlibservlets-webdav.jar;C:Tomcat406serverlib omcat-ajp.jar;C:Tomcat406serverlib omcat-coyote.jar;C:Tomcat406serverlib omcat-http11.jar;C:Tomcat406serverlib omcat-util.jar;C:Tomcat406serverlibwarp.jar;C:Tomcat406webappsapressWEB-INFclasses;C:eajdk131_03jrelibi18n.jar;C:eajdk131_03jrelibjaws.jar;C:eajdk131_03jrelib
t.jar;C:eajdk131_03jrelibsunrsasign.jar;C:eaweblogic700serverlibweblogic.jar org.apache.catalina.startup.Bootstrap start

Starting service Tomcat-Standalone
Apache Tomcat/4.0.6
Starting service Tomcat-Apache
Apache Tomcat/4.0.6

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 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.

About | Sitemap | Contact