Return-Path: Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: (qmail 57511 invoked from network); 6 Feb 2011 14:17:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Feb 2011 14:17:57 -0000 Received: (qmail 39379 invoked by uid 500); 6 Feb 2011 14:17:57 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 39168 invoked by uid 500); 6 Feb 2011 14:17:53 -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 39142 invoked by uid 99); 6 Feb 2011 14:17:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Feb 2011 14:17:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_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; Sun, 06 Feb 2011 14:17: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 E4263192012 for ; Sun, 6 Feb 2011 14:17:30 +0000 (UTC) Date: Sun, 6 Feb 2011 14:17:30 +0000 (UTC) From: "Victor-Adrian Ichim (JIRA)" To: issues@cxf.apache.org Message-ID: <457997364.2658.1297001850931.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <27050179.216731296054979004.JavaMail.jira@thor> Subject: [jira] Commented: (CXF-3291) Unmarshalling null value for java.lang.Long generates an empty string exception MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-3291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12991154#comment-12991154 ] Victor-Adrian Ichim commented on CXF-3291: ------------------------------------------ Here is the SOAP message for my case. {code:xml} {code:xml} Please find attached also 2 Eclipse projects: 1. ApacheCXFTest - that deploys a simple JEE 6 application to JBoss 6 (jdk 1.6.0_23) using the ant script build.xml. Obs.: after the wsdl generation I insert the nillable=true for all elements (required by a .Net client in a real application) 2. WSClient - a java web service client for making the request. Thanks! > Unmarshalling null value for java.lang.Long generates an empty string exception > ------------------------------------------------------------------------------- > > Key: CXF-3291 > URL: https://issues.apache.org/jira/browse/CXF-3291 > Project: CXF > Issue Type: Wish > Components: JAXB Databinding > Affects Versions: 2.3.1 > Environment: Microsoft Windows 7 Enterprise, jdk1.6.0_23, JBoss 6.0 final which contains 2.3.1 version of CXF. > Intel Dual Core, 3GB RAM > Reporter: Victor-Adrian Ichim > Fix For: NeedMoreInfo > > Attachments: cxf3291_eclipse_projects.zip > > > java.lang.Long is not unmarshalled (while primitive long works) > Steps to reproduce: > 1. Create a RPC-LITERAL web service on a stateless session bean with a single method like this: > public ResultDTO compute(FilterDTO filter) > FilterDTO must contain a java.lang.Long id; property. > Annotated FilterDTO with @XmlAccessorType(XmlAccessType.FIELD) > 2. Generate the wsdl file with org.apache.cxf.tools.java2ws.JavaToWS > 3. Deploy the ear by including the wsdl file also (wsdlLocation is specified on the bean for @WebService) > 4. Start the server and use a client to call the method. Having RPC-LITERAL the parameter must be not null in the request. > So FilterDTO must be instantiated. Do not assign any value to the id field (let it null). > Result: > 16:40:36,317 INFO [STDOUT] DefaultValidationEventHandler: [ERROR]: For input string: "" > 16:40:36,317 INFO [STDOUT] Location: line 1 > 16:40:36,323 WARN [org.apache.cxf.phase.PhaseInterceptorChain] Interceptor for {http://ws.ro/}ServiceFacadeService#{http://ws.ro/}compute has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault: Unmarshalling Error: For input > string: "" > at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:787) [:2.3.1] > at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:628) [:2.3.1] > at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:133) [:2.3.1] > ........ > Caused by: javax.xml.bind.UnmarshalException > - with linked exception: > [javax.xml.bind.UnmarshalException: For input string: "" > - with linked exception: > [java.lang.NumberFormatException: For input string: ""]] > at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:425) [: > 2.2] > at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:362) [:2.2] > at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:339) [:2.2] > at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:764) [:2.3.1] > Caused by: javax.xml.bind.UnmarshalException: For input string: "" > - with linked exception: > [java.lang.NumberFormatException: For input string: ""] > ... 46 more > Caused by: java.lang.NumberFormatException: For input string: "" > at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) [:1.6.0_23] > at java.lang.Long.parseLong(Long.java:431) [:1.6.0_23] > at java.lang.Long.valueOf(Long.java:525) [:1.6.0_23] > at com.sun.xml.bind.DatatypeConverterImpl._parseLong(DatatypeConverterImpl.java:143) [:2.2] -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira