开发者社区> 问答> 正文

阿里云OpenAPI 这个问题怎么解决?

阿里云OpenAPI 这个问题怎么解决?okhttp包冲突
java
java.lang.NoClassDefFoundError: Could not initialize class okhttp3.OkHttpClient
at com.aliyun.tea.okhttp.OkHttpClientBuilder.(OkHttpClientBuilder.java:23) ~[tea-1.2.0.jar:na]
at com.aliyun.tea.okhttp.ClientHelper.creatClient(ClientHelper.java:30) ~[tea-1.2.0.jar:na]
at com.aliyun.tea.okhttp.ClientHelper.getOkHttpClient(ClientHelper.java:23) ~[tea-1.2.0.jar:na]
at com.aliyun.tea.Tea.doAction(Tea.java:64) ~[tea-1.2.0.jar:na]
at com.aliyun.tea.Tea.doAction(Tea.java:82) ~[tea-1.2.0.jar:na]
at com.aliyun.teaopenapi.Client.doRequest(Client.java:784) ~[tea-openapi-0.2.8.jar:na]
at com.aliyun.teaopenapi.Client.callApi(Client.java:1022) ~[tea-openapi-0.2.8.jar:na]
at com.aliyun.ocr_api20210707.Client.recognizeHandwritingWithOptions(Client.java:1219) ~[ocr_api20210707-1.1.16.jar:na]
at com.onewo.robin.voting.common.ocr.Sample.RecognizeHandwriting(Sample.java:48) ~[classes/:na]
at com.onewo.robin.voting.service.model.vote.impl.OfflineVoteServiceImpl.offlineVoteOcr(OfflineVoteServiceImpl.java:42) ~[classes/:na]
at com.onewo.robin.voting.wx.api.model.vote.controller.VoteController.voteDeliveryAgent(VoteController.java:85) ~[classes/:na]
at com.onewo.robin.voting.wx.api.model.vote.controller.VoteController$$FastClassBySpringCGLIB$$c98346b4.invoke() ~[classes/:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.3.20.jar:5.3.20]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793) ~[spring-aop-5.3.20.jar:5.3.20]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.20.jar:5.3.20]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.20.jar:5.3.20]
at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:123) ~[spring-context-5.3.20.jar:5.3.20]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.20.jar:5.3.20]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.20.jar:5.3.20]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97) ~[spring-aop-5.3.20.jar:5.3.20]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.20.jar:5.3.20]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763) ~[spring-aop-5.3.20.jar:5.3.20]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708) ~[spring-aop-5.3.20.jar:5.3.20]
at com.onewo.robin.voting.wx.api.model.vote.controller.VoteController$$EnhancerBySpringCGLIB$$ace9aee.voteDeliveryAgent() ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.20.jar:5.3.20]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.20.jar:5.3.20]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.20.jar:5.3.20]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.20.jar:5.3.20]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.20.jar:5.3.20]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.20.jar:5.3.20]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067) ~[spring-webmvc-5.3.20.jar:5.3.20]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) ~[spring-webmvc-5.3.20.jar:5.3.20]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.20.jar:5.3.20]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.3.20.jar:5.3.20]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:645) ~[javax.servlet-api-4.0.1.jar:4.0.1]
at org.springframewo

展开
收起
三分钟热度的鱼 2023-09-13 21:14:25 107 0
1 条回答
写回答
取消 提交回答
  • 我们okhttp是用的3.12.13。此回答整理自钉群“OpenAPI 开发者门户 - 值班服务群2群”

    2023-09-13 22:04:53
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
AutoTalk第七期:自动化工具-OpenAPI在线调试 立即下载
最大化阿里云OpenAPI能力的方法和实践 立即下载
低代码开发师(初级)实战教程 立即下载