<< Back to previous view

[GLASSFISH-424] Handlers don't work. Created: 16/Mar/06  Updated: 30/Nov/10  Resolved: 06/Apr/06

Status: Resolved
Project: glassfish
Component/s: web_services
Affects Version/s: 9.0pe
Fix Version/s: 9.0pe_dev

Type: Bug Priority: Blocker
Reporter: mkuchtiak Assignee: vijaysr
Resolution: Fixed Votes: 0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: All
Platform: Linux

File Attachments: Text File exc.txt     Text File exc.txt     Microsoft Word WebApplication9.tar    
Issuezilla Id: 424
Participants: mkuchtiak, tomo_ikeda and vijaysr


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">

I created an implementation class that references this handler file :

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 :

Comment by mkuchtiak [ 16/Mar/06 05:50 AM ]

Created an attachment (id=138)
Web Application

Comment by mkuchtiak [ 16/Mar/06 05:53 AM ]

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

Comment by mkuchtiak [ 16/Mar/06 05:54 AM ]

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

Comment by mkuchtiak [ 16/Mar/06 05:59 AM ]

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

Comment by vijaysr [ 16/Mar/06 08:13 AM ]

changing owner

Comment by vijaysr [ 16/Mar/06 08:15 AM ]


Comment by vijaysr [ 16/Mar/06 08:34 AM ]

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

Comment by mkuchtiak [ 16/Mar/06 09:01 AM ]

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 ?

Comment by vijaysr [ 16/Mar/06 02:52 PM ]

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

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

Comment by vijaysr [ 16/Mar/06 03:25 PM ]

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

Comment by mkuchtiak [ 17/Mar/06 01:45 AM ]

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 :

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 ?

Comment by vijaysr [ 18/Mar/06 09:19 AM ]


Comment by tomo_ikeda [ 06/Apr/06 09:05 AM ]

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 ?

Comment by vijaysr [ 06/Apr/06 10:47 AM ]

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-4 (this test
case was written specifically for this issue 424)

EJB endpoints with handlers :

Clients with handlers :

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


Comment by tomo_ikeda [ 06/Apr/06 06:45 PM ]

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

Generated at Mon Apr 21 11:37:23 UTC 2014 using JIRA 4.0.2#472.