在Tomcat5.5中可以正常运行的SSH项目,移植到weblogic10.x后,却出现了诸如下面的错误:
<wbr></wbr>
<wbr></wbr>
rg.springframework.orm.hibernate3.HibernateQueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from com.datastage.model.TmdDatastageXm project where project.jqbh=?]; nested exception is org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from com.datastage.model.TmdDatastageXm project where project.jqbh=?]org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from com.datastage.model.TmdDatastageXm project where project.jqbh=?]
at org.hibernate.hql.ast.HqlLexer.panic(HqlLexer.java:57)
at antlr.CharScanner.setTokenObjectClass(CharScanner.java:340)
at org.hibernate.hql.ast.HqlLexer.setTokenObjectClass(HqlLexer.java:31)
at org.hibernate.hql.ast.HqlLexer.panic(HqlLexer.java:57)
at antlr.CharScanner.setTokenObjectClass(CharScanner.java:340)
at org.hibernate.hql.ast.HqlLexer.setTokenObjectClass(HqlLexer.java:31)
解决方法如下:
在myeclipse6.5中:
依次点击windows-preferences-myeclipse workbench-servers-weblogic-weblogic10.x-path,在prepend to classpath选项中,把hibernate要用到的包antlr.jar添加到weblogic的classpath中。
这样在weblogic便可以通过myeclipse正常启动,以上提到的问题解决。
如果想要通过weblogic自带的脚本来运行:
将工程里的antlr.jar拷贝到weblogic的wlserver_10.3\server\lib文件夹下面,在domains\base_domain\bin里找到startWebLogic.cmd文件,找到:
setCLASSPATH=%SAVE_CLASSPATH%
在下面增加:
@REM hibernate3
set PRE_CLASSPATH=%WL_HOME%\server\lib\antlr.jar
set CLASSPATH=%PRE_CLASSPATH%;%CLASSPATH%
保存。
双击该脚本启动weblogic,即可由非myeclipse的方式启动工程了。