免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6478 | 回复: 0
打印 上一主题 下一主题

[FastDFS] fastDFS java client +springmvc 文件上传问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-12-04 17:11 |只看该作者 |倒序浏览
搭建好fastDFS java client +springmvc +tomcat7.0进行文件上传时发现一些问题,希望能帮忙看看

开启6个浏览器同时进行文件上传操作,每个浏览器上传10M文件时客户端没有报错,当上传100M-200M时,有些文件上传成功了,但是部分报错了,测试了很多次,得到一些错误提示:

1.java.lang.OutOfMemoryError: Java heap space
        com.am.controller.StudentController.getInfo(StudentController.java:173)
        com.am.controller.StudentController.add(StudentController.java:59)
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        java.lang.reflect.Method.invoke(Method.java:597)
        org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:471)
        org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:40
        org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
        org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:4
        org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
        org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
        org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
        org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:8
        org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:83)

2.java.net.SocketException: Connection reset by peer: socket write error
        at java.net.SocketOutputStream.socketWrite0(Native Method)
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
        at org.csource.fastdfs.StorageClient$UploadBuff.send(StorageClient.java:59)
        at org.csource.fastdfs.StorageClient.do_upload_file(StorageClient.java:689)
        at org.csource.fastdfs.StorageClient.upload_file(StorageClient.java:200)
        at org.csource.fastdfs.StorageClient.upload_file(StorageClient.java:21
        at com.am.controller.StudentController.getInfo(StudentController.java:175)
        at com.am.controller.StudentController.add(StudentController.java:59)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:471)
        at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:40
        at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
        at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:4
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:20
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:8
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:83)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:20
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:40
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

3.java.io.IOException: recv package size -1 != 10
        at org.csource.fastdfs.ProtoCommon.recvHeader(ProtoCommon.java:206)
        at org.csource.fastdfs.ProtoCommon.recvPackage(ProtoCommon.java:242)
        at org.csource.fastdfs.TrackerClient.getStoreStorage(TrackerClient.java:143)
        at org.csource.fastdfs.StorageClient.newWritableStorageConnection(StorageClient.java:1912)
        at org.csource.fastdfs.StorageClient.do_upload_file(StorageClient.java:702)
        at org.csource.fastdfs.StorageClient.upload_file(StorageClient.java:207)
        at org.csource.fastdfs.StorageClient.upload_file(StorageClient.java:225)
        at org.csource.fastdfs.StorageClient1.upload_file1(StorageClient1.java:112)
        at com.imageserver.ImageServerImpl.send(ImageServerImpl.java:79)
        at com.imageserver.ImageServerImpl.uploadFile(ImageServerImpl.java:62)
        at com.imageserver.ImageServerImpl.uploadFile(ImageServerImpl.java:55)
        at test.LoopUploadTest$1.run(LoopUploadTest.java:53)

storaged.log和trackerd.log日志分别如下:

[2014-12-04 16:22:21] ERROR - file: storage_service.c, line: 8155, client ip: 192.168.7.95, unkown cmd: -4
[2014-12-04 16:22:21] WARNING - file: storage_nio.c, line: 416, send failed, connection disconnected.
[2014-12-04 16:29:39] ERROR - file: storage_nio.c, line: 314, client ip: 192.168.7.95, pkg length: -5774489843363613200 < 0


[2014-12-04 16:44:05] ERROR - file: tracker_nio.c, line: 214, client ip: 192.168.7.95, recv timeout, recv offset: 0, expect length: 0
[2014-12-04 16:51:44] ERROR - file: tracker_nio.c, line: 214, client ip: 192.168.7.95, recv timeout, recv offset: 0, expect length: 0


望解答,给点建议,谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP