如何解决错误java.lang.NoSuchMethodError:sun.security.ssl.SSLSessionImpl?

时间:2019-03-19 07:31:30

标签: java heroku server jersey glassfish

当我尝试通过GlassFish服务器向Heroku PostgreSQL数据库添加数据时,出现此错误。

当我直接由客户端添加数据库时,数据库添加工作正常。

错误是:

  

java.lang.NoSuchMethodError:sun.security.ssl.SSLSessionImpl。(Lsun / security / ssl / ProtocolVersion; Lsun / security / ssl / CipherSuite; Ljava / util / Collection; Lsun / security / ssl / SessionId; Ljava / lang / String; I)V           在sun.security.ssl.ClientHandshaker.serverHello(ClientHandshaker.java:709)           在sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:209)           在sun.security.ssl.Handshaker.processLoop(Handshaker.java:984)           在sun.security.ssl.Handshaker.process_record(Handshaker.java:919)           在sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1072)           在sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)           在sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)           在sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)           在org.postgresql.ssl.MakeSSL.convert(MakeSSL.java:40)           在org.postgresql.core.v3.ConnectionFactoryImpl.enableSSL(ConnectionFactoryImpl.java:435)           在org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:94)           在org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:192)           在org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)           在org.postgresql.jdbc.PgConnection。(PgConnection.java:195)           在org.postgresql.Driver.makeConnection(Driver.java:454)           在org.postgresql.Driver.connect(Driver.java:256)           在java.sql.DriverManager.getConnection(DriverManager.java:664)           在java.sql.DriverManager.getConnection(DriverManager.java:270)           在packageData.Data.getConnection(Data.java:17)           在packageData.Data.postData(Data.java:122)           在packageServer.Server.getData(Server.java:51)           在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处           在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)           在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)           在java.lang.reflect.Method.invoke(Method.java:498)           在org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda $ static $ 0(ResourceMethodInvocationHandlerFactory.java:76)           在org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher $ 1.run(AbstractJavaResourceMethodDispatcher.java:148)           在org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:191)           在org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider $ TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:243)处           在org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:103)处           在org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:493)           在org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:415)           在org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:104)           在org.glassfish.jersey.server.ServerRuntime $ 1.run(ServerRuntime.java:277)           在org.glassfish.jersey.internal.Errors $ 1.call(Errors.java:272)           在org.glassfish.jersey.internal.Errors $ 1.call(Errors.java:268)           在org.glassfish.jersey.internal.Errors.process(Errors.java:316)           在org.glassfish.jersey.internal.Errors.process(Errors.java:298)           在org.glassfish.jersey.internal.Errors.process(Errors.java:268)           在org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289)           在org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256)           在org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703)           在org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:416)           在org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:370)           在org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:389)           在org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:342)           在org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:229)           在org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1580)           在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:258)           在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)           在org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:652)           在org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:591)           在com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)           在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)           在org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:371)           在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)           在com.sun.enterprise.v3.services.impl.ContainerMapper $ HttpHandlerCallable.call(ContainerMapper.java:463)           在com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:168)           在org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)           在org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)           在org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:242)           在org.glassfish.grizzly.filterchain.ExecutorResolver $ 9.execute(ExecutorResolver.java:119)           在org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)           在org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)           在org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)           在org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)           在org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)           在org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:539)           在org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)           在org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)           at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access $ 100(WorkerThreadIOStrategy.java:56)           在org.glassfish.grizzly.strategies.WorkerThreadIOStrategy $ WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)中           在org.glassfish.grizzly.threadpool.AbstractThreadPool $ Worker.doWork(AbstractThreadPool.java:593)           在org.glassfish.grizzly.threadpool.AbstractThreadPool $ Worker.run(AbstractThreadPool.java:573)           在java.lang.Thread.run(Thread.java:748)       ]]

我无法理解为什么通过服务器而不是通过客户端时会出现此错误。

我将不胜感激。

0 个答案:

没有答案