jmeter 请求url文件失败

编者注

要编写unity请求文件,首先应当通过jmeter测试文件请求。但是创建了线程组,在线程组下面挂载HTTP请求和查看结果树,点击运行,一直显示错误。

服务端日志

Spring服务端仅仅回复说json转换出现问题,但是通过浏览器能够正常下载。

11:20:35,175 DEBUG DispatcherServlet:869 - DispatcherServlet with name 'Spring MVC Dispatcher Servlet' processing GET request for [/assets/2017-11-20/2017-11-20%2017-40-10-054_2017-11-20_05-40-09.unity]
11:20:35,196 DEBUG RequestMappingHandlerMapping:310 - Looking up handler method for path /assets/2017-11-20/2017-11-20 17-40-10-054_2017-11-20_05-40-09.unity
11:20:35,216 DEBUG RequestMappingHandlerMapping:317 - Returning handler method [public org.springframework.http.ResponseEntity org.aicfve.asset.AssetController.download(javax.servlet.http.HttpServletRequest)]
11:20:35,219 DEBUG DispatcherServlet:955 - Last-Modified value for [/assets/2017-11-20/2017-11-20%2017-40-10-054_2017-11-20_05-40-09.unity] is: -1

run logger... All OK

11:20:35,382 DEBUG ExceptionHandlerExceptionResolver:133 - Resolving exception from handler [public org.springframework.http.ResponseEntity org.aicfve.asset.AssetController.download(javax.servlet.http.HttpServletRequest)]: org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS); nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.springframework.core.io.InputStreamResource["inputStream"]->java.io.FileInputStream["fd"])
11:20:35,385 DEBUG ResponseStatusExceptionResolver:133 - Resolving exception from handler [public org.springframework.http.ResponseEntity org.aicfve.asset.AssetController.download(javax.servlet.http.HttpServletRequest)]: org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS); nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.springframework.core.io.InputStreamResource["inputStream"]->java.io.FileInputStream["fd"])
11:20:35,385 DEBUG DefaultHandlerExceptionResolver:133 - Resolving exception from handler [public org.springframework.http.ResponseEntity org.aicfve.asset.AssetController.download(javax.servlet.http.HttpServletRequest)]: org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS); nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.springframework.core.io.InputStreamResource["inputStream"]->java.io.FileInputStream["fd"])
11:20:35,386  WARN DefaultHandlerExceptionResolver:407 - Failed to write HTTP message: org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS); nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.springframework.core.io.InputStreamResource["inputStream"]->java.io.FileInputStream["fd"])
11:20:35,386 DEBUG DispatcherServlet:1048 - Null ModelAndView returned to DispatcherServlet with name 'Spring MVC Dispatcher Servlet': assuming HandlerAdapter completed request handling
11:20:35,387 DEBUG DispatcherServlet:1000 - Successfully completed request

响应数据

点击查看接过树的响应数据才发现真正的异常问题

org.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 18017; received: 9365
	at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:178)
	at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:135)
	at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:148)
	at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.readResponse(HTTPSamplerBase.java:1814)
	at org.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl.readResponse(HTTPAbstractImpl.java:440)
	at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:474)
	at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
	at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1189)
	at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1178)
	at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:498)
	at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:424)
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255)
	at java.lang.Thread.run(Unknown Source)

解决方法

点击HTTP请求,点击标签栏Advanced。在Client implementation下的Implementation选择Java

转载于:https://my.oschina.net/hava/blog/1576526

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值