Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EE6E9200C3A for ; Fri, 31 Mar 2017 11:16:46 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id ECEBC160B8C; Fri, 31 Mar 2017 09:16:46 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 38AD3160B80 for ; Fri, 31 Mar 2017 11:16:46 +0200 (CEST) Received: (qmail 26665 invoked by uid 500); 31 Mar 2017 09:16:45 -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 26654 invoked by uid 99); 31 Mar 2017 09:16:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Mar 2017 09:16:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id F0CEEC05E9 for ; Fri, 31 Mar 2017 09:16:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id g9sQzq8816w7 for ; Fri, 31 Mar 2017 09:16:43 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id C53CB5FAD1 for ; Fri, 31 Mar 2017 09:16:42 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 0F6E9E08BB for ; Fri, 31 Mar 2017 09:16:42 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id BE52D21DD9 for ; Fri, 31 Mar 2017 09:16:41 +0000 (UTC) Date: Fri, 31 Mar 2017 09:16:41 +0000 (UTC) From: "Neal Hu (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CXF-7307) empty query string injects into number type will lead 404 error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 31 Mar 2017 09:16:47 -0000 [ https://issues.apache.org/jira/browse/CXF-7307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15950576#comment-15950576 ] Neal Hu edited comment on CXF-7307 at 3/31/17 9:16 AM: ------------------------------------------------------- The behavior in RI is: Boxed number type with "" value will convert into null object, unboxed primitive type with "" value will convert into 0. I will try to fix this bug, please assign to me as the owner. [~sergey_beryozkin] Thanks was (Author: nbqyqx@163.com): The behavior in RI is: Boxed number type with "" value will convert into null object, unboxed primitive type with "" value will convert into 0. I will try to fix this bug, please assign to me as the owner. [~sergeyb] [~sergey_beryozkin] Thanks > empty query string injects into number type will lead 404 error > ---------------------------------------------------------------- > > Key: CXF-7307 > URL: https://issues.apache.org/jira/browse/CXF-7307 > Project: CXF > Issue Type: Bug > Components: Core, JAX-RS > Affects Versions: 3.1.7, 3.0.12 > Environment: xos jdk 1.8 > Reporter: Carl Zhu > Fix For: 3.0.13, 3.1.11, 3.2.0 > > > The http request: > GET /dubbott-demo-provider/v1.0/users/beanparam?a=&b= HTTP/1.1 > HOST: localhost:8080 > accept: application/json > content-type: application/json > The resource method returns null: > public String beanParam(@QueryParam("a") Integer a, @QueryParam("b") Integer b) { > return a+b; > } > javax.ws.rs.ClientErrorException: HTTP 404 Not Found > at org.apache.cxf.jaxrs.utils.SpecExceptions.toHttpException(SpecExceptions.java:117) > at org.apache.cxf.jaxrs.utils.ExceptionUtils.toHttpException(ExceptionUtils.java:169) > at org.apache.cxf.jaxrs.utils.InjectionUtils.handleParameter(InjectionUtils.java:472) > at org.apache.cxf.jaxrs.utils.InjectionUtilsTest.testInstantiateSimpleTypeInQuery(InjectionUtilsTest.java:154) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:498) > at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) > at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) > at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) > at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) > at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) > at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) > at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) > at org.junit.runners.ParentRunner.run(ParentRunner.java:363) > at org.junit.runner.JUnitCore.run(JUnitCore.java:137) > at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117) > at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42) > at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262) > at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84) > Caused by: java.lang.NumberFormatException: For input string: "" > at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) > at java.lang.Integer.parseInt(Integer.java:592) > at java.lang.Integer.(Integer.java:867) > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) > at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) > at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) > at java.lang.reflect.Constructor.newInstance(Constructor.java:423) > at org.apache.cxf.jaxrs.utils.InjectionUtils.handleParameter(InjectionUtils.java:461) > ... 23 more -- This message was sent by Atlassian JIRA (v6.3.15#6346)