Can you deploy servlets and web services from a .war?

S

ses

OK might be a stupid question but hopefully someone can help out:

Can you deploy both servlets and web services from a single .war or do
you have to package them up in an ear?

I ask because Glassfish is giving me a very unhelpful deployment
exception and this is the only thing I can think of that might be the
cause. Originally I was just deploying the web services from this war,
but I wanted a servlet in there as well.
 
A

Arne Vajhøj

OK might be a stupid question but hopefully someone can help out:

Can you deploy both servlets and web services from a single .war or do
you have to package them up in an ear?

A web service is a servlet.

And you can have both web service servlets and other servlets
in the same war file.

Arne
 
M

Mike Schilling

Arne Vajhøj said:
A web service is a servlet.

And you can have both web service servlets and other servlets
in the same war file.


All of which need to be specified in the same web.xml file, and mapped in a
way that all URLs are unambiguous as to which servlet (if any) they map to.
Could this be the problem?
 
S

ses

All of which need to be specified in the same web.xml file, and mapped in a
way that all URLs are unambiguous as to which servlet (if any) they map to.
Could this be the problem?

I am using annotation based mapping in the classes for the web service
implementations so only the servlet is mapped in web.xml, is that
correct?
 
S

ses

I am using annotation based mapping in the classes for the web service
implementations so only the servlet is mapped in web.xml, is that
correct?

I have solved this problem - I was trying to inject a reference to a
local web service and use the implementation class (not generated
class) to access the methods on it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top