Eclipse Servlet Compilation problem [message #159120] |
Mon, 17 May 2004 13:26  |
Eclipse User |
|
|
|
Hi Folks,
I am new to eclipse and am having problems compiling a servlet.
These are the things I have done :
1) Installed eclipse3.0M8
2) Installed Tomcat 5.0.19
3) Installed SYSDEO Tomcat Plugin 2.2.1
4) Under Windows->Prefrences->Tomcat
Checked Version 5.x
Tomcat Home : C:\Applications\Tomcat 5.0
Tomcat base : C:\Applications\Tomcat 5.0
Configuration File : C:\Applications\Tomcat 5.0\conf\server.xml
5) I created a Tomcat project called Tom1. Eclipse created a WEB-INF
directory for me. It also created a lib and a src directory under it
but no classes directory.
6) Under Project->Properties->Java Build Path Libraries tab, specified
Tom1/WEB-INF/classes as default output folder.
Now I created a very simple helloworld servlet under WEB-INF/src and
created the web.xml having the servlet mappings under WEB-INF
directory.
At this point, I want to compile the servlet seperatey to test for
compiler errors. When I try to compile using Run->Run as->Java Application
I
get the error that editor does not contain a main type (which I assume
is due to not having a main method in my servlet class).
Build All and Build Project options under Project are disabled for me
(I havent figured out how to enable it)..
So am stuck at this point as my servlet cannot be compiled. Can anyone
give me a clue as to what needs to be done ?
Thanks,
Amit
|
|
|
Re: Eclipse Servlet Compilation problem [message #159655 is a reply to message #159120] |
Thu, 20 May 2004 10:21  |
Eclipse User |
|
|
|
You have one mistake and you are missing two important steps. The Tomcat
plug-in does not use the Run menu at all. Instead you need to update
your Server.xml file. You do this via right mouse click on the Tomcat
project and in the Tomcat menu select update server.xml.
You should see three Tomcat icons on your toolbar. If you see these
icons, skip the rest of this paragraph and move to the next one. Since
you do not see this icons, we need to configure the Tomcat plugin some
more. In the Window menu, select Customize Perspective. In the Shortcut
Categories panel, you should find Tomcat. It should unchecked. Check it.
This causes these buttons to appear on your toolbar.
The three buttons are start Tomcat, stop Tomcat and restart Tomcat. Only
the start and stop buttons work, IMHO. Once you have updated the
server.xml file, you can now start Tomcat. You should now see Tomcat
messages appear in the Console view of Eclipse as starts up. This view
should open on its own accord. After Tomcat starts up, you should be
able to view you web application at http://localhost:8080, if you have
not changed any of the default setting in Tomcat.
Why would this not work?
If you have problems, you might want to make sure that your browser is
not using a proxy server. This should not cause a problem, but some
does. If you are running firewall software such ZoneAlarm or Microsoft's
Windows XP Firewall the port 8080 may be block from being used. You need
to check your software firewall's setting to make sure this isn't the
case. These programs may also warn you that Java is trying to accept
traffic on a port. You'll need to provide Java with this ability.
Amit wrote:
> Hi Folks,
>
> I am new to eclipse and am having problems compiling a servlet.
>
> These are the things I have done :
> 1) Installed eclipse3.0M8
> 2) Installed Tomcat 5.0.19
> 3) Installed SYSDEO Tomcat Plugin 2.2.1
> 4) Under Windows->Prefrences->Tomcat
> Checked Version 5.x
> Tomcat Home : C:\Applications\Tomcat 5.0
> Tomcat base : C:\Applications\Tomcat 5.0
> Configuration File : C:\Applications\Tomcat 5.0\conf\server.xml
> 5) I created a Tomcat project called Tom1. Eclipse created a WEB-INF
> directory for me. It also created a lib and a src directory under it
> but no classes directory.
> 6) Under Project->Properties->Java Build Path Libraries tab, specified
> Tom1/WEB-INF/classes as default output folder.
>
> Now I created a very simple helloworld servlet under WEB-INF/src and
> created the web.xml having the servlet mappings under WEB-INF
> directory.
>
> At this point, I want to compile the servlet seperatey to test for
> compiler errors. When I try to compile using Run->Run as->Java Application
> I
> get the error that editor does not contain a main type (which I assume
> is due to not having a main method in my servlet class).
>
> Build All and Build Project options under Project are disabled for me
> (I havent figured out how to enable it)..
>
> So am stuck at this point as my servlet cannot be compiled. Can anyone
> give me a clue as to what needs to be done ?
>
> Thanks,
> Amit
>
|
|
|
Powered by
FUDForum. Page generated in 0.28631 seconds