[
https://issues.apache.org/jira/browse/GERONIMO-6104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13080377#comment-13080377
]
vu.nguyen edited comment on GERONIMO-6104 at 8/6/11 10:59 AM:
--------------------------------------------------------------
Ivan,
The problem doesn't relate to the structure of the handlers.xml file, but is
the system cannot find the location of the handlers.xml file. That cause the
NPE error and I fixed by my patch
FYI,
+ handlers.xml
{code:xml}
<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee">
<handler-chain>
<handler>
<handler-name>JAXWSHandler</handler-name>
<handler-class>examples.JAXWSHandler</handler-class>
</handler>
</handler-chain>
</handler-chains>
{code}
+ JAXWSHandler.java
{code:java}
public class JAXWSHandler implements SOAPHandler<SOAPMessageContext> {
public boolean handleMessage(SOAPMessageContext context) {
System.out.println("handleMessage()......");
return true;
}
public boolean handleFault(SOAPMessageContext context) {
System.out.println("handleFault()......");
return true;
}
public void close(MessageContext context) {
System.out.println("close()......");
}
public Set<QName> getHeaders() {
System.out.println("getHeaders()......");
return null;
}
}
{code}
+ ServerInfo.java
{code:java}
@WebService
@HandlerChain(file="handlers.xml")
public class ServerInfo{
@WebMethod
public String getServerName() {
return "abc";
}
}
{code}
was (Author: buomr):
Ivan,
The problem doesn't relate to the structure of the handlers.xml file, but is
the system cannot find the location of the handlers.xml file. That cause the
NPE error and I fixed by my patch
FYI,
+ handlers.xml
==========
<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee">
<handler-chain>
<handler>
<handler-name>JAXWSHandler</handler-name>
<handler-class>examples.JAXWSHandler</handler-class>
</handler>
</handler-chain>
</handler-chains>
=================================================================
+ JAXWSHandler.java
===========
public class JAXWSHandler implements SOAPHandler<SOAPMessageContext> {
public boolean handleMessage(SOAPMessageContext context) {
System.out.println("handleMessage()......");
return true;
}
public boolean handleFault(SOAPMessageContext context) {
System.out.println("handleFault()......");
return true;
}
public void close(MessageContext context) {
System.out.println("close()......");
}
public Set<QName> getHeaders() {
System.out.println("getHeaders()......");
return null;
}
}
=================================================================
+ ServerInfo.java
========
@WebService
@HandlerChain(file="handlers.xml")
public class ServerInfo{
@WebMethod
public String getServerName() {
return "abc";
}
}
=================================================================
> @HandlerChain
> -------------
>
> Key: GERONIMO-6104
> URL: https://issues.apache.org/jira/browse/GERONIMO-6104
> Project: Geronimo
> Issue Type: Bug
> Security Level: public(Regular issues)
> Components: webservices
> Affects Versions: 2.2.1
> Reporter: vu.nguyen
> Assignee: Ivan
> Labels: patch
> Attachments: patch.txt
>
>
> Got NPE when using the @HandlerChain annotation in WebService
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira