Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Servlet class files not included in exported war
Servlet class files not included in exported war [message #227679] Wed, 11 February 2009 15:25 Go to next message
Rich Scott is currently offline Rich Scott
Messages: 63
Registered: July 2009
Member
I have a dynamic web project that I have been running using an embedded
tomcat server. It is running well and I tried to export it to a war file
so that I could deploy it. The resulting war did not include any class
files. It contained jars for all dependent modules in the lib director,
the classes directory contained empty directories for each package that
contained classes. I am using Ganymede 3.4.1 with WST 3.0.3 added.

I created all of the servlets using "new->class" rather than
"new->other->web->servlet" so I tried adding a new servlet through that
mechanism. Its class file is included in the war. I could re-add all of
the servlets using the servlet path and I suspect that will take care of
those. However, there a supporting POJO classes in the project that are
required, which I think will still be left behind.

Is there a better/alternative way to get the servlet classes included?

What do I need to do to include the support classes in the jar?

Thanks for you help
Rich
Re: Servlet class files not included in exported war [message #227686 is a reply to message #227679] Wed, 11 February 2009 16:07 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 769
Registered: July 2009
Senior Member
It sounds like your POJO source files are not in the right location in the
web project. The default location is <project.dir>/src unless you changed
it at project creation or later in project properties.

Can you compare the location on disk of the original POJO source file with
the location of the source file created by the new source file wizard? It
doesn't matter which wizard you use to create a java source file, but the
location that the file is placed at does matter.

- Konstantin
Re: Servlet class files not included in exported war [message #227739 is a reply to message #227686] Thu, 12 February 2009 06:48 Go to previous messageGo to next message
Rich Scott is currently offline Rich Scott
Messages: 63
Registered: July 2009
Member
Konstantin,

Thanks for the reply. Unfortunately all of the java source files (POJOs,
servlets added as classes, and the test servlet added as a servlet) reside
in packages stored under <project.dir>/src. Also, based upon another post,
I checked .settign/org.eclipse.wst.common.component and it correctly
identifies src as a wb-resource as shown below.

<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>

Any other ideas?

Rich

Konstantin Komissarchik wrote:

> It sounds like your POJO source files are not in the right location in the
> web project. The default location is <project.dir>/src unless you changed
> it at project creation or later in project properties.

> Can you compare the location on disk of the original POJO source file with
> the location of the source file created by the new source file wizard? It
> doesn't matter which wizard you use to create a java source file, but the
> location that the file is placed at does matter.

> - Konstantin
Re: Servlet class files not included in exported war [message #227762 is a reply to message #227739] Thu, 12 February 2009 09:30 Go to previous message
Rich Scott is currently offline Rich Scott
Messages: 63
Registered: July 2009
Member
I went ahead and removed all of the servlets that were just added as
classes and then added new versions using "new->other->web->servlet". This
fixed the problem. Not only are the servlets all now being exported, the
POJOs that they reference are exported. It looks like some dependency
checking is occurring on export to WAR.

Thanks for your help.
Previous Topic:Webservice in eclispe RCP
Next Topic:hiding design and source tabs of xml of editor
Goto Forum:
  


Current Time: Tue May 21 05:05:08 EDT 2013

Powered by FUDForum. Page generated in 0.01935 seconds