我有一个struts1+spring2.0+hibernate3.2(使用了hibernate3.2的注解来配置POJO)的应用,在Tomcat5下非常正常,但部署到weblogic9.1上时启动时报java.lang.NoSuchMethodError: table.是spring在建立sessionFactory Bean时报的错.
[code="java"]
com.jxt.new2.po.Hcompinfo
com.jxt.new2.po.Hinewsinfo
org.hibernate.dialect.Oracle9Dialect
true
<!-- org.hibernate.cache.EhCacheProvider
true -->
[/code]
我猜可能是weblogic用它的jar包取代了我的jar导致的问题,但在网上找了很久也没有发现解决办法.
WEBLOGIC默认会用它自己下面的包。。。
你可以通过weblogc.xml加入这个参数。。。这样weblogic优先使用web程序自带的类库。
true
这个问题可能是这样,因为weblogic9.1中也带了JPA的实现包,程序中的JPA Annotation用的是它的,但是你的Annotation中却有Hibernate特有的Annotation
看看Hibernate官方论坛上的这篇文章,跟你的情况一样,给出了几种解决办法:
[url]http://forum.hibernate.org/viewtopic.php?t=958239&highlight=[/url]
[quote]
You just have to modify the "setDomainEnv.cmd" script. Search for the
"PRE_CLASSPATH" variable and specify the path to the
"ejb3-persistence.jar" archive from Hibernate.
So far that works.
[/quote]
这是Hibernate论坛上的解决办法,说白了还是修改setDomainEnv.cmd这个脚本中的PRE_CLASSPATH变量让它指向Hibernate提供的JAP实现的jar包(ejb3-persistence.jar)上。