JPA持久性:无法构建Hibernate SessionFactory - 为模式迁移创建DatabaseInformation时出错

时间:2016-07-07 06:46:22

标签: java oracle hibernate jpa

我正在尝试访问一个Oracle XE 11g数据库(当前在docker下运行,但它可以正常运行 - 我可以远程连接SQLDeveloper)和Wildfly 10上的JPA。

我像这样设置我的persistence.xml单元:

<persistence-unit name="oracle">
        <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
        <properties>
            <property name="hibernate.archive.autodetection" value="class" />
            <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
            <property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver" />
            <property name="hibernate.connection.url" value="jdbc:oracle:thin:@192.168.77.132:49161:xe" />
            <property name="hibernate.connection.username" value="lunchapp" />
            <property name="hibernate.connection.password" value="lunchapp" />
            <property name="hibernate.show_sql" value="true"/>
            <property name="hibernate.flushMode" value="FLUSH_AUTO" />
            <property name="hibernate.hbm2ddl.auto" value="update" />
        </properties>
    </persistence-unit>

当我开始部署时,我收到以下错误:

[2016-07-07 08:41:06,969] Artifact lunchtool:war exploded: Error during artifact deployment. See server log for details.
[2016-07-07 08:41:06,970] Artifact lunchtool:war exploded: java.lang.Exception: {"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.lunchtool#oracle" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.lunchtool#oracle: javax.persistence.PersistenceException: [PersistenceUnit: oracle] Unable to build Hibernate SessionFactory
    Caused by: javax.persistence.PersistenceException: [PersistenceUnit: oracle] Unable to build Hibernate SessionFactory
    Caused by: org.hibernate.exception.SQLGrammarException: Error creating DatabaseInformation for schema migration
    Caused by: org.h2.jdbc.JdbcSQLException: Tabelle \"ALL_SEQUENCES\" nicht gefunden
Table \"ALL_SEQUENCES\" not found; SQL statement:
 select sequence_name from all_sequences  union select synonym_name   from all_synonyms us, all_sequences asq  where asq.sequence_name = us.table_name    and asq.sequence_owner = us.table_owner [42102-173]"}}

无论如何 - 显示的sql语句可以通过sqldeveloper执行。 IntelliJ还检测到数据源,当我测试连接时它工作正常。

我有ojdbc6.jar,它也正确部署到wildfly(即野生蝇的爆炸部署中的WEB-INF / lib)。

现在我处在一个我不知道出了什么问题的地步,或者我如何调查我做错了什么。

欢迎任何建议: - )

谢谢!

0 个答案:

没有答案