[JBossWS] - Re: ClassCastException in HandlerResolverImpl.addHandler
by rishabh2u
I am getting this problem as well when implementing jaxws on jboss421 and 423.
As per the java spec the handler class should either implement the javax.xml.ws.handler.LogicalHandler OR javax.xml.ws.handler.SOAPHandler.
I have a handler class that does this.
|
| package handlertest.server;
|
| import java.util.Set;
|
| import javax.xml.namespace.QName;
| import javax.xml.ws.handler.MessageContext;
| import javax.xml.ws.handler.soap.SOAPHandler;
| import javax.xml.ws.handler.soap.SOAPMessageContext;
|
| public class ServerSOAPHandler implements SOAPHandler<SOAPMessageContext> {
| private final String HANDLERNAME = "ServerSOAPHandler";
|
| public ServerSOAPHandler() {
| super();
| System.out.println(HANDLERNAME + " ServerSOAPHandler():");
| }
|
| public Set<QName> getHeaders() {
| System.out.println(HANDLERNAME + " getHeaders():");
| return null;
| }
|
| public boolean handleFault(SOAPMessageContext arg0) {
| System.out.println(HANDLERNAME + " handleFault():");
| return false;
| }
|
| public boolean handleMessage(SOAPMessageContext arg0) {
| System.out.println(HANDLERNAME + " handleMessage():");
| return false;
| }
|
| public void close(MessageContext arg0) {
| System.out.println(HANDLERNAME + " close():");
| }
| }
|
I get the same exception when this handler is loaded. This is the stacktrace.
| java.lang.ClassCastException: handlertest.server.ServerSOAPHandler
| at org.jboss.ws.core.jaxws.handler.HandlerResolverImpl.addHandler(HandlerResolverImpl.java:148)
| at org.jboss.ws.core.jaxws.handler.HandlerResolverImpl.initHandlerChain(HandlerResolverImpl.java:134)
| at org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS.callRequestHandlerChain(HandlerDelegateJAXWS.java:80)
| at org.jboss.ws.core.server.AbstractServiceEndpointInvoker.callRequestHandlerChain(AbstractServiceEndpointInvok
| at org.jboss.ws.core.server.AbstractServiceEndpointInvoker.invoke(AbstractServiceEndpointInvoker.java:162)
| at org.jboss.ws.core.server.ServiceEndpoint.processRequest(ServiceEndpoint.java:212)
| at org.jboss.ws.core.server.ServiceEndpointManager.processRequest(ServiceEndpointManager.java:448)
| at org.jboss.ws.core.server.AbstractServiceEndpointServlet.doPost(AbstractServiceEndpointServlet.java:114)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
| at org.jboss.ws.core.server.AbstractServiceEndpointServlet.service(AbstractServiceEndpointServlet.java:75)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
|
The proposed solution of using Generic handler from Jboss works but this is not a proper solution. To be able to work with JAXws 2 spec I need to implement the javax.xml.ws.handler.LogicalHandler. Can you please suggest what can i do here ???
Also below are some links to jaxws 2 tutorials
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/co...
http://java.sun.com/mailers/techtips/enterprise/2006/TechTips_June06.html#1
http://blogs.sun.com/sdimilla/entry/implementing_handlers_using_jaxws_2
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4184718#4184718
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4184718
16 years, 4 months
[JBossWS] - Re: Full control of client and server certificates with a JB
by jeckles933
Trying to do the same thing. I can't understand what other people are doing to get around this problem. We have multiple keystores, so i have to override the default behavior for the SSLContext...
This is what i need to do, but i can't figure out how/when to call this to set the socket factory.
| KeyStore ts = KeyStore.getInstance("JKS");
| ts.load(new FileInputStream(trustStoreFullName), trustStorePassword.toCharArray());
| TrustManager[] tm;
| TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
| tmf.init(ts);
| tm = tmf.getTrustManagers();
|
| SSLContext sslContext = SSLContext.getInstance("SSL");
| sslContext.init(kmf.getKeyManagers(), tm, null);
|
| SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();
|
| HttpsURLConnection urlc = (HttpsURLConnection) url.openConnection();
| urlc.setSSLSocketFactory(sslSocketFactory);
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4184514#4184514
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4184514
16 years, 4 months