Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 581FC9FDD for ; Wed, 30 Nov 2011 02:36:07 +0000 (UTC) Received: (qmail 17858 invoked by uid 500); 30 Nov 2011 02:36:06 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 17720 invoked by uid 500); 30 Nov 2011 02:36:06 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 16964 invoked by uid 99); 30 Nov 2011 02:36:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Nov 2011 02:36:05 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Nov 2011 02:36:02 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id C6B63A75E8 for ; Wed, 30 Nov 2011 02:35:41 +0000 (UTC) Date: Wed, 30 Nov 2011 02:35:41 +0000 (UTC) From: "Daniel Kulp (Resolved) (JIRA)" To: issues@cxf.apache.org Message-ID: <1346792049.24456.1322620541815.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <813287331.43072.1321619571824.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (CXF-3925) WebFaultOutInterceptor expects the Fault. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CXF-3925?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Kulp resolved CXF-3925. ------------------------------ Resolution: Fixed Fix Version/s: 2.5.1 2.4.5 2.3.8 =20 > WebFaultOutInterceptor expects the Fault. > ----------------------------------------- > > Key: CXF-3925 > URL: https://issues.apache.org/jira/browse/CXF-3925 > Project: CXF > Issue Type: Bug > Components: JAX-WS Runtime > Affects Versions: 2.4.4 > Reporter: Micha=C5=82 Mech > Assignee: Daniel Kulp > Fix For: 2.3.8, 2.4.5, 2.5.1 > > > WebFaultOutInterceptor reports NullPointerException when message content = doesn't contains Exception. > I was trying to create custom interceptor to transform SoapFault to SoapM= essage ([read more|http://stackoverflow.com/questions/8066474/how-to-transf= orm-soapfault-to-soapmessage-via-interceptor-in-cxf]) and when I registered= interceptor like: > {code:title=3DInternalActServiceFaultOutInterceptor.java|borderStyle=3Dso= lid} > public class InternalActServiceFaultOutInterceptor extends > =09=09AbstractSoapInterceptor { > =09public InternalActServiceFaultOutInterceptor() { > =09=09super(Phase.PRE_STREAM); > =09=09addBefore(Arrays.asList(StaxOutInterceptor.class.getName(), Attachm= entOutInterceptor.class.getName())); > =09} > =09@Override > =09public void handleMessage(SoapMessage soapMessage) throws Fault { > =09=09Exception exception =3D soapMessage.getContent(Exception.class); > =09=09if (exception !=3D null) { > =09=09=09soapMessage.getExchange().put(Exception.class, null); > =09=09=09for (Class contentFormat : soapMessage.getContentFormats()) { > =09=09=09=09soapMessage.setContent(contentFormat, null); > =09=09=09} > =09=09=09soapMessage.setContent(List.class, new MessageContentsList(creat= eSoapMessage(RegisterDocumentResponse.class))); > =09=09} > =09} > =09private RegisterDocumentResponse createSoapMessage(Class messag= eType) { > =09=09RegisterDocumentResponse response =3D new RegisterDocumentResponse(= ); > =09=09response.setStatus(ServiceStatusType.SUCCESS); > =09=09return response; > =09} > } > {code} > I saw: > {noformat} > WARN [http-8080-1][,,][PhaseInterceptorChain.doLog()] Interceptor for {h= ttp://...}InternalActServiceImplService#{http://...}registerDocument has th= rown exception, unwinding now > java.lang.NullPointerException > =09at org.apache.cxf.jaxws.interceptors.WebFaultOutInterceptor.handleMess= age(WebFaultOutInterceptor.java:83) > =09at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterce= ptorChain.java:263) > =09at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMe= ssage(AbstractFaultChainInitiatorObserver.java:105) > =09at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterce= ptorChain.java:323) > =09at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainIni= tiationObserver.java:121) > =09at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(Abstra= ctHTTPDestination.java:206) > =09at org.apache.cxf.transport.servlet.ServletController.invokeDestinatio= n(ServletController.java:218) > =09at org.apache.cxf.transport.servlet.ServletController.invoke(ServletCo= ntroller.java:200) > =09at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonS= pringServlet.java:114) > =09at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(= AbstractHTTPServlet.java:184) > =09at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(Abstrac= tHTTPServlet.java:107) > =09at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) > {noformat} > It's all because WebFaultOutInterceptor expecting in line 83 Fault in mes= sage. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira