相关疑难解决方法(0)

JBOSS部署在oracle主要版本11上有HibernateException

尝试使用JBoss-4.2.3.GA中的以下设置部署应用程序ear文件

的jboss-app.xml中

<jboss-app>
    <loader-repository>
        com.xxxx.xxx:loader=<ear-name>
      <loader-repository-config>
        java2ParentDelegation=false
      </loader-repository-config>  
    </loader-repository>
</jboss-app>
Run Code Online (Sandbox Code Playgroud)

persistence.xml(只是一个片段)

<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
<property name="hibernate.hbm2ddl.auto" value="validate"/>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.format_sql" value="false"/>
<property name="jboss.entity.manager.factory.jndi.name" value="java:/XXXXFactory"/>
Run Code Online (Sandbox Code Playgroud)

在部署期间获得了以下记录器信息,我不确定为什么INFO记录器中列出了异常,我不能为此烦恼吗?

16:30:07,239 INFO  [STDOUT] 16:30:07,238 INFO  [SettingsFactory] JDBC driver: Oracle JDBC driver, version: 11.2.0.3.0
javax.ejb.EJBException: org.hibernate.HibernateException: unknown Oracle major version [11]
    at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
    at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)


Caused by: org.hibernate.HibernateException: unknown Oracle major version [11]
    at org.hibernate.dialect.DialectFactory$1.getDialectClass(DialectFactory.java:135)
    at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:65)
    at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
    at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:426)
Run Code Online (Sandbox Code Playgroud)

注意:我们使用的是JBoss-Seam-2.2.0.GA

试过:这个,这个那个

如果需要任何其他信息,请告诉我,我正试图将jboss中提供的库恢复到耳朵.

更新:尝试

  1. 想出应用程序正在使用2个不同的会话,并且
    还有一个hibernate.cfg.xml也用于另一个遗留代码,其中没有指定方言.
  2. 所以将Oracle10g方言添加到cfg.xml,它停止抛出上面提到的未知oracle版本错误,但它因为无法加载10gDialect而异常. …

java oracle hibernate dialect jboss-4.2.x

4
推荐指数
1
解决办法
9576
查看次数

Hibernate @formula 不支持将 Cast() 作为 teradata 数据库的 int

我在用

@Formula("cast(item_code as \"int\")")
Run Code Online (Sandbox Code Playgroud)

将一String列投射到int

hibernate正在生成查询

and cast(this_.item_code as this_."int")=? 
Run Code Online (Sandbox Code Playgroud)

怎么去掉alias前面的int

我试过 :

@Formula("cast(item_code as "int")")@Formula("cast(item_code as int)")

但还是同样的错误。我如何投射Stringint

提前致谢 。

hibernate formula

4
推荐指数
1
解决办法
2692
查看次数

标签 统计

hibernate ×2

dialect ×1

formula ×1

java ×1

jboss-4.2.x ×1

oracle ×1