geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emily Yeh (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Deleted] (GEODE-3095) MethodArgumentTypeMismatchException for default values over HTTP
Date Fri, 16 Jun 2017 18:02:02 GMT

     [ https://issues.apache.org/jira/browse/GEODE-3095?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Emily Yeh updated GEODE-3095:
-----------------------------
    Comment: was deleted

(was: This error may be flaky / possibly hard to reproduce.)

> MethodArgumentTypeMismatchException for default values over HTTP
> ----------------------------------------------------------------
>
>                 Key: GEODE-3095
>                 URL: https://issues.apache.org/jira/browse/GEODE-3095
>             Project: Geode
>          Issue Type: Bug
>          Components: gfsh
>            Reporter: Emily Yeh
>
> When running {{GfshCommandsOverHttpSecurityTest.java}}, the following exception is getting
thrown in {{RestTemplate.doExecute:644}} (the actual error is in {{652: response = request.execute();}}).
The cause appears to be that some default values are getting expanded, which causes them to
be parsed incorrectly. In particular, the values {{90}} and {{99}} are becoming expanded to
Strings {{90.0}} and {{99.0}}, which causes problems when these Strings are parsed to Integers
(even though they were converted to floats earlier).
> {noformat}
> Processing unauthorized command: create disk-store --name=foo --dir=bar
> java.lang.RuntimeException: The HTTP request failed with: 500 - org.springframework.web.method.annotation.MethodArgumentTypeMismatchException:
Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested
exception is java.lang.NumberFormatException: For input string: "99.0"
>     at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:128)
>     at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:121)
>     at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:158)
>     at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:128)
>     at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)
>     at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
>     at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
>     at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
>     at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
>     at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
>     at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
>     at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
>     at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
>     at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
>     at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1689)
>     at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105)
>     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
>     at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
>     at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
>     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
>     at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
>     at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
>     at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
>     at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
>     at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
>     at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
>     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>     at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
>     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
>     at org.eclipse.jetty.server.Server.handle(Server.java:524)
>     at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
>     at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
>     at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
>     at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
>     at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
>     at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
>     at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
>     at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
>     at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
>     at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
>     at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.NumberFormatException: For input string: "99.0"
>     at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
>     at java.lang.Integer.parseInt(Integer.java:580)
>     at java.lang.Integer.valueOf(Integer.java:766)
>     at org.springframework.util.NumberUtils.parseNumber(NumberUtils.java:208)
>     at org.springframework.beans.propertyeditors.CustomNumberEditor.setAsText(CustomNumberEditor.java:113)
>     at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:468)
>     at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:441)
>     at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:199)
>     at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:108)
>     at org.springframework.beans.TypeConverterSupport.doConvert(TypeConverterSupport.java:64)
>     at org.springframework.beans.TypeConverterSupport.convertIfNecessary(TypeConverterSupport.java:47)
>     at org.springframework.validation.DataBinder.convertIfNecessary(DataBinder.java:713)
>     at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:120)
>     ... 42 more.
>     at org.apache.geode.management.internal.web.shell.AbstractHttpOperationInvoker$1.handleError(AbstractHttpOperationInvoker.java:248)
>     at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:700)
>     at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:653)
>     at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:628)
>     at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:549)
>     at org.apache.geode.management.internal.web.shell.AbstractHttpOperationInvoker.send(AbstractHttpOperationInvoker.java:621)
>     at org.apache.geode.management.internal.web.shell.RestHttpOperationInvoker.processCommand(RestHttpOperationInvoker.java:399)
>     at org.apache.geode.management.internal.cli.shell.GfshExecutionStrategy.executeOnRemote(GfshExecutionStrategy.java:225)
>     at org.apache.geode.management.internal.cli.shell.GfshExecutionStrategy.execute(GfshExecutionStrategy.java:101)
>     at org.springframework.shell.core.AbstractShell.executeCommand(AbstractShell.java:134)
>     at org.springframework.shell.core.AbstractShell.executeScriptLine(AbstractShell.java:74)
>     at org.apache.geode.management.internal.cli.shell.Gfsh.executeScriptLine(Gfsh.java:604)
>     at org.apache.geode.management.internal.cli.HeadlessGfsh.executeCommand(HeadlessGfsh.java:100)
>     at org.apache.geode.test.dunit.rules.GfshShellConnectionRule.executeCommand(GfshShellConnectionRule.java:202)
>     at org.apache.geode.management.internal.security.GfshCommandsSecurityTest.runCommandsPermittedAndForbiddenBy(GfshCommandsSecurityTest.java:163)
>     at org.apache.geode.management.internal.security.GfshCommandsSecurityTest.testDataManager(GfshCommandsSecurityTest.java:110)
>     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.apache.geode.test.junit.rules.DescribedExternalResource$1.evaluate(DescribedExternalResource.java:37)
>     at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>     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.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>     at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
>     at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>     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:68)
>     at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
>     at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
>     at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
> java.lang.RuntimeException: The HTTP request failed with: 500 - org.springframework.web.method.annotation.MethodArgumentTypeMismatchException:
Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested
exception is java.lang.NumberFormatException: For input string: "99.0"
>     at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:128)
>     at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:121)
>     at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:158)
>     at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:128)
>     at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)
>     at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
>     at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
>     at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
>     at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
>     at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
>     at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
>     at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
>     at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
>     at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
>     at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1689)
>     at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105)
>     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
>     at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
>     at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
>     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
>     at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
>     at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
>     at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
>     at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
>     at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
>     at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
>     at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>     at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
>     at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
>     at org.eclipse.jetty.server.Server.handle(Server.java:524)
>     at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
>     at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
>     at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
>     at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
>     at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
>     at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
>     at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
>     at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
>     at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
>     at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
>     at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.NumberFormatException: For input string: "99.0"
>     at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
>     at java.lang.Integer.parseInt(Integer.java:580)
>     at java.lang.Integer.valueOf(Integer.java:766)
>     at org.springframework.util.NumberUtils.parseNumber(NumberUtils.java:208)
>     at org.springframework.beans.propertyeditors.CustomNumberEditor.setAsText(CustomNumberEditor.java:113)
>     at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:468)
>     at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:441)
>     at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:199)
>     at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:108)
>     at org.springframework.beans.TypeConverterSupport.doConvert(TypeConverterSupport.java:64)
>     at org.springframework.beans.TypeConverterSupport.convertIfNecessary(TypeConverterSupport.java:47)
>     at org.springframework.validation.DataBinder.convertIfNecessary(DataBinder.java:713)
>     at org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:120)
>     ... 42 more.
>     at org.apache.geode.management.internal.web.shell.AbstractHttpOperationInvoker$1.handleError(AbstractHttpOperationInvoker.java:248)
>     at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:700)
>     at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:653)
>     at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:628)
>     at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:549)
>     at org.apache.geode.management.internal.web.shell.AbstractHttpOperationInvoker.send(AbstractHttpOperationInvoker.java:621)
>     at org.apache.geode.management.internal.web.shell.RestHttpOperationInvoker.processCommand(RestHttpOperationInvoker.java:399)
>     at org.apache.geode.management.internal.cli.shell.GfshExecutionStrategy.executeOnRemote(GfshExecutionStrategy.java:225)
>     at org.apache.geode.management.internal.cli.shell.GfshExecutionStrategy.execute(GfshExecutionStrategy.java:101)
>     at org.springframework.shell.core.AbstractShell.executeCommand(AbstractShell.java:134)
>     at org.springframework.shell.core.AbstractShell.executeScriptLine(AbstractShell.java:74)
>     at org.apache.geode.management.internal.cli.shell.Gfsh.executeScriptLine(Gfsh.java:604)
>     at org.apache.geode.management.internal.cli.HeadlessGfsh.executeCommand(HeadlessGfsh.java:100)
>     at org.apache.geode.test.dunit.rules.GfshShellConnectionRule.executeCommand(GfshShellConnectionRule.java:202)
>     at org.apache.geode.management.internal.security.GfshCommandsSecurityTest.runCommandsPermittedAndForbiddenBy(GfshCommandsSecurityTest.java:163)
>     at org.apache.geode.management.internal.security.GfshCommandsSecurityTest.testDataManager(GfshCommandsSecurityTest.java:110)
>     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.apache.geode.test.junit.rules.DescribedExternalResource$1.evaluate(DescribedExternalResource.java:37)
>     at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>     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.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>     at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
>     at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>     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:68)
>     at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
>     at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
>     at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
> Command result for <create disk-store --name=foo --dir=bar>: 
> Could not read command response.  Error occurred while executing "create disk-store --name=foo
--dir=bar" on manager. Please check manager logs for error.
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message