Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/339.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
java.lang.NoSuchMethodError:sun.security.ssl.SSLSessionImpl<;初始化>;在春季,Hibernate和JSF项目使用Java8在Glassfish上运行_Java_Spring - Fatal编程技术网

java.lang.NoSuchMethodError:sun.security.ssl.SSLSessionImpl<;初始化>;在春季,Hibernate和JSF项目使用Java8在Glassfish上运行

java.lang.NoSuchMethodError:sun.security.ssl.SSLSessionImpl<;初始化>;在春季,Hibernate和JSF项目使用Java8在Glassfish上运行,java,spring,Java,Spring,我有一个使用以下技术的项目: 弹簧 冬眠 JSF 服务员:GlassFish 5 JDK版本:1.8.0_181 数据库:Sql Server-版本14.0.1000.169 IDE:Intellij 2018.1.6 应用程序正在引发以下异常(java.lang.NoSuchMethodError): [2018-09-11T12:57:32.846+0100][glassfish 5.0][WARNING][[org.springframework.context.annotation.

我有一个使用以下技术的项目:

  • 弹簧
  • 冬眠
  • JSF
  • 服务员:GlassFish 5
  • JDK版本:1.8.0_181
  • 数据库:Sql Server-版本14.0.1000.169
  • IDE:Intellij 2018.1.6
应用程序正在引发以下异常(java.lang.NoSuchMethodError):

[2018-09-11T12:57:32.846+0100][glassfish 5.0][WARNING][[org.springframework.context.annotation.AnnotationConfigApplicationContext][tid:_ThreadID=31 _ThreadName=http-listener-1(3)][timeMillis:1536667052846][levelValue:900][[
上下文初始化期间遇到异常-取消刷新尝试:org.springframework.beans.factory.unsatifiedpendencyException:创建名为“applicationServiceImp”的bean时出错:通过字段“applicationDAO”表示的未满足依赖项;嵌套异常为org.springframework.beans.factory.unsatifiedpendencyExceptionion:创建名为“applicationDAO”的bean时出错:通过字段“sessionFactory”表示的依赖关系未得到满足;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为com.foo.app.HibernateConf的bean时出错:调用init方法失败;嵌套异常为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]]
这是我的POM:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.foo</groupId>
    <artifactId>FOO</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
    </properties>

    <dependencies>

        <!--EmailAddress Validator-->
        <dependency>
            <groupId>commons-validator</groupId>
            <artifactId>commons-validator</artifactId>
            <version>1.6</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.primefaces/primefaces -->
        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>6.2</version>
        </dependency>

        <dependency>
            <groupId>org.primefaces.extensions</groupId>
            <artifactId>primefaces-extensions</artifactId>
            <version>6.2</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/javax.faces/javax.faces-api -->
        <dependency>
            <groupId>javax.faces</groupId>
            <artifactId>javax.faces-api</artifactId>
            <version>2.1</version>
        </dependency>

        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>2.2.9</version>
        </dependency>

        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-impl</artifactId>
            <version>2.2.9</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>5.3.1.Final</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.hibernate.validator/hibernate-validator -->
        <dependency>
            <groupId>org.hibernate.validator</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>6.0.9.Final</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.17</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>3.17</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.lowagie/itext -->
        <dependency>
            <groupId>com.lowagie</groupId>
            <artifactId>itext</artifactId>
            <version>2.1.7</version>
        </dependency>

        <!-- spring-orm module provides the Spring integration with Hibernate -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>5.0.6.RELEASE</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>5.0.6.RELEASE</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-dbcp2 -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-dbcp2</artifactId>
            <version>2.3.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/jaxen/jaxen -->
        <dependency>
            <groupId>jaxen</groupId>
            <artifactId>jaxen</artifactId>
            <version>1.1.6</version>
        </dependency>


    </dependencies>

    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>

        <testSourceDirectory>src/test/java</testSourceDirectory>
        <testResources>
            <testResource>
                <directory>source/test/resources</directory>
            </testResource>
        </testResources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <warSourceDirectory>web</warSourceDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

4.0.0
com.foo
福
1.0-快照
通用验证器
通用验证器
1.6
org.primefaces
素面
6.2
org.primefaces.extensions
素数面扩展
6.2
javax.faces
javax.faces-api
2.1
爪哇
javaeewebapi
7
假如
com.sun.faces
JSFAPI
2.2.9
com.sun.faces
jsf impl
2.2.9
org.hibernate
冬眠核心
5.3.1.最终版本
org.hibernate.validator
休眠验证器
6.0.9.1最终版本
org.apache.poi
poi
3.17
org.apache.poi
poi ooxml
3.17
com.lowagie
文字
2.1.7
org.springframework
春季甲虫
5.0.6.1发布
org.springframework
spring上下文
5.0.6.1发布
org.apache.commons
commons-dbcp2
2.3.0
杰克森
杰克森
1.1.6
src/main/java
src/main/resources
src/test/java
来源/测试/资源
org.apache.maven.plugins
maven战争插件
2.3
网状物
org.apache.maven.plugins
maven编译器插件
3.1
1.8
1.8
我对后端技术没有经验。我收到这个项目,只是希望它运行良好,这样我就可以开始改变前端。我知道它在创建项目的人的计算机上运行良好。它运行时不会引发此异常

这个项目编制得很好。而且开始运行良好。我不明白为什么会发生这种异常。

您应该将java(JDK和JRE)降级为
1.8.0_151

这将解决问题

我想,当我降级时,我提到的错误被以下错误所取代:org.hibernate.exception.genericjdbception:无法打开JDBC连接以执行DDL

那很好。现在我们必须建立数据库连接,我们就到家了

在这一点上,我将重点介绍hibernate数据源配置。有问题的可能性很大

连接驱动程序中设置的属性必须完全匹配。检查驱动程序、url、端口、用户名和密码(注意区分大小写和空格)


您的用户也可能会错过SQL Server权限,但DB admin就是这种情况。

在将java降级到1.8版本后,仍然存在相同的问题:

org.hibernate.exception.GenericJDBCException: Unable to open JDBC Connection for DDL execution]]  it seems that this error occurred due to a  bad  database connection, thus
您必须在资源文件夹下的application.properties中设置数据库连接属性

spring.datasource.driverClassName=com.mysql.jdbc.Driver 
spring.datasource.username=Ur user name 
spring.datasource.password=Your data base password
spring.datasource.platform=mysql spring.datasource.continueOnError=false

我确实试过了。这个特别的错误消失了,但其他4个错误出现了。所以我的结局更糟。我想当我降级时,我提到的错误被替换为:org.hibernate.exception.genericjdbception:无法打开JDBC连接以执行DDL]]实际上,我得到的第一个错误是:
hh000342:无法获得查询元数据的连接:无法创建PoolableConnectionFactory(驱动程序无法使用安全套接字层(SSL)加密建立到SQL Server的安全连接。错误:“java.lang.RuntimeException:无法生成DH密钥对”。ClientConnectionId:70b01a38-e8e7-4256-bbd2-7b9d3396221e)]
spring.datasource.driverClassName=com.mysql.jdbc.Driver 
spring.datasource.username=Ur user name 
spring.datasource.password=Your data base password
spring.datasource.platform=mysql spring.datasource.continueOnError=false