Tomcat下项目迁移到weblogic出现ClassNotFoundException

个人项目在myeclipse下开发,使用tomcat测试,一切OK。现在要部署到weblogic下,总出现Error casco.core.hibernate.dao.HibernateDao-[findBySql] error when excute sql:[from casco.Hiernate.DtUser where fyusername=’root’],ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from casco.Hiernate.DtUser where fyusername=’root’]……的错误。使用下面方法,问题解决。

1、将antlr-2.7.6.jar复制到weblogic目录%DOMAIN_HOME%/lib下

2、修改%DOMAIN_HOME%/bin/startWebLogic.cmd

在setClassPath前添加

set PRE_CLASSPATH=%DOMAIN_HOME%\lib\antlr-2.7.6.jar;

在setClassPath后添加

set CLASSPATH=%PRE_CLASSPATH%;%SAVE_CLASSPATH%

保存,重新部署。OK.

========================================

下面方法为网上搜到的,没有使用。列出来供参考:

在WEB-INF下加weblogic.xml

<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE weblogic-web-app PUBLIC “-//BEA Systems, Inc.//DTD Web Application 8.1//EN” “http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd“>
<weblogic-web-app>
<context-root>/51fund</context-root>
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>

<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
这个写不写都行,true也行,false也行。如果报错就改成false。

http://www.diybl.com/course/4_webprogram/jsp/jsp_js/2008825/137387.html

This entry was posted in Computer, Java. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s