java-sdk 异常java.lang.ClassNotFoundException: org.apache.http.ssl.TrustStrategy-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文
阿里云
为了无法计算的价值
打开APP
阿里云APP内打开

java-sdk 异常java.lang.ClassNotFoundException: org.apache.http.ssl.TrustStrategy

2016-01-13 17:44:11 35786 8

OSSClient client = new OSSClient(END_POINT, ACCESS_KEY_ID, ACCESS_KEY_SECRET);时抛异常:
java.lang.ClassNotFoundException: org.apache.http.ssl.TrustStrategy

    at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
    at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
    at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:429)
    at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:382)
    at com.aliyun.oss.OSSClient.<init>(OSSClient.java:246)
    at com.aliyun.oss.OSSClient.<init>(OSSClient.java:171)
    at com.ucredit.loan.platform.web.WelcomeController.welcome(WelcomeController.java:25)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:685)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:919)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:851)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1329)
    at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
    at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:445)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:559)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1038)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:374)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:972)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:363)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)
    at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:920)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:982)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:635)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:627)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:51)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    at java.lang.Thread.run(Thread.java:745)
取消 提交回答
全部回答(8)
  • 智扬
    2019-07-17 18:24:25

    这种一般是类没有找到,或者找到类但是版本不一样等造成的,我这里有很多脚本帮助定位和解决这些问题:

    https://www.jianshu.com/p/46a120f9e5a3

    里面有find-in-jargrep-in-jar jar-conflict-detect等命令,都是解决这类奇异问题的啥手级别的工具。

    0 0
  • 红黄蓝
    2019-07-17 18:24:25

    我的解决了,。确实是Jar的问题。我换了HTTPCORE、HTTPCLIENT 换成最新的。解决了。

    2 0
  • yaowj2
    2019-07-17 18:24:25

    2.3.0 确认httpclient 和core的版本和本地有没冲突

            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
             <version>4.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.4.1</version>
        </dependency>
    0 0
  • fanxl12
    2019-07-17 18:24:25

    这个是maven项目里httpclient版本太低的问题,升级到4.4就可以解决,

    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>4.4</version>
    </dependency>
    1 0
  • 马。云
    2019-07-17 18:24:25

    应该是jar包版本的问题,我替换成官方最新的jar包就解决了


    替换 httpcore jar包到高版本

    0 0
  • 穆轩
    2019-07-17 18:24:24

    估计是没有加载依赖包吧。是用maven构建的java工程么?

    0 0
  • jason丶
    2019-07-17 18:24:24

    参考下:help.aliyun.com/document_detail/oss/sdk/java-sdk/exception.html?spm=5176.product8314910_oss.6.232.CM5P1k

    0 2
滑动查看更多
相关问答

1

回答

【OSS】OSS Java SDK报Connection pool shut down错误,什么原因

2022-01-19 16:54:58 1948浏览量 回答数 1

0

回答

java.lang.RuntimeException: Unable to insta报错怎么办?

2021-10-25 18:43:55 270浏览量 回答数 0

0

回答

hive 报错 java.lang.RuntimeException: Unable to inst

2021-10-25 18:53:48 327浏览量 回答数 0

0

回答

视频通话报错java.lang.RuntimeException: Unable to instan

2021-10-25 18:48:26 267浏览量 回答数 0

1

回答

在Eclipse中哪里可以查看/下载java.util代码,例如AbstractMap类

2019-10-10 19:10:19 586浏览量 回答数 1

6

回答

Qt+MySQL和Html+CSS+Javascript+Apache+PHP+MySQL 哪种开发难度低一点?

2019-03-16 17:24:13 2833浏览量 回答数 6

1

回答

flink 类型转换,scala 继承map接口后,报java.lang.ClassCastException

2019-01-28 10:47:59 3857浏览量 回答数 1

1

回答

[@徐雷frank][¥20]java字符串的拼接

2018-11-23 17:08:18 2751浏览量 回答数 1

0

回答

阿里云OSS JavaScript SDK有没有非压缩版的呢?

2017-01-07 20:15:49 3398浏览量 回答数 0

1

回答

PHP CI框架开发向javascript传递参数问题

2016-03-17 11:07:03 2315浏览量 回答数 1
+关注
文章
问答
问答排行榜
最热
最新
相关电子书
更多
OpenCrypto Unchaining the Java
立即下载
Java Your(Next)
立即下载
Javascript中的对象
立即下载