glassfish
  1. glassfish
  2. GLASSFISH-1014

WS deployment problem with web.xml (version 2.4)

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 9.1pe
    • Fix Version/s: 9.1pe_dev
    • Component/s: deployment
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      1,014

      Description

      What is the "version" of your web.xml. I think it is 2.4. Because of
      this annotations are not processed and this is considered as a JAXRPC
      based service and hence this exception.

      Switch your web.xml to 2.5 based ones (example below) and try again.

      But this error is completely misleading. Please file a bug on 9.1 and
      attach this WAR that produced this error.

      Here is how a Servlet2.5 based web.xml looks like:

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:j2ee="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      version="2.5"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

      http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
      ..
      ..
      </web-app>

      Vijay

      On Wed, 2006-08-23 at 10:45, Oleksiy Stashok wrote:
      > > Hi,
      > >
      > > i have a problem when deploying WS to web container.
      > > If i create war file just with WS implementation class and no
      > > descriptors - it deploys fine.
      > > When i add webservices.xml description to the same war - it deploys fine.
      > > But once i add web.xml file to war file (even without any servlet
      > > definition) - get error on deployment phase(attached).
      > >
      > > Is there any restriction in 109 deployment on web.xml? I tried to find
      > > such there and didnt see anything about that.
      > >
      > > WBR,
      > > Alexey.

        Issue Links

          Activity

          Hide
          oleksiys added a comment -

          Yes, you're right its my fault.
          Its not because 2.4 version but because difference in headers.

          This one works (took it from Vijay):

          <web-app xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:j2ee="http://java.sun.com/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
          http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

          This one fails (original generated by GF):

          <web-app xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" metadata-complete="true"
          version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
          http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

          Show
          oleksiys added a comment - Yes, you're right its my fault. Its not because 2.4 version but because difference in headers. This one works (took it from Vijay): <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:j2ee="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd "> This one fails (original generated by GF): <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" metadata-complete="true" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd ">
          Hide
          vijaysr added a comment -

          This bug has two parts :

          1. Bad error message. I have fixed the bad error message problem in the
          webservices code.

          2. As the submitter has listed, one set of web.xml header does not result in
          annotation processing at all.

          Deployment team will have to take a look at this - transferring this back to the
          deployment category

          Show
          vijaysr added a comment - This bug has two parts : 1. Bad error message. I have fixed the bad error message problem in the webservices code. 2. As the submitter has listed, one set of web.xml header does not result in annotation processing at all. Deployment team will have to take a look at this - transferring this back to the deployment category
          Hide
          Hong Zhang added a comment -

          Please remove the metadata-complete=true in the schema declaration and try
          again. This attribute indicates all the information are in the deployment
          descriptors and no need to process annotations.

          I assume this version of web.xml is obtained from the generated/xml directory?
          The version in generated/xml is the processed version of web.xml where we
          already combine the information from (JavaEE) annotation with deployment
          descriptor. Therefore we set the attribute to true.

          When you put a web.xml in your archive and want to process annotations in your
          archive, you need to remove this attribute (the default value is false) or set
          it to false.

          <web-app xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
          http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

          Show
          Hong Zhang added a comment - Please remove the metadata-complete=true in the schema declaration and try again. This attribute indicates all the information are in the deployment descriptors and no need to process annotations. I assume this version of web.xml is obtained from the generated/xml directory? The version in generated/xml is the processed version of web.xml where we already combine the information from (JavaEE) annotation with deployment descriptor. Therefore we set the attribute to true. When you put a web.xml in your archive and want to process annotations in your archive, you need to remove this attribute (the default value is false) or set it to false. <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd ">
          Hide
          Hong Zhang added a comment -

          Alexey verified removing the attribute solved the problem.

          Show
          Hong Zhang added a comment - Alexey verified removing the attribute solved the problem.
          Hide
          vijaysr added a comment -

          Error message improved to pinpoint the probable causes

          Show
          vijaysr added a comment - Error message improved to pinpoint the probable causes

            People

            • Assignee:
              Hong Zhang
              Reporter:
              oleksiys
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: