Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 9.0pe
    • Fix Version/s: 9.0pe
    • Component/s: web_services
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Linux

    • Issuezilla Id:
      424

      Description

      GlassFish builds #40, #41

      1.I specified a handlers.xml file (in WEB-INF directory in my web application) :
      <?xml version="1.0" encoding="UTF-8"?>
      <jws:handler-config xmlns:jws="http://java.sun.com/xml/ns/javaee">
      <jws:handler-chains>
      <jws:handler-chain>
      <jws:handler>
      <jws:handler-class>a.LoggingHandler</jws:handler-class>
      </jws:handler>
      </jws:handler-chain>
      </jws:handler-chains>
      </jws:handler-config>

      I created an implementation class that references this handler file :
      ------
      @WebService
      @HandlerChain(file="WEB-INF/handlers.xml")
      ...

      When I test the WS Operation, I get the error message in Server.log :
      Could not find handler chain file WEB-INF/handlers.xml for class a.A

      I used the Tester capability :
      http://localhost:8080/WebApplication9/AService?Tester

      1. exc.txt
        3 kB
        mkuchtiak
      2. exc.txt
        5 kB
        mkuchtiak
      3. WebApplication9.tar
        170 kB
        mkuchtiak

        Activity

        Hide
        mkuchtiak added a comment -

        Created an attachment (id=138)
        Web Application

        Show
        mkuchtiak added a comment - Created an attachment (id=138) Web Application
        Hide
        mkuchtiak added a comment -

        Created an attachment (id=139)
        Exception in Browser window (from Tester application)

        Show
        mkuchtiak added a comment - Created an attachment (id=139) Exception in Browser window (from Tester application)
        Hide
        mkuchtiak added a comment -

        Created an attachment (id=140)
        Exception in Server.log

        Show
        mkuchtiak added a comment - Created an attachment (id=140) Exception in Server.log
        Hide
        mkuchtiak added a comment -

        Increasing priority to P1 as the whole feature doesn't work.
        I tried to change the handlers.xml location (to the same package where is the
        implementation class) - this didn't help

        Show
        mkuchtiak added a comment - Increasing priority to P1 as the whole feature doesn't work. I tried to change the handlers.xml location (to the same package where is the implementation class) - this didn't help
        Hide
        vijaysr added a comment -

        changing owner

        Show
        vijaysr added a comment - changing owner
        Hide
        vijaysr added a comment -

        started

        Show
        vijaysr added a comment - started
        Hide
        vijaysr added a comment -

        The WAR file is a doc - please attach a proper WAR file

        Show
        vijaysr added a comment - The WAR file is a doc - please attach a proper WAR file
        Hide
        mkuchtiak added a comment -

        I don't understand.
        The war file is included in
        WebApplication9/dist directory.
        You'll get it when you unpack the .tar file.
        Should I send the zip file ?

        Show
        mkuchtiak added a comment - I don't understand. The war file is included in WebApplication9/dist directory. You'll get it when you unpack the .tar file. Should I send the zip file ?
        Hide
        vijaysr added a comment -

        I am reducing the priority since there is a workaround - the workaround is to
        package the handler file in the same package as the endpoint that uses the
        handler (refer to
        glassfish/appserv-tests/devtests/webservice/annotations/svchandler-3).

        Also note that the handler.xml file should not have the handler-config thing
        that you have

        Please use this workaround for now while resolve the problem when you package
        the file under WEB-INF

        Show
        vijaysr added a comment - I am reducing the priority since there is a workaround - the workaround is to package the handler file in the same package as the endpoint that uses the handler (refer to glassfish/appserv-tests/devtests/webservice/annotations/svchandler-3). Also note that the handler.xml file should not have the handler-config thing that you have Please use this workaround for now while resolve the problem when you package the file under WEB-INF
        Hide
        vijaysr added a comment -

        As per JSR109 :

        The handler chain file in the javax.jws.HandlerChain annotation is required to
        be packaged in the module. It must follow the requirements for location as
        specified in section 4.6.1 of JSR-181 specification (Web Services Metadata for
        the Java Platform). Additionally, the handler chain file can also be packaged
        and specified in the annotation such that, it is accessible as a resource from
        the ClassPath. At runtime, container providers must first try to access the
        handler chain file as per the locations specified in JSR-181 specification.
        Failing that, they must try to access it as a resource from the ClassPath. If
        more than one resources are returned from the ClassPath, then the first one is used.

        And section 4.6.1 of 181 says :

        Location of the handler chain file. The location supports 2 formats.
        1. An absolute java.net.URL in externalForm.
        (ex: http://myhandlers.foo.com/handlerfile1.xml)
        2. A relative path from the source file or class file.
        (ex: bar/handlerfile1.xml)

        since WEB-INF is not a loadable resource, handler.xml cannot be packaged under
        WEB-INF. Sorry for the confusion

        Show
        vijaysr added a comment - As per JSR109 : The handler chain file in the javax.jws.HandlerChain annotation is required to be packaged in the module. It must follow the requirements for location as specified in section 4.6.1 of JSR-181 specification (Web Services Metadata for the Java Platform). Additionally, the handler chain file can also be packaged and specified in the annotation such that, it is accessible as a resource from the ClassPath. At runtime, container providers must first try to access the handler chain file as per the locations specified in JSR-181 specification. Failing that, they must try to access it as a resource from the ClassPath. If more than one resources are returned from the ClassPath, then the first one is used. And section 4.6.1 of 181 says : Location of the handler chain file. The location supports 2 formats. 1. An absolute java.net.URL in externalForm. (ex: http://myhandlers.foo.com/handlerfile1.xml ) 2. A relative path from the source file or class file. (ex: bar/handlerfile1.xml) since WEB-INF is not a loadable resource, handler.xml cannot be packaged under WEB-INF. Sorry for the confusion
        Hide
        mkuchtiak added a comment -

        Sorry, I have to reopen this bug again. Tested in GlassFish build #41.

        Even when I move handlers.xml file to the same package where's the
        implementation class, I get no responses from handler.

        1. I moved handlers.xml to "a" package
        2. I changed the annotation to :
        @HandlerChain(file="handlers.xml")

        What only changed is that server is not complaining any more
        ("Could not find handler chain ...")

        Look at the LoggingHandler class. Is that something I miss ?

        Show
        mkuchtiak added a comment - Sorry, I have to reopen this bug again. Tested in GlassFish build #41. Even when I move handlers.xml file to the same package where's the implementation class, I get no responses from handler. 1. I moved handlers.xml to "a" package 2. I changed the annotation to : @HandlerChain(file="handlers.xml") What only changed is that server is not complaining any more ("Could not find handler chain ...") Look at the LoggingHandler class. Is that something I miss ?
        Hide
        vijaysr added a comment -

        fixed

        Show
        vijaysr added a comment - fixed
        Hide
        tomo_ikeda added a comment -

        Is this problem really resolved ?
        I am trying with 9.0pe_b43 but it still seemed to occur.
        It is true that container seemed to recognize @HandlerChain annotation and find
        the handler configuration file such as handlers.xml and find handler class, but
        still handler does not work.
        I get no responses from handler.
        Are there any samples which work well ?

        Show
        tomo_ikeda added a comment - Is this problem really resolved ? I am trying with 9.0pe_b43 but it still seemed to occur. It is true that container seemed to recognize @HandlerChain annotation and find the handler configuration file such as handlers.xml and find handler class, but still handler does not work. I get no responses from handler. Are there any samples which work well ?
        Hide
        vijaysr added a comment -

        The bug was : GlassFish was not recognizing namespace aware tags while
        processing the handler.xml files;

        This was fixed and a test case was also added mimicking this issue. As of now
        all handlers tests pass. Here are the references for you :

        Servlet Endpoints with handler :
        =================================

        glassfish\appserv-tests\devtests\webservice\annotations\svchandler-1
        glassfish\appserv-tests\devtests\webservice\annotations\svchandler-2
        glassfish\appserv-tests\devtests\webservice\annotations\svchandler-3
        glassfish\appserv-tests\devtests\webservice\annotations\svchandler-4 (this test
        case was written specifically for this issue 424)

        EJB endpoints with handlers :
        =============================
        glassfish\appserv-tests\devtests\webservice\ejb_annotations\svchandler

        Clients with handlers :
        ========================
        glassfish\appserv-tests\devtests\webservice\annotations\client-handler-1
        glassfish\appserv-tests\devtests\webservice\annotations\client-handler-2

        If these samples are not helpful, please reopen this issue and give us more info
        about your handler.xml file, your endpoint impl, descriptors (if any). Attching
        your WAR (if possible) will be really helpful

        Thanks

        Show
        vijaysr added a comment - The bug was : GlassFish was not recognizing namespace aware tags while processing the handler.xml files; This was fixed and a test case was also added mimicking this issue. As of now all handlers tests pass. Here are the references for you : Servlet Endpoints with handler : ================================= glassfish\appserv-tests\devtests\webservice\annotations\svchandler-1 glassfish\appserv-tests\devtests\webservice\annotations\svchandler-2 glassfish\appserv-tests\devtests\webservice\annotations\svchandler-3 glassfish\appserv-tests\devtests\webservice\annotations\svchandler-4 (this test case was written specifically for this issue 424) EJB endpoints with handlers : ============================= glassfish\appserv-tests\devtests\webservice\ejb_annotations\svchandler Clients with handlers : ======================== glassfish\appserv-tests\devtests\webservice\annotations\client-handler-1 glassfish\appserv-tests\devtests\webservice\annotations\client-handler-2 If these samples are not helpful, please reopen this issue and give us more info about your handler.xml file, your endpoint impl, descriptors (if any). Attching your WAR (if possible) will be really helpful Thanks
        Hide
        tomo_ikeda added a comment -

        Thank you and sorry.
        It is my mistake.
        It works well.

        Show
        tomo_ikeda added a comment - Thank you and sorry. It is my mistake. It works well.

          People

          • Assignee:
            vijaysr
            Reporter:
            mkuchtiak
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: