Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 90014

Summary: Can't run servlets on Tomcat 5.5 in latest integration build (I20050331)
Product: [WebTools] WTP Java EE Tools Reporter: Daniel R Somerfield <dsomerfi>
Component: jst.j2eeAssignee: John Lanuti <jlanuti>
Status: CLOSED FIXED QA Contact:
Severity: blocker    
Priority: P3 CC: deboer, gorkem.ercan, thatnitind
Version: unspecified   
Target Milestone: 1.0 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 90003    

Description Daniel R Somerfield CLA 2005-04-01 14:24:27 EST
1.) Create a new J2EE web module
2.) When prompted, create a new flexible Java project and tomcat server
3.) Finish creating the web module
4.) Create a new Servlet with the servlet wizard. Make sure to assign it to the
project and module you have just created.
5.) Right-click on the new servlet in package explorer and select "RunAs->Run on
Server"
6.) Choose the Tomcat 5.5 Server
7.) Click next and make sure the web module is selected
8.) Click finish.
The browser comes up with a 404. 
   Message: /myModule/servlet/myPackage.MyServlet
   Description: The requested resource (/myModule/servlet/myPackage.MyServlet)
is not available

9.)
If you then add the servlet to the web.xml:
<servlet>
	<servlet-name>MyServlet</servlet-name>
	<servlet-class>myPackage.MyServlet</servlet-class>
</servlet>
<servlet-mapping>
	<servlet-name>MyServlet</servlet-name>
	<url-pattern>/MyServlet</url-pattern>
</servlet-mapping>

10.) Again, try, "Run-as->Run on server" and choose the existing server you created.

Again, 404.

11. Try to hit the servlet via the url-pattern, with
http://localhost:8080/myModule/MyServlet.

Again, 404.
Comment 1 Chuck Bridgham CLA 2005-04-14 14:47:45 EDT
Brad can you verify this?  I beleive the current IB should solve this...
Comment 2 Brad Blancett CLA 2005-04-14 16:09:29 EDT
This is fixed in todays integration or head stream. Servlet Creation/Generic
server changes caused the problem. You might also take a look at 91294, you
might have to stop and start the server to get a replublish to occur.

Comment 3 Daniel R Somerfield CLA 2005-04-19 14:08:43 EDT
Still looks broken as of I20050419.

The only differences I see are:

1.) when creating a servlet, I get the following error in the console:

BUILD FAILED
C:\Documents and
Settings\dsomerfi\runtime-workspace\.metadata\.plugins\org.eclipse.jst.common.launcher.ant\tempAnt.xml:56:
taskdef class xdoclet.modules.web.WebDocletTask cannot be found

and 

2.) when running a servlet, I get the following error in the logs:

Executable extension definition for "class" not found.

Comment 4 Brad Blancett CLA 2005-04-19 16:00:21 EDT
Daniel, this looks more to be an xdoclet issue, regardless there has been server
plugin issues in the latest integration driver. We could only deploy once we
patached with the server plugins from head, I would wait until tonight's
integration and try again.

I leave this open until I can verify on a non patched build.
Comment 5 Brad Blancett CLA 2005-04-20 15:29:30 EDT
I am able to deploy a servlet on a Tomcat 3.2 server in the latest integration,
but can not deploy the same servlet on Tomcat 5.5. In 5.5 I cant even get the
sample servlets(ie snoop, helloworld) to load. 
Comment 6 Daniel R Somerfield CLA 2005-04-21 14:21:42 EDT
I see a problem, although slightly different with 3.2. You can do a right-click
run-on-server just fine, but if you try to add a servlet-mapping to your
web.xml, it isn't reflected. It appears that the web.xml is not getting
deployed. If you look in the .deployables directory, the web.xml is not replaced
with the one from the source tree.
Comment 7 Chuck Bridgham CLA 2005-04-22 14:46:56 EDT
Works on other versions - possible problem with module not being copied
Comment 8 Tim deBoer CLA 2005-04-23 14:04:38 EDT
Hi guys,

It worked for me. Tomcat 5.5.9 does not appear to have the samples installed by
default, but they worked fine once I configured them. And I could Run on Server
ok (I think the artifact gave the wrong Web module at first, but I'll check that
out and open another bug if I can reproduce) and run the servlet. What behaviour
were you seeing?
Comment 9 David Williams CLA 2005-04-24 14:35:48 EDT
attempting to set back to previous assigned owner after changing component
Comment 10 Brad Blancett CLA 2005-04-27 00:13:00 EDT
Hey Daniel, 

I verified on 5.57, please check the next integration build.



Comment 11 Daniel R Somerfield CLA 2005-07-05 13:08:06 EDT
Just saw this again on Tomcat 5.5.9 and I20050617.
Comment 12 Tim deBoer CLA 2005-07-12 09:15:44 EDT
Hi Daniel - Can you please post what the current problem is? Are the resources
correctly being copied into .deployables, or is it a problem with the server? If
it is the first case, then the J2EE team will need to look at this.
Comment 13 Daniel R Somerfield CLA 2005-07-12 12:25:59 EDT
No, on further examination, it looks like the problem only shows up when
generating a servlet with annotations enabled. I am not sure it is related, but
when I clean my project I often (although seemingly not always) get this:

BUILD FAILED
C:\Documents and
Settings\dsomerfi\runtime-workspace\.metadata\.plugins\org.eclipse.jst.j2ee.ejb.annotations.xdoclet\tempAnt.xml:56:
taskdef class xdoclet.modules.web.WebDocletTask cannot be found

It does seem to be correctly deploying the resources at this point. When I
manually add the servlet configuration to the web.xml, it will run at this point.

When the servlet config is not in there, it attempts to connect via the
*/servlet/* URL, and that fails, but I don't know if tomcat supports that out of
the box. The bigger problem seem to me to be the fact that you generate a
servlet with annotations and it won't run without messing with the web.xml. If
this is expected behavior, then I think it should be disabled by default because
it is confusing.
Comment 14 Tim deBoer CLA 2005-07-12 13:08:16 EDT
Verified that Tomcat v5.5 ships with the invoker servlet disabled (see
conf/web.xml), so it is working correctly.

This needs to go to the component for annotations, and probably Naci. I don't
know which component that is, so Chuck, please feel free to pass this one on if
I've got it wrong.
Comment 15 Naci Dai CLA 2005-07-12 14:21:24 EDT
I have tried this with the following configuration

I-Build I20050711, Tomcat 5.5.9, XDoclet 1.2.3, Dynamic Web Project.

Two Xdoclet Generated Servlets,  One manually created servlet added to web.xml
via merge, two seperate jsps, and htmls.

I have Clean build the project 11 times, and tried Run on server with each
artifact after each clean build.  It always worked. (Including XDoclet)

Either this bug is not valid anymore, or I need a very clear description to
chase it.

The problem associated with the message below indicate that the user did not
setup XDoclet.  The message does not fail a build, but will prevent entries for
a servlet from being added to web.xml.  Could be an issue with the ServletWizard
that it does not warn the user when XDoclet is not configured.  Maybe John
should have a look at it too.

"taskdef class xdoclet.modules.web.WebDocletTask cannot be found"
Comment 16 John Lanuti CLA 2005-07-12 17:10:10 EDT
I agree with Naci.  It works for me.  It looks like the xdoclet was not set up
properly and the servlet wizard allowed finish anyways.  I have added code to
the servlet wizard to disable annotations if there is not a valid annotations
provider or controller set up to prevent this situation from happening again.
Comment 17 Radim Burget CLA 2005-07-21 07:27:47 EDT
(In reply to comment #16)
> I agree with Naci.  It works for me.  It looks like the xdoclet was not set up
> properly and the servlet wizard allowed finish anyways.  I have added code to
> the servlet wizard to disable annotations if there is not a valid annotations
> provider or controller set up to prevent this situation from happening again.

Using: JDK 1.4.2, Tomcat 5.0, lomboz-eclipse-emf-gef-jem-I20050526.zip, XDoclet 2.3

and I heve the same problem.

BUILD FAILED
E:\eclipse\workspace\.metadata\.plugins\org.eclipse.jst.common.launcher.ant\tempAnt.xml:56:
taskdef class xdoclet.modules.web.WebDocletTask cannot be found

The same with JBOSS 4.0 (so I guess it has nothing to do with app server)

Could you please post us the configuration you are using and with it is working with
Comment 18 John Lanuti CLA 2005-07-21 11:10:09 EDT
You need to step up to the latest integration build for 0.7.  Grab all the
latest prereqs as well.
Comment 19 John Lanuti CLA 2006-06-29 14:13:17 EDT
OK