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
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 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
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:
1) When you run Tomcat internal to Eclipse, you don't get the top-level start/welcome Tomcat page. You'll have to create an application.
2) You don't need to change the path in web.xml. It will be able to see your source directory just fine. I think you are jumping to conclusions about the error you are receiving. The error is a basic "something isn't right" message and you usually get more information about what went wrong by clicking the Console tab (which should be near the Servers tab).
I highly recommend not putting your application directories under the Tomcat directory folders. There's no need for it if you are running an IDE-internal instance of Tomcat and I think it will only make things more confusing.
It might be a good idea to make an index.html page (which you will put directly under WebContent) and test to see if you can get it working first.
maybe there are 2 instances of Tomcat running. go to control panel->Administrative tools->services->and look for apache tomcat. If its running stop it. and then start tomcat from within Eclipse. alternatively leave that instance running and don't start tomcat from within eclipse and see if it deploys correctly. [ September 26, 2007: Message edited by: Amitabha Batranab ]
Joined: Nov 07, 2006
Thank you for your answers Marc & Amitabha, it helped me and now it works fine.