调用rest返回ssl,username and password错误

问题描述

org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:535) at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:403) at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177) at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304)  at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611)  at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446)  at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)  at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)  at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)  at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)  at cn.youximao.huanxin.ClientSecretCredential.getToken(ClientSecretCredential.java:83)  at cn.youximao.huanxin.Token.applyAuthentication(Token.java:28)  at cn.youximao.huanxin.HTTPClientUtils.sendHTTPRequest(HTTPClientUtils.java:78)  at cn.youximao.huanxin.EasemobIMGroups.creatChatGroups(EasemobIMGroups.java:260)  at cn.youximao.service.group.impl.GroupInformationServiceImp.addGroupAndMember(GroupInformationServiceImp.java:1354)  at cn.youximao.service.group.impl.GroupInformationServiceImp.createGroup(GroupInformationServiceImp.java:146)  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.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)  at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)  at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)  at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)  at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)  at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)  at com.sun.proxy.$Proxy74.createGroup(Unknown Source)  at cn.youximao.site.controller.AppGroupApi.createDiscussionGroup(AppGroupApi.java:58)  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 cn.youximao.site.controller.AppEnterApi.appEnter(AppEnterApi.java:218)  at sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source)  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  at java.lang.reflect.Method.invoke(Method.java:606)  at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)  at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)  at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)  at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:777)  at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:706)  at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)  at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)  at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)  at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)  at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)  at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)  at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)  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:505)  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)  at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)  at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)  at java.lang.Thread.run(Thread.java:745)Caused by: java.security.ProviderException: java.security.KeyException  at sun.security.ec.ECKeyPairGenerator.generateKeyPair(ECKeyPairGenerator.java:146)  at java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:704)  at sun.security.ssl.ECDHCrypt.<init>(ECDHCrypt.java:78)  at sun.security.ssl.ClientHandshaker.serverKeyExchange(ClientHandshaker.java:717)  at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:278)  at sun.security.ssl.Handshaker.processLoop(Handshaker.java:913)  at sun.security.ssl.Handshaker.process_record(Handshaker.java:849)  at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1035)  at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1344)  at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1371)  ... 76 moreCaused by: java.security.KeyException  at sun.security.ec.ECKeyPairGenerator.generateECKeyPair(Native Method)  at sun.security.ec.ECKeyPairGenerator.generateKeyPair(ECKeyPairGenerator.java:126)  ... 85 morejava.lang.RuntimeException: java.lang.RuntimeException: Some errors occurred while fetching a token by username and password .java.security.ProviderException: java.security.KeyException  at cn.youximao.huanxin.HTTPClientUtils.sendHTTPRequest(HTTPClientUtils.java:126)  ------------------------------------------------------------------------------------------------------------------------------------------------------这个是jdk低版本的一个bug,可以尝试两种方法解决,1、升级jdk版本到java8,另一种是升级nss版本到3.19以上。

时间: 2025-01-26 21:44:37

调用rest返回ssl,username and password错误的相关文章

排除JQuery通过HttpGet调用WebService返回Json时“parserror”错误_实用技巧

JQuery大家都经常用,以前用的时候没有注意什么.最近本人在使用JQuery通过HttpGet方式调用WebService时,却发现服务端并非如人所愿返回json数据,而是返回错误提示:parserror. 如今问题被顺利解决,下面是解决过程 首先看客户端使用JQuery调用WebService的代码: 复制代码 代码如下: getHellobyAjax: function(callabckFun) { $.ajax({ type: "GET", url: "WebServ

JQuery通过HttpGet调用WebService返回Json时“parserror”错误

首先看客户端使用JQuery调用WebService的代码:    代码如下 复制代码           getHellobyAjax: function(callabckFun) {             $.ajax({                 type: "GET",                 url: "WebService.asmx/HelloWorld",                 //contentType: "app

PHP调用存储过程返回值不一致问题的解决方法分析_php技巧

本文实例讲述了PHP调用存储过程返回值不一致问题的解决方法.分享给大家供大家参考,具体如下: 今天遇一个同学聊存储过程返回值经常得到意外的值为null, 因为白天有事,晚上给做一个实验放在这里供有相应问题的同学查看一下. 存储过程: delimiter// createprocedureusp_s2(outpar1int) begin selectinet_ntoa(ip),portfromproxy_listlimit5; selectcount(*)intopar1fromproxy_lis

php调用存储过程返回结果集

php调用存储过程返回结果集,解决can't return a result set in the given context错误的方法需要php调用存储过程,返回一个结果集,发现很困难,找了半天,终于在老外的论坛上找到解决方案,这里本地化一下. 关键就是两点 1)define('CLIENT_MULTI_RESULTS', 131072); 2)$link = mysql_connect("127.0.0.1", "root", "",1,CL

mybatis-Mybatis调用存储过程返回多个结果集

问题描述 Mybatis调用存储过程返回多个结果集 存储过程返回两个结果集(游标). CREATE?OR?REPLACE?FUNCTION?t_user_func(id?varchar(20)) ??RETURNS?SETOF?refcursor?AS $BODY$ Declare code?refcursor; result?refcursor; BEGIN????? ??--返回错误码 ??OPEN?code?FOR?select?1010?as?code; ??RETURN?NEXT?co

应用-CreateWindow()调用失败返回空句柄,而GetLastError却返回0!

问题描述 CreateWindow()调用失败返回空句柄,而GetLastError却返回0! 下面一段代码我是按照某本书上抄的, #include /////////////////////////////窗口过程声明/////////////////////////////////// LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); /////////////////////////////填充窗口类的函数声明///////////

SpringMVC中通过@ResponseBody返回对象,Js中调用@ResponseBody返回值,统计剩余评论字数的js,@RequestParam默认值,@PathVariable的用法

1.SpringMVC中通过@ResponseBody返回对象,作为JQuery中的ajax返回值 package com.kuman.cartoon.controller;   import java.util.Map;   import javax.servlet.http.HttpServletRequest;   import org.apache.commons.io.filefilter.FalseFileFilter; import org.slf4j.Logger; import

java-HttpClient调用接口返回json

问题描述 HttpClient调用接口返回json java的httpclient发送post请求传入 data , data_digest , msg_type, company_id ,四个参数 调用接口一直返回S02,无法返回我想要的json数据怎么办? 解决方案 这你问谁啊,自己调试自己的代码,看看配置是否有问题 解决方案二: 接口返回json用Httpclient访问接口返回json数据java 调用webservice 接口 解析返回json 解决方案三: 首先你需保证接口调用参数的

c++-RegOpenKeyEx调用失败返回5 ,管理员运行不管用 win7VS2013 请问怎么回事?

问题描述 RegOpenKeyEx调用失败返回5 ,管理员运行不管用 win7VS2013 请问怎么回事? 代码 LONG lRegRet; HLOCAL hLocal; HKEY hKeyUser; PTSTR pszEnvironmentName = NULL; PTSTR pszEnvironmentValue = NULL; pszEnvironmentName = (PTSTR)malloc(MAX_PATH * sizeof(TCHAR)); GetDlgItemText(hDlg,