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

Discussion in 'Java' started by ses, Oct 20, 2010.

  1. ses

    ses Guest

    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.
     
    ses, Oct 20, 2010
    #1
    1. Advertising

  2. ses

    Arne Vajhøj Guest

    On 20-10-2010 16:05, ses wrote:
    > 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
     
    Arne Vajhøj, Oct 21, 2010
    #2
    1. Advertising

  3. "Arne Vajhøj" <> wrote in message
    news:4cbfa20a$0$23760$...
    > On 20-10-2010 16:05, ses wrote:
    >> 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.



    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?
     
    Mike Schilling, Oct 21, 2010
    #3
  4. ses

    ses Guest

    > 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?
     
    ses, Oct 21, 2010
    #4
  5. ses

    ses Guest

    On 21 Oct, 13:02, ses <> wrote:
    > > 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?


    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.
     
    ses, Oct 21, 2010
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Richard
    Replies:
    0
    Views:
    538
    Richard
    Aug 4, 2003
  2. MARunner
    Replies:
    0
    Views:
    2,060
    MARunner
    Oct 21, 2003
  3. Martin
    Replies:
    6
    Views:
    17,979
    anupam.cmit
    Dec 11, 2010
  4. 6e
    Replies:
    0
    Views:
    338
  5. ses
    Replies:
    1
    Views:
    315
    Jan Thomä
    Oct 25, 2010
Loading...

Share This Page