开发者社区> 问答> 正文

oss文件上传报错

我用官方的例子测试本地上传没问题 但是当我写在别的方法里调用就报出这个错了


public static OSSClient ossClient (){
           com.aliyun.oss.OSSClient client = new com.aliyun.oss.OSSClient(endpoint, accessKeyId, accessKeySecret);
           return   client;
}






严重: Servlet.service() for servlet action threw exception
java.lang.RuntimeException: java.lang.RuntimeException: CoreInvoker.process: exception throw by[cn.com.pubinfo.serv.manage.action.SevConfigAction.manage]
    at org.trundle.action.ExceptionInterceptor.doFilter(ExceptionInterceptor.java:73)
    at org.trundle.action.DefaultFilterChain.doFilter(DefaultFilterChain.java:33)
    at org.trundle.action.IngressInterceptor.doFilter(IngressInterceptor.java:81)
    at org.trundle.action.DefaultFilterChain.doFilter(DefaultFilterChain.java:33)
    at org.trundle.action.TrundleController.service(TrundleController.java:85)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at cn.com.pubinfo.module.filter.FrontAcFilter.doFilter(FrontAcFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.urp.urp.filter.AcFilter.doFilter(AcFilter.java:92)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at cn.com.pubinfo.module.filter.XssFilter.doFilter(XssFilter.java:46)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.trundle.encode.WebEncodeFilter.doFilter(WebEncodeFilter.java:38)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.trundle.filter.HibernateSessionFilter.doFilter(HibernateSessionFilter.java:44)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.RuntimeException: CoreInvoker.process: exception throw by[cn.com.pubinfo.serv.manage.action.SevConfigAction.manage]
    at org.trundle.action.CoreInvoker.process(CoreInvoker.java:84)
    at org.trundle.action.CoreInvoker.doFilter(CoreInvoker.java:45)
    at org.trundle.action.DefaultFilterChain.doFilter(DefaultFilterChain.java:33)
    at org.trundle.action.ExceptionInterceptor.doFilter(ExceptionInterceptor.java:33)
    ... 32 more
Caused by: java.lang.reflect.InvocationTargetException
    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.trundle.action.CoreInvoker.process(CoreInvoker.java:79)
    ... 35 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.http.impl.conn.ManagedHttpClientConnectionFactory
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager$InternalConnectionFactory.<init>(PoolingHttpClientConnectionManager.java:572)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:174)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:158)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:149)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:125)
    at com.aliyun.oss.common.comm.DefaultServiceClient.creatHttpClientConnectionManager(DefaultServiceClient.java:237)
    at com.aliyun.oss.common.comm.DefaultServiceClient.<init>(DefaultServiceClient.java:78)
    at com.aliyun.oss.OSSClient.<init>(OSSClient.java:268)
    at com.aliyun.oss.OSSClient.<init>(OSSClient.java:193)
    at cn.com.pubinfo.ekt.webservice.OssUploadTask.ossClient(OssUploadTask.java:100)
    at cn.com.pubinfo.ekt.webservice.OssUploadTask.upload(OssUploadTask.java:136)
    at cn.com.pubinfo.ekt.webservice.OssUploadTask.excute(OssUploadTask.java:69)
    at cn.com.pubinfo.serv.manage.develop.PubSevPool.excute(PubSevPool.java:95)
    at cn.com.pubinfo.serv.manage.action.SevConfigAction.manage(SevConfigAction.java:380)
    ... 40 more

展开
收起
1129269052aa 2016-04-15 16:56:10 6258 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
OSS运维进阶实战手册 立即下载
《OSS运维基础实战手册》 立即下载
OSS运维基础实战手册 立即下载