Hi all,
I am using HFSJ and I would like to try the examples in the Eclipse
IDE, therefore I downloaded Eclipse
J2EE IDE from eclipse.org for my Linux OS. May be somebody also uses this IDE and can answer the following questions:
(1) Tomcat is installed correctly on my system and works. I can start it by running the start and stop scripts in the bin-directory.
I configured tomcat in Eclipse J2EE IDE, set up the path to the tomcat dir etc. I have to possibility to start and stop tomcat with the server-tab in Eclipse J2EE IDE. But this doesn't work properly. While running, I get the following output in the console:
Seems correctly, no error messages.
But when I call localhost:8080 in my browser, I usually get the tomcat start page. But this time, while invoking tomcat from Eclipse J2EE IDE, I get the following error:
HTTP Status 404 - /
type Status report
message /
description The requested resource (/) is not available.
Apache Tomcat/5.5.25
As I said before, if I start tomcat as usual via startscript, everything works correct.
Does anybody know about this problem in Eclipse J2EE?
(2) Another problem is about to get access to classes from the web.xml in Eclipse J2EE IDE.
I used to work with the listener-example from HFSJ and I already have a running version (while coding with VI) and I would like to get this example running in Eclipse J2EE IDE.
When you create a project in Eclipse J2EE IDE, you get a directory structure different from the examples of HFSJ, e.g. the src and classes directory are outside WEB-INF. That also means I have to do some changes in my web.xml file that the container can find my
servlet class files as well as the listener class.
The new structure looks like this:
ds@toshiba:~/programme/apache-tomcat-5.5.25/webapps/listenerTest_J2EE$ l build/classes/com/example/
insgesamt 12K
-rw-r--r-- 1 ds ds 447 2007-09-21 15:04 Dog.class
-rw-r--r-- 1 ds ds 1,6K 2007-09-21 15:49 ListenerTester.class
-rw-r--r-- 1 ds ds 1,2K 2007-09-21 15:04 MyServletContextListener.class
web.xml is located here:
ds@toshiba:~/programme/apache-tomcat-5.5.25/webapps/listenerTest_J2EE$ l WebContent/WEB-INF/
insgesamt 8,0K
drwxr-xr-x 2 ds ds 4,0K 2007-09-21 14:56 lib/
-rw-r--r-- 1 ds ds 652 2007-09-21 16:05 web.xml
The following content:
The package structure looks correct, but when I run localhost:8080/listenerTest_J2EE/ListenTest.do (in this case, I started tomcat manually), I get the following error:
HTTP Status 404 - /listenerTest_J2EE/ListenTest.do
type Status report
message /listenerTest_J2EE/ListenTest.do
description The requested resource (/listenerTest_J2EE/ListenTest.do) is not available.
Apache Tomcat/5.5.25
Seems like tomcat cannot find the classes. The problem I am currently working on is, to fix the path in the web.xml file to match the classes. But I couldn't figure out how to set the path to the classes in the web.xml to meet the requirements of Eclipse J2EE IDE.
Maybe someone has an idea to solve this problem. The complete directory structure looks like as follows:
ds@toshiba:~/programme/apache-tomcat-5.5.25/webapps/listenerTest_J2EE$ l
insgesamt 12K
drwxr-xr-x 3 ds ds 4,0K 2007-09-21 14:56 build/
drwxr-xr-x 3 ds ds 4,0K 2007-09-21 14:57 src/
drwxr-xr-x 4 ds ds 4,0K 2007-09-21 14:56 WebContent/
ds@toshiba:~/programme/apache-tomcat-5.5.25/webapps/listenerTest_J2EE$ l build/classes/com/example/
insgesamt 12K
-rw-r--r-- 1 ds ds 447 2007-09-21 15:04 Dog.class
-rw-r--r-- 1 ds ds 1,6K 2007-09-21 15:49 ListenerTester.class
-rw-r--r-- 1 ds ds 1,2K 2007-09-21 15:04 MyServletContextListener.class
ds@toshiba:~/programme/apache-tomcat-5.5.25/webapps/listenerTest_J2EE$ l src/com/example/
insgesamt 12K
-rw-r--r-- 1 ds ds 169 2007-09-21 14:58 Dog.java
-rw-r--r-- 1 ds ds 610 2007-09-21 15:49 ListenerTester.java
-rw-r--r-- 1 ds ds 425 2007-09-21 14:58 MyServletContextListener.java
ds@toshiba:~/programme/apache-tomcat-5.5.25/webapps/listenerTest_J2EE$ l WebContent/
insgesamt 8,0K
drwxr-xr-x 2 ds ds 4,0K 2007-09-21 14:56 META-INF/
drwxr-xr-x 3 ds ds 4,0K 2007-09-21 14:56 WEB-INF/
ds@toshiba:~/programme/apache-tomcat-5.5.25/webapps/listenerTest_J2EE$ l WebContent/WEB-INF/
insgesamt 8,0K
drwxr-xr-x 2 ds ds 4,0K 2007-09-21 14:56 lib/
-rw-r--r-- 1 ds ds 652 2007-09-21 16:05 web.xml
Thanks,
Patrick
[ September 25, 2007: Message edited by: Patrick Beck ]
[ September 25, 2007: Message edited by: Patrick Beck ]
[ September 25, 2007: Message edited by: Patrick Beck ]