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 2FDFE721C for ; Thu, 25 Aug 2011 23:20:55 +0000 (UTC) Received: (qmail 49977 invoked by uid 500); 25 Aug 2011 23:20:55 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 49949 invoked by uid 500); 25 Aug 2011 23:20:54 -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 49936 invoked by uid 99); 25 Aug 2011 23:20:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Aug 2011 23:20:54 +0000 X-ASF-Spam-Status: No, hits=-2000.9 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; Thu, 25 Aug 2011 23:20:50 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 456D4CF6EA for ; Thu, 25 Aug 2011 23:20:29 +0000 (UTC) Date: Thu, 25 Aug 2011 23:20:29 +0000 (UTC) From: "Esteban Salazar (JIRA)" To: issues@cxf.apache.org Message-ID: <333298180.15537.1314314429281.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1463558927.15530.1314314309471.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CXF-3763) CLONE - JaxWsDynamicClientFactory unable to handle custom exceptions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CXF-3763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13091408#comment-13091408 ] Esteban Salazar commented on CXF-3763: -------------------------------------- Although CXF-2555 is closed as fixed in 2.2.6, some users reported the issue was still happening in 2.2.8. I tried it in 2.4.2 and the issue is also still hapenning. The stack trace in 2.4.2 is almost the same: java.lang.NullPointerException at org.apache.cxf.interceptor.ClientFaultConverter.getConstructor(ClientFaultConverter.java:204) at org.apache.cxf.interceptor.ClientFaultConverter.processFaultDetail(ClientFaultConverter.java:176) at org.apache.cxf.interceptor.ClientFaultConverter.handleMessage(ClientFaultConverter.java:80) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:105) at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69) at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:771) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1600) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1485) at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1393) at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:640) at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263) at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:519) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:449) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:352) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:304) at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324) at test.CustomExceptionDynamicTestClientMain.main(CustomExceptionDynamicTestOASClientMain.java:31) The fix in Jira for CXF-2555 includes code (ExceptionCreator in TypeClassInitializer) to generate a JAXWS-type exception class which is mandatory to fix the error, but I have noticed this code is not being reached for the MessagePartInfo parts corresponding to the FaultInfo message. In the physical code generation phase, DynamicClientFactory generates the exception faultInfo bean class, but not the jaxws excepcion class (the one that extends java.lang.Exception). Later, before returning the generated Client, the TypeClassInitializer service model visitor is called and is expected to generate the missing exception classes when visiting the MessagePartInfo parts related to the FaultInfo message. In my test cases, the visitor's "begin" method always return before generating the class due to the condition {{if (!allowWrapperOperations && op.isUnwrappedCapable() && !op.isUnwrapped())}}. For this reason, when ClientFaultConverter asks for the exception class (which is supossed to be stored as a property of the FaultInfo message), it finds it null and generate the NPE. I modified the condition to {{if (!isFault && !allowWrapperOperations && op.isUnwrappedCapable() && !op.isUnwrapped())}} and my tests now work OK, but I'm afraid I'm maybe not taking into account all the wrapped/unwrapped variations. > CLONE - JaxWsDynamicClientFactory unable to handle custom exceptions > -------------------------------------------------------------------- > > Key: CXF-3763 > URL: https://issues.apache.org/jira/browse/CXF-3763 > Project: CXF > Issue Type: Bug > Components: JAX-WS Runtime > Environment: Windows OS with tomcat server > Reporter: Esteban Salazar > Assignee: Daniel Kulp > > When server throws a custom exception client is showing a NULLPointerException and returning a SoapFault with the error message thrown by the server. But the expected output should be the custom exception. > Below is the full stack trace. > Nov 21, 2009 11:25:01 AM org.apache.cxf.bus.spring.BusApplicationContext getConfigResources > INFO: No cxf.xml configuration file detected, relying on defaults. > Nov 21, 2009 11:25:03 AM org.apache.cxf.endpoint.dynamic.DynamicClientFactory outputDebug > INFO: Created classes: contactus.CxCSWebserviceExcpetion123, contactus.ObjectFactory, contactus.PostMessage, contactus.PostMessageResponse > Nov 21, 2009 11:25:05 AM org.apache.cxf.interceptor.ClientFaultConverter processFaultDetail > INFO: Exception occurred while creating exception: null > java.lang.NullPointerException > at org.apache.cxf.interceptor.ClientFaultConverter.getConstructor(ClientFaultConverter.java:182) > at org.apache.cxf.interceptor.ClientFaultConverter.processFaultDetail(ClientFaultConverter.java:154) > at org.apache.cxf.interceptor.ClientFaultConverter.handleMessage(ClientFaultConverter.java:74) > at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236) > at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:96) > at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69) > at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34) > at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236) > at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:658) > at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2139) > at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2022) > at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1947) > at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) > at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632) > at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) > at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:472) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:302) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:274) > at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:260) > at com.chordiant.cs.scheduler.client.CXFDynamicContactClient.main(CXFDynamicContactClient.java:23) > org.apache.cxf.binding.soap.SoapFault: Exception from postMessages > Here is the client Code. > try > { > JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(); > Client client = dcf.createClient("http://localhost:8080/contactUs/contactus?wsdl", Thread.currentThread().getContextClassLoader()); > client.invoke("postMessage", "test"); > } > catch(Exception e){ > System.out.println(e); > } > -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira