我正在尝试在Websphere 8.0上使用hudson自动部署EAR。我为它编写了一个脚本,并在执行脚本时显示以下错误。 我正在使用hudson并配置了一个执行以下build.xml的作业。我试图安装从websphere的管理控制台生成的耳朵,它在手动安装时工作正常,但在尝试从hudson安装时失败,它会抛出上述错误。
[wsInstallApp] Installing Application [C:\Users\.hudson\jobs\Websphere Deploy\workspace\ESREAR-1.0-SNAPSHOT.ear]...
[wsadmin] Exception in thread "main" java.lang.NoClassDefFoundError: org.eclipse.core.launcher.Main
[wsadmin] at com.ibm.wsspi.bootstrap.WSPreLauncher.launchEclipse(WSPreLauncher.java:371)
[wsadmin] at com.ibm.wsspi.bootstrap.WSPreLauncher.main(WSPreLauncher.java:142)
[wsadmin] Caused by: java.lang.ClassNotFoundException: org.eclipse.core.launcher.Main
[wsadmin] at java.net.URLClassLoader.findClass(URLClassLoader.java:434)
[wsadmin] at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:665)
[wsadmin] at java.lang.ClassLoader.loadClass(ClassLoader.java:644)
[wsadmin] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:358)
[wsadmin] at java.lang.ClassLoader.loadClass(ClassLoader.java:627)
[wsadmin] ... 2 more
my build.xml is as follows
<?xml version="1.0" encoding="iso-8859-1" ?>
<project name="Auto Deployer for Jenkins" default="deploy" basedir=".">
<!-- Ant-Contrib (if, foreach, etc.) -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="C:/autobuild/WebSphere/Builder/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<!-- WebSphere admin task -->
<taskdef name="wsAdmin" classname="com.ibm.websphere.ant.tasks.WsAdmin" />
<!-- Convert workspace path to forward slashes -->
<path id="toConvert1">
<pathelement location="${workspace}"/>
</path>
<pathconvert dirsep="/" property="workspaceConvert" refid="toConvert1"/>
<property name="wasroot" value="c:/opt/IBM/WebSphere/Profiles/base" />
<property name="user" value="iapawas01" />
<property name="password" value="IAPawas01" />
<target name="install">
<propertyregex property="appname" input="${earfile}"
regexp="([A-Za-z_]*)-(.*)"
select="\1"
defaultvalue=""
override="true"/>
<echo message="Application file ${earfile}"/>
<echo message="Application name ${appname}"/>
<echo message="Uninstalling application" />
<wsAdmin wasHome="${wasroot}" conntype="SOAP" host="${was_soaphost}" port="${was_soapport}" user="${user}" password="${password}" lang="jacl" script="deploy.jacl" failonError="false">
<arg value="uninstall"/>
<arg value="${workspaceConvert}"/>
<arg value="${appname}"/>
<arg value="${earfile}"/>
<arg value="${was_cell}"/>
<arg value="${was_node}"/>
<arg value="${was_server}"/>
<arg value="${was_vhost}"/>
</wsAdmin>
<echo message="Installing application" />
<wsAdmin wasHome="${wasroot}" conntype="SOAP" host="${was_soaphost}" port="${was_soapport}" user="${user}" password="${password}" lang="jacl" script="deploy.jacl" failonError="true">
<arg value="install"/>
<arg value="${workspaceConvert}"/>
<arg value="${appname}"/>
<arg value="${earfile}"/>
<arg value="${was_cell}"/>
<arg value="${was_node}"/>
<arg value="${was_server}"/>
<arg value="${was_vhost}"/>
</wsAdmin>
</target>
<target name="deploy">
<fileset dir="${workspace}" id="earfiles.list">
<include name="**/*.ear"/>
</fileset>
<pathconvert property="earfiles" refid="earfiles.list" pathsep=",">
<map from="${workspace}\" to=""/>
</pathconvert>
<foreach
list="${earfiles}"
target="install"
param="earfile"/>
</target>
</project>
答案 0 :(得分:0)
您目前使用的修订包是什么?
在v8.0.0.3中修复了类似的缺陷: http://www-01.ibm.com/support/docview.wss?uid=swg1PM50904
如果您低于8.0.0.3,那么您可能需要尝试应用修订包3甚至最新版本(修订包9)以查看它是否有帮助。