Glassfish: Spring boot error

亡梦爱人 提交于 2019-12-24 23:57:54

问题


I have a spring boot application deployed in Glassfish 5.0. When trying to access a REST service in this application with spring security basic auth, I'm getting the below error:

java.lang.NoSuchMethodError: sun.security.ssl.SessionId.checkLength(Lsun/security/ssl/ProtocolVersion;)V

The application works fine in Tomcat server. This error is occurring only in glassfish server. My JAVA_HOME is already set to jdk1.8.0_31. What could be the issue ?

Below is the error when I'm trying to access the service using postman:


回答1:


which means underlying jar lib in glass fish doesn't contain the class'smethod as springboot expected




回答2:


The jar file that contains the method sun.security.ssl.SessionId.checkLength may not be deployed in glass fish server. The package is expecting into the glass fish server. So find the package in which the sun.security.ssl.SessionId class is declared and and deploy the jar file of the package in the glass fish server. the package contains in your library list but the library is not deployed in glass fish server.

sun.security.ssl.SessionId  class is a part of jdk8. So make sure  your glassfish server using jdk8. it may not work in jdk7.


来源:https://stackoverflow.com/questions/45731810/glassfish-spring-boot-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!