0

I am trying to auto deploy an EAR using hudson on Websphere 8.0. I have written a script for it and while executing the script it shows the following error. I am using hudson and have configured a job which executes the following build.xml. I tried to install the ear generated from admin console of websphere and it works fine when installed manually but fails when trying to install from hudson it throws the above error.

[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>
Pallavi
  • 79
  • 1
  • 6

1 Answers1

0

What fix pack are you currently on?

There is a similar defect which was fixed in v8.0.0.3: http://www-01.ibm.com/support/docview.wss?uid=swg1PM50904

If you're below 8.0.0.3 then you may want to try and apply fix pack 3 or even the latest release (fix pack 9) to see if it helps.

wFateem
  • 346
  • 1
  • 2
  • 11