日期:2014-05-16  浏览次数:21500 次

linux下使用ant启动weblogic时报错:java.lang.NoClassDefFoundError: weblogic/Server 怎么解决?
用ant启动weblogic时候,提示如下错误: 

 [WLServer AdminServer] java.lang.NoClassDefFoundError: weblogic 
 [WLServer AdminServer] Exception in thread "main" 

 请问是怎么回事呢? 

 还有,我搜索过,据说是启动wenblogic的类没有被引用,但在哪里可以引用启动weblogic的类?要引用哪些类? 

build.xml代码如下:

<target name=”startWebLogic” description=”starts a WebLogic”>
<if>
<equals arg1=”${os.name}” arg2=”Linux”/>//判断操作系统类型
<then>
<exec dir=”${bea.home}/user_projects/domains/${weblogic.domain}” executable=”${bea.home}/user_projects/domains/${weblogic.domain}/startWebLogic.sh”>
<arg value=”${weblogic.user}”/>
<arg value=”${weblogic.password}”/>
</exec>
</then>
<else>
<exec dir=”${bea.home}/user_projects/domains/${weblogic.domain}” executable=”${bea.home}/user_projects/domains/${weblogic.domain}/startWebLogic.cmd”>
<arg value=”${weblogic.user}”/>
<arg value=”${weblogic.password}”/>
</exec>
</else>
</if>
</target>
------解决方案--------------------
运行ant脚本之前先执行
source setWLSEnv.sh