我用官方的例子测试本地上传没问题
,
但是当我写在别的方法里调用就报出这个错了
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
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。