Home » Language IDEs » ServerTools (WTP) » Developing Servlets with 1.0M1
Developing Servlets with 1.0M1 [message #55848] |
Sun, 12 December 2004 01:46  |
Eclipse User |
|
|
|
Hi all,
is there some kind of documentation on how to develop servlets with the
WTP? I was wondering if I can replace the old Tomcat plugin with the
WPT, but so far it is rather frustrating :-(
Here's what I did:
- added Tomcat 5.0 and 5.5 under Window->Preferences->Server->Installed
Runtimes
- created a new JEE->Web Project project
- created a little Servlet class in there
- failed to get any server offered in the Run dialog
- tried using New->Other..->Server->Server twice
- tried running my servlet on these
The latest results are:
- I have two server configurations (I assume that's what "Server" means)
somewhere, and I can't figure out how to delete them
- trying to run the servlet results in
java.lang.NoClassDefFoundError: org/apache/catalina/startup/Bootstrap
The configurations for Tomcat 5.0/5.5 point to the installation
directories.
Question I have now:
- how do I run a servlet from within Eclipse? is that supported at all?
do I need to set some extra classpath entries somewhere?
- how do I get rid of the extra server configurations?
- is this project stable enough to replace the Tomcat plugin? I'm
running a little Open Source project, nothing crucial.
Any help appreciated.
Thanks,
Peter
|
|
|
Re: Developing Servlets with 1.0M1 [message #55877 is a reply to message #55848] |
Mon, 13 December 2004 19:13   |
Eclipse User |
|
|
|
Originally posted by: niceguyj.wisdomteeth.comcast.net
Peter Becker wrote:
> Hi all,
>
> is there some kind of documentation on how to develop servlets with the
> WTP? I was wondering if I can replace the old Tomcat plugin with the
> WPT, but so far it is rather frustrating :-(
>
> Here's what I did:
> - added Tomcat 5.0 and 5.5 under Window->Preferences->Server->Installed
> Runtimes
> - created a new JEE->Web Project project
> - created a little Servlet class in there
> - failed to get any server offered in the Run dialog
> - tried using New->Other..->Server->Server twice
> - tried running my servlet on these
How did you try running them on these servers? I'm using WTP currently,
but I start the server and then view the web app in a separate browser
since I have not been able to get Mozilla Firefox to cooperate as a
'built-in' browser for Eclipse.
>
>
> The latest results are:
> - I have two server configurations (I assume that's what "Server" means)
> somewhere, and I can't figure out how to delete them
Try opening the Servers view and deleting them there. Also in the
installed runtimes, deselect them and then click remove. Select the
'Create server resources in workspace' option under 'Server' in the
preferences and you will get a 'Servers' folder in your workspace.
> - trying to run the servlet results in
> java.lang.NoClassDefFoundError: org/apache/catalina/startup/Bootstrap
> The configurations for Tomcat 5.0/5.5 point to the installation
> directories.
Hmmmm. Are the Tomcat libraries in the build path? If I look at my
project properties, under 'Java Build Path' Tomcat v5.0 Runtime is listed.
>
>
> Question I have now:
> - how do I run a servlet from within Eclipse? is that supported at all?
It should be. I did have some trouble with setting up a web app
specific Context but that seems to be OK after some manual tweaking of
the XML file for the app in $CATALINA_HOME/conf/Catalina/localhost. I
had zero luck when using the 'Add and remove projects' feature of the
Server view.
> do I need to set some extra classpath entries somewhere?
See above.
> - how do I get rid of the extra server configurations?
See above.
> - is this project stable enough to replace the Tomcat plugin? I'm
> running a little Open Source project, nothing crucial.
I'm currently using WTP along with the latest integration builds of
EMF-SDO, GEF, JEM, and XSD. This gives you syntax highlighting for XML,
JSP, CSS, etc along with other goodies. I am writing a small web app
with MySQL database access and Java Server Faces. I can set breakpoints
in Java code or JSPs, make changes to web content or Java source and
Tomcat updates itself accordingly.
Jim S.
|
|
|
Re: Developing Servlets with 1.0M1 [message #56013 is a reply to message #55877] |
Tue, 14 December 2004 20:42   |
Eclipse User |
|
|
|
Jim Sculley wrote:
> Peter Becker wrote:
>
>> Hi all,
>>
>> is there some kind of documentation on how to develop servlets with
>> the WTP? I was wondering if I can replace the old Tomcat plugin with
>> the WPT, but so far it is rather frustrating :-(
>>
>> Here's what I did:
>> - added Tomcat 5.0 and 5.5 under
>> Window->Preferences->Server->Installed Runtimes
>> - created a new JEE->Web Project project
>> - created a little Servlet class in there
>> - failed to get any server offered in the Run dialog
>> - tried using New->Other..->Server->Server twice
>> - tried running my servlet on these
>
>
> How did you try running them on these servers?
I tried Run->Run on Server... from the context menu of the project.
Trying to reproduce this (I don't have the old test case here) I can't
get beyond the "Did not find anything to deploy on server" message.
Trying a few different things, I figured out that I can deploy the
servlet from the "Server" view. I still had to start it from the Tomcat
manager app, though. I expected to get some deployment choice on the
"Run on server" option.
BTW: am I right to assume that there is a 1:1 mapping between project
name and servlet context name?
> I'm using WTP currently,
> but I start the server and then view the web app in a separate browser
> since I have not been able to get Mozilla Firefox to cooperate as a
> 'built-in' browser for Eclipse.
I didn't even think of trying that yet ;-) Since I'm looking at dynamic
SVGs I'll get another level of fun for that -- but that is a different
story.
>>
>> The latest results are:
>> - I have two server configurations (I assume that's what "Server"
>> means) somewhere, and I can't figure out how to delete them
>
>
> Try opening the Servers view and deleting them there.
I missed that view. I noticed the little hint in the property dialog
this time, but I'm not good noticing these things in general :(
> Also in the
> installed runtimes, deselect them and then click remove. Select the
> 'Create server resources in workspace' option under 'Server' in the
> preferences and you will get a 'Servers' folder in your workspace.
It seems to work with my old config now, but I'll remember that.
>> - trying to run the servlet results in
>> java.lang.NoClassDefFoundError: org/apache/catalina/startup/Bootstrap
>> The configurations for Tomcat 5.0/5.5 point to the installation
>> directories.
>
>
> Hmmmm. Are the Tomcat libraries in the build path? If I look at my
> project properties, under 'Java Build Path' Tomcat v5.0 Runtime is listed.
I couldn't reproduce my own problem, sorry :( But it works now, so
that's good :)
>>
>>
>> Question I have now:
>> - how do I run a servlet from within Eclipse? is that supported at all?
>
>
> It should be. I did have some trouble with setting up a web app
> specific Context but that seems to be OK after some manual tweaking of
> the XML file for the app in $CATALINA_HOME/conf/Catalina/localhost. I
> had zero luck when using the 'Add and remove projects' feature of the
> Server view.
I added the project from the server view, then changed the web.xml to
use the 2.3 DTD (the server couldn't find a 2.4 one) and then started
the servlet from the Tomcat manager. Seems to be all good now.
[...]
>> - is this project stable enough to replace the Tomcat plugin? I'm
>> running a little Open Source project, nothing crucial.
>
>
> I'm currently using WTP along with the latest integration builds of
> EMF-SDO, GEF, JEM, and XSD. This gives you syntax highlighting for XML,
> JSP, CSS, etc along with other goodies. I am writing a small web app
> with MySQL database access and Java Server Faces. I can set breakpoints
> in Java code or JSPs, make changes to web content or Java source and
> Tomcat updates itself accordingly.
The debugging worked fine with the Tomcat plugin, but I suppose the WTP
will become standard soon enough, that's why I'd like to use it for this
new project. Now that it is working it is seems to be all good, although
the lack of documentation is a concern -- I couldn't find any :( But I
think I'll still go for it, suspecting that WTP becomes stable and
documented before our developer count exceeds 2 :)
Thanks for the help,
Peter
|
|
|
Re: Developing Servlets with 1.0M1 [message #56170 is a reply to message #56013] |
Wed, 15 December 2004 20:32  |
Eclipse User |
|
|
|
Originally posted by: niceguyj.wisdomteeth.comcast.net
Peter Becker wrote:
> Jim Sculley wrote:
>
>> Peter Becker wrote:
>>
>>> Hi all,
>>>
>>> is there some kind of documentation on how to develop servlets with
>>> the WTP? I was wondering if I can replace the old Tomcat plugin with
>>> the WPT, but so far it is rather frustrating :-(
>>>
>>> Here's what I did:
>>> - added Tomcat 5.0 and 5.5 under
>>> Window->Preferences->Server->Installed Runtimes
>>> - created a new JEE->Web Project project
>>> - created a little Servlet class in there
>>> - failed to get any server offered in the Run dialog
>>> - tried using New->Other..->Server->Server twice
>>> - tried running my servlet on these
>>
>>
>>
>> How did you try running them on these servers?
>
>
> I tried Run->Run on Server... from the context menu of the project.
> Trying to reproduce this (I don't have the old test case here) I can't
> get beyond the "Did not find anything to deploy on server" message.
Yep. Sounds familiar.
>
> Trying a few different things, I figured out that I can deploy the
> servlet from the "Server" view. I still had to start it from the Tomcat
> manager app, though. I expected to get some deployment choice on the
> "Run on server" option.
Yes. That's how it is supposed to work. And I think it did work when
all the various parts were in the original 'ibm.zip' contribution. As
that stuff is absorbed into WTP more and more of the functionality is
returning.
>
> BTW: am I right to assume that there is a 1:1 mapping between project
> name and servlet context name?
>
I don't know. It may depend on the type of project. The Project stuff
seems to be a bit muddled right now. For instance, If I click 'New
Project' the list of potential project types includes an EJB category,
two J2EE categories, and a Web category. One of the J2EE categories
includes 'Web Project' type and the and the 'Web' category includes
'J2EE Web Project'.
>> I'm using WTP currently, but I start the server and then view the web
>> app in a separate browser since I have not been able to get Mozilla
>> Firefox to cooperate as a 'built-in' browser for Eclipse.
>
>
> I didn't even think of trying that yet ;-) Since I'm looking at dynamic
> SVGs I'll get another level of fun for that -- but that is a different
> story.
>
>>>
>>> The latest results are:
>>> - I have two server configurations (I assume that's what "Server"
>>> means) somewhere, and I can't figure out how to delete them
>>
>>
>>
>> Try opening the Servers view and deleting them there.
>
>
> I missed that view. I noticed the little hint in the property dialog
> this time, but I'm not good noticing these things in general :(
I can't figure out what the little check box next to a server in the
'Installed Runtimes' in meant to indicate.
>
>> Also in the installed runtimes, deselect them and then click remove.
>> Select the 'Create server resources in workspace' option under
>> 'Server' in the preferences and you will get a 'Servers' folder in
>> your workspace.
>
>
> It seems to work with my old config now, but I'll remember that.
>
>>> - trying to run the servlet results in
>>> java.lang.NoClassDefFoundError: org/apache/catalina/startup/Bootstrap
>>> The configurations for Tomcat 5.0/5.5 point to the installation
>>> directories.
>>
>>
>>
>> Hmmmm. Are the Tomcat libraries in the build path? If I look at my
>> project properties, under 'Java Build Path' Tomcat v5.0 Runtime is
>> listed.
>
>
> I couldn't reproduce my own problem, sorry :( But it works now, so
> that's good :)
I had some strange behavior at first as well. It typically occurred
when I tried to use the 'Add and remove projects' feature of the
'Servers' view.
>
>>>
>>>
>>> Question I have now:
>>> - how do I run a servlet from within Eclipse? is that supported at all?
>>
>>
>>
>> It should be. I did have some trouble with setting up a web app
>> specific Context but that seems to be OK after some manual tweaking of
>> the XML file for the app in $CATALINA_HOME/conf/Catalina/localhost. I
>> had zero luck when using the 'Add and remove projects' feature of the
>> Server view.
>
>
> I added the project from the server view, then changed the web.xml to
> use the 2.3 DTD (the server couldn't find a 2.4 one) and then started
> the servlet from the Tomcat manager. Seems to be all good now.
That's the process that works for me as well. Under certain
circumstances which I haven't identified, Eclipse will wipe out any
changes I've made to the context XML file in the
$CATALINA_HOME/conf/Catalina/localhost directory. It hasn't happened
for a couple of weeks now though.
>
> [...]
>
>>> - is this project stable enough to replace the Tomcat plugin? I'm
>>> running a little Open Source project, nothing crucial.
>>
>>
>>
>> I'm currently using WTP along with the latest integration builds of
>> EMF-SDO, GEF, JEM, and XSD. This gives you syntax highlighting for
>> XML, JSP, CSS, etc along with other goodies. I am writing a small web
>> app with MySQL database access and Java Server Faces. I can set
>> breakpoints in Java code or JSPs, make changes to web content or Java
>> source and Tomcat updates itself accordingly.
>
>
> The debugging worked fine with the Tomcat plugin, but I suppose the WTP
> will become standard soon enough, that's why I'd like to use it for this
> new project. Now that it is working it is seems to be all good, although
> the lack of documentation is a concern -- I couldn't find any :( But I
> think I'll still go for it, suspecting that WTP becomes stable and
> documented before our developer count exceeds 2 :)
Here's a link that shows how some of it is supposed to work:
http://www.u.arizona.edu/~rsk/ibm/
Jim S.
|
|
|
Goto Forum:
Current Time: Thu May 08 17:37:00 EDT 2025
Powered by FUDForum. Page generated in 0.04864 seconds
|