0

我正在尝试在 Websphere 8.0 上使用 hudson 自动部署 EAR。我为它编写了一个脚本,在执行脚本时它显示以下错误。我正在使用 hudson 并配置了一个执行以下 build.xml 的作业。我尝试安装从 websphere 的管理控制台生成的 ear,它在手动安装时工作正常,但在尝试从 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>
4

1 回答 1

0

您目前使用的是什么修复包?

在 v8.0.0.3 中修复了一个类似的缺陷: http ://www-01.ibm.com/support/docview.wss?uid=swg1PM50904

如果您低于 8.0.0.3,那么您可能需要尝试应用修订包 3 甚至是最新版本(修订包 9),看看它是否有帮助。

于 2014-11-10T08:10:13.587 回答