Home » Newcomers » Newcomers » Can't get Eclipse and Tomcat working properly together(I'm trying to implement a HelloWorld servlet, and failing)
Can't get Eclipse and Tomcat working properly together [message #1036130] |
Mon, 08 April 2013 01:26 |
Chris Crawford Messages: 7 Registered: January 2012 |
Junior Member |
|
|
Here's the situation: Mac OS 10.7.5, 8 GB RAM, Eclipse Juno, Tomcat 7.
I'm a highly experienced beginner, in that I've been using Eclipse for 6 or 7 years now and still don't know more than 10% of the environment. I'm like a programmer's version of Grandma who has to be told where to click to get her browser to work. Yes, I can write Java code -- so long as we keep it simple. I'm really a designer who's managed to fake it as a programmer for 30+ years now. I've faked it with FORTRAN, BASIC, Forth, 6502, Pascal, C, C++, and now I'm faking it with Java on Eclipse.
The purpose of this long preamble is to warn you that as soon as you start talking about ANT or command-lines, I'm lost. Please, use short words, pat me on the head once in a while, and keep it simple.
I have decided that I need to learn to run my stuff over the web, so it's time to hoist up my pants and learn servlets. I managed to get the pieces together: Eclipse for J2EE, and Tomcat 7. Then I found a good HelloWorld example at a web page that this blog won't let me link to. I followed its handholding instructions to the letter, and the damn thing actually ran! But then it hit a problem that apparently hit many others who used it: Tomcat dumped a 404 error ("requested resource is not available") on me. I have gone through lots of gyrations to solve the problem, and none have worked.
One problem appears to be with this line of code in the HelloWorld example:
@WebServlet("/HelloWorldServlet/HelloWorld")
I tried lots of variations on that, to no avail.
On another forum, somebody informed me that there's an apparent flaw in Eclipse's organization of files in the WebContent/WEB-INF directory: what's in the build directory should be mirrored to there. In other words, I ended up with this: Webcontent/WEB-INF/classes/com/srccodes/example/HelloWorld.class. However, when I implemented his suggestion, the problem remained.
The only diagnostic I could get was this warning from Tomcat on the console:
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:HelloWorldServlet' did not find a matching property.
I can think of only one intelligent question to ask about this mess: is there any way I can get Tomcat to tell me exactly what 'requested resource' it is that Tomcat wants but is not available?
Thanks for any help. Be warned, though, that any answer you give is likely to get a response from me along the lines of "What's XXX mean?"
|
|
| | | | |
Goto Forum:
Current Time: Fri Apr 19 20:44:37 GMT 2024
Powered by FUDForum. Page generated in 0.08017 seconds
|