-
Ant WAS ADMIN tasks (17 messages)
- Posted by: kumar dave
- Posted on: March 02 2005 21:36 EST
I am trying to install an application to WAS server through ANT build script.I
kept wsanttask.jar in my ant\lib\. Am running through my local machine which is
on XP and trying to install on WAS server on AIX box. It will be a great help
for me. Thanks. Here is my code in the script : <taskdef name="wsInstallApp"
classname="com.ibm.websphere.ant.tasks.InstallApplication"/> <wsInstallApp
wasHome="${wasInstallationdir}" ear="${earpath}/ABC.ear"
profile="setupCmdLine.sh" conntype="SOAP" host="hostname" port="xxxx"/> while
running the script am gettiing this message : [echo] installing ear on WAS
server [wsInstallApp] Installing Application [D:\backup\PEXT.ear]... Unable to
parse setupCmdLine: \usr\WebSphere\AppServer\bin\setupCmdLine.bat (The system
cannot find the path specified) [wsadmin] The java class is not found:
com/ibm/ws/bootstrap/WSLauncher [wsadmin] Java Result: 1 [wsInstallApp]
Installed ApplicationThreaded Messages (17)
- Ant WAS ADMIN tasks by Bill Lasley on March 03 2005 16:03 EST
- Ant WAS ADMIN tasks by kumar dave on March 03 2005 23:30 EST
- Ant WAS ADMIN tasks by Bill Lasley on March 04 2005 12:46 EST
- I am getting the same problem. by Gopinath Sundararajan on March 30 2005 13:59 EST
- Same problem by jannik jensen on April 13 2005 09:57 EDT
- Ant task on Windows XP installing an application on UNIX by Joe Fraser on April 26 2005 10:06 EDT
- WebSphere Ant Task Issue Moving from 5.x to 6.x by Douglas Newton on April 27 2005 14:07 EDT
- Need help to resolve this websphere ant by mani gopalakrishnan on November 01 2011 10:26 EDT
- Thanks for posting that script by John Aronson on May 03 2005 18:57 EDT
- Ant Script to update the application by Narenra Nallapareddy on November 16 2005 04:27 EST
- WebSphere Ant Task Issue Moving from 5.x to 6.x by Douglas Newton on April 27 2005 14:07 EDT
- Ant WAS ADMIN tasks by C D on November 17 2005 11:16 EST
- Ant WAS ADMIN tasks by C D on November 28 2005 08:11 EST
-
Ant WAS ADMIN tasks by seshasai bhootadi on December 08 2005 01:31 EST
-
Ant WAS ADMIN tasks by seshasai bhootadi on December 08 2005 02:55 EST
-
ANT WAS Admin, wsInstallApp and profile by Neven Cvetkovic on February 01 2006 05:17 EST
- Having similar issue any solution update? by amit shah on March 19 2007 04:33 EDT
-
ANT WAS Admin, wsInstallApp and profile by Neven Cvetkovic on February 01 2006 05:17 EST
-
Ant WAS ADMIN tasks by seshasai bhootadi on December 08 2005 02:55 EST
-
Ant WAS ADMIN tasks by seshasai bhootadi on December 08 2005 01:31 EST
- Ant WAS ADMIN tasks by C D on November 28 2005 08:11 EST
- Ant WAS ADMIN tasks by Andrew Hastie on June 27 2011 06:11 EDT
-
Ant WAS ADMIN tasks[ Go to top ]
- Posted by: Bill Lasley
- Posted on: March 03 2005 16:03 EST
- in response to kumar dave
I assume this is a pre-WAS6 base websphere environment? If so, I think you need to FTP the EAR to the remote machine and do the install from there. If this were an ND installation, you would be able to do a remote install. In WAS6 remote file transfer is supported for non-managed nodes, so it may be possible to do a remote install from base-to-base, although I have never tried it.
Also, I think you need to create a build batch file based on $WAS_HOME/bin/ws_ant.bat[sh] and run your build and deploy scripts from the batch files (probably the cause of the com/ibm/ws/bootstrap/WSLauncher Java class not found error).
In addition, your task has the parameter, profile="setupCmdLine.sh". The profile option is for a JACL script that is to be executed before the main wsadmin command is executed. Ant task wsInstallApp is a wrapper for wsadmin command, AdminApp install.
Ant has FTP and Telnet tasks which you may be able to use.
Bill Lasley
Versant Corp.
http://www.versant.com -
Ant WAS ADMIN tasks[ Go to top ]
- Posted by: kumar dave
- Posted on: March 03 2005 23:30 EST
- in response to kumar dave
So there no possibility that i can run ant WAS ADMIN tasks from WINDOWS XP while my WAS 5.1 app server is on linux.
Any help is appreciated -
Ant WAS ADMIN tasks[ Go to top ]
- Posted by: Bill Lasley
- Posted on: March 04 2005 12:46 EST
- in response to kumar dave
I think you can, by using the Ant FTP and Telnet tasks. However, deploying an application directly from development is not a best practice, particularly if your target is a production server. You should be creating a binary repository, which is versioned like your source code, from which deployments are made, via a repeatable and controlled process.
Bill Lasley
Versant Corp.
http://www.versant.com -
I am getting the same problem.[ Go to top ]
- Posted by: Gopinath Sundararajan
- Posted on: March 30 2005 13:59 EST
- in response to kumar dave
Hi ,
I am getting the same problem... Unable to parse setupCmdLine.bat( the system cannot find the specified file.) I have wasHome defined in my wsInstallApp task. For some reason I get the message \null\bin\setupCmdLine.bat not found.
Am I not setting any environmental variables correctly.
Thanks,
Freekbolt -
Same problem[ Go to top ]
- Posted by: jannik jensen
- Posted on: April 13 2005 09:57 EDT
- in response to Gopinath Sundararajan
Hey had the same problem solved it using the ws_ant util in the WAS_HOME/bin dir.
Developl an ant file with the tasks: http://publib.boulder.ibm.com/infocenter/ws51help/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/javadoc/ae/index.html
Eg.:
<path id="ws.lib">
<fileset dir="${websphere.home}/lib">
<include name="*.jar" />
</fileset>
</path>
<!-- websphere -->
<target name="wsListApp" depends="init" >
<taskdef name="wsListApp" classname="com.ibm.websphere.ant.tasks.ListApplications">
<classpath refid="ws.lib"/>
</taskdef>
<wsListApp
wasHome="${websphere.home}"
/>
</target>
And call from the commandline:
ws_ant -buildfile yourBuildFile.xml wsListApp
This way you use IBM's jwm:
[wsadmin] ************ Start Display Current Environment ************
[wsadmin] Host Operating System is Linux, version 2.6.9-gentoo-r9
[wsadmin] Java version = J2RE 1.4.2 IBM build cxia32142sr1w-20041028 (JIT enabled: jitc), Java Compiler = jitc, Java VM name = Classic VM
Hope it helps -
Ant task on Windows XP installing an application on UNIX[ Go to top ]
- Posted by: Joe Fraser
- Posted on: April 26 2005 10:06 EDT
- in response to kumar dave
IT can be done. below is a script that is tested. Not bad for a hick from Nebraska.
<?xml version="1.0" encoding="UTF-8"?>
<project name="clusterDeployIter1" default="build-all" basedir=".">
<!-- ===================================================================== -->
<!-- define global properties -->
<!-- ===================================================================== -->
<!--
<property name="remoteAppName" value="MQWF_Web_Client_WEBCLI3"/>
<property name="remoteAppName" value="BPSIter1"/>
-->
<property name="remoteAppName" value="ivtApp"/>
<property name="clusterServerName" value="server2"/>
<property name="remoteUatHostName" value="10.41.5.231"/>
<property name="remoteUatFtpDir" value="/usr/WebSphere/AppServer/installableApps"/>
<property name="remoteUatConnType" value="SOAP"/>
<property name="remoteUatPort" value="8881"/>
<property name="remoteUatUserId" value="root"/>
<property name="remoteUatPassword" value="swiss"/>
<property name="remoteUatFtpJarDir" value="/usr/WebSphere/AppServer/classes"/>
<property name="remoteProdHostName" value="10.41.5.234"/>
<property name="remoteProdConnType" value="SOAP"/>
<property name="remoteProdPort" value="8882"/>
<property name="remoteProdUserId" value="root"/>
<property name="remoteProdPassword" value="swiss"/>
<property name="remoteProdFtpJarDir" value="/usr/WebSphere/AppServer/classes"/>
<property name="remoteDmgrPort" value="8889"/>
<property name="mailHostName" value="dolsmtp.dol.state.ne.us"/>
<tstamp>
<format property="NOW" pattern="yyyy-MM-dd-HH-mm"/>
</tstamp>
<!-- change this to your local installation, if different -->
<property name="existingEar.dir" value="C:/temp/ANT/unpack"/>
<property name="existingEar" value="ivtApp.ear"/>
<property name="existingJar.dir" value="C:/temp/ANT/unpack"/>
<property name="existingJar" value="BPSIntegrationEJB.jar"/>
<!-- change this to your local installation, if different -->
<property name="wasHome.dir" value="C:\Progra~1\IBM\WebSph~1\Applic~1\v5.1.2\runtimes\base_v51"/>
<taskdef name="wsStopApp" classname="com.ibm.websphere.ant.tasks.StopApplication"/>
<taskdef name="wsStartApp" classname="com.ibm.websphere.ant.tasks.StartApplication"/>
<taskdef name="wsUninstallApp" classname="com.ibm.websphere.ant.tasks.UninstallApplication"/>
<taskdef name="wsInstallApp" classname="com.ibm.websphere.ant.tasks.InstallApplication"/>
<target name="prepare">
<ftp server="${remoteUatHostName}" userid="${remoteUatUserId}" password="${remoteUatPassword}" remotedir="${remoteUatFtpDir}" binary="yes" action="put">
<fileset dir="${existingEar.dir}">
<include name="${existingEar}"/>
</fileset>
</ftp>
<!--
<ftp server="${remoteUatHostName}" userid="${remoteUatUserId}" password="${remoteUatPassword}" remotedir="${remoteUatFtpJarDir}" binary="yes" action="put">
<fileset dir="${existingJar.dir}">
<include name="${existingJar}"/>
</fileset>
</ftp>
<ftp server="${remoteProdHostName}" userid="${remoteProdUserId}" password="${remoteProdPassword}" remotedir="${remoteProdFtpJarDir}" binary="yes" action="put">
<fileset dir="${existingJar.dir}">
<include name="${existingJar}"/>
</fileset>
</ftp>
-->
</target>
<!--
<target name="stopWebApp1" depends="prepare">
<wsStopApp wasHome="${wasHome.dir}"
application="${remoteAppName}"
server="${clusterServerName}"
conntype="${remoteUatConnType}"
host="${remoteUatHostName}"
port="${remoteUatPort}"
user="${remoteUatUserId}"
password="${remoteUatPassword}"/>
</target>
<target name="stopWebApp2" depends="stopWebApp1">
<wsStopApp wasHome="${wasHome.dir}"
application="${remoteAppName}"
server="${clusterServerName}"
conntype="${remoteProdConnType}"
host="${remoteProdHostName}"
port="${remoteProdPort}"
user="${remoteProdUserId}"
password="${remoteProdPassword}"/>
</target>
<target name="uninstallEar" depends="stopWebApp2">
<wsUninstallApp wasHome="${wasHome.dir}"
application="${remoteAppName}"
options="-cell uatNetwork -cluster DOL"
conntype="${remoteUatConnType}"
host="${remoteUatHostName}"
port="${remoteDmgrPort}"
user="${remoteUatUserId}"
password="${remoteUatPassword}"/>
</target>
-->
<target name="installEar" depends="prepare">
<wsInstallApp ear="${existingEar.dir}/${existingEar}"
wasHome="${wasHome.dir}"
options="-cell uatNetwork -cluster DOL"
conntype="${remoteUatConnType}"
host="${remoteUatHostName}"
port="${remoteDmgrPort}"
user="${remoteUatUserId}"
password="${remoteUatPassword}"/>
</target>
<target name="startWebApp1" depends="installEar">
<wsStartApp wasHome="${wasHome.dir}"
application="${remoteAppName}"
server="${clusterServerName}"
conntype="${remoteProdConnType}"
host="${remoteProdHostName}"
port="${remoteProdPort}"
user="${remoteProdUserId}"
password="${remoteProdPassword}"/>
</target>
<target name="startWebApp2" depends="startWebApp1">
<wsStartApp wasHome="${wasHome.dir}"
application="${remoteAppName}"
server="${clusterServerName}"
conntype="${remoteUatConnType}"
host="${remoteUatHostName}"
port="${remoteUatPort}"
user="${remoteUatUserId}"
password="${remoteUatPassword}"/>
</target>
<target name="build-all" depends="startWebApp2">
<mail from="JFraser at dol dot state dot ne dot us" tolist="JFraser at dol dot state dot ne dot us" subject="deployed on UAT" mailhost="${mailHostName}" mailport="25">
<message mimetype="text/html"> There is a new ear file in the installableApps folder of Server UAT </message>
</mail>
</target>
</project> -
WebSphere Ant Task Issue Moving from 5.x to 6.x[ Go to top ]
- Posted by: Douglas Newton
- Posted on: April 27 2005 14:07 EDT
- in response to Joe Fraser
With WAS 5.0.2 Network Deploy we were using ant (not ws_ant) to do deploys from the same box running the deployment manager. We simply dropped the wsanttasks.jar into our install of ant (ant/lib), and all of the standard WAS ant tasks were working -- only having to pass the correct parameters into the task APIs.
We mainly used a separate install of ant instead of ws_ant to allow us flexibility in the version we use. We have never validated use of ant vs. ws_ant for remote installs or ant tasks other than those needed to build EJBs and start/stop/install/uninstall applications. It just worked for the scenario we were using, and we didn't investigate it any further.
Now, with WAS 6.0.1.0, we have to do a bit more to make this same process work:
1.) Copy both the wsanttasks.jar and the wsprofile.jar to the install of ant (ant/lib).
2.) Set the ANT_OPTS environment variable to "-Duser.install.root=/<was-install-root>/profiles/<dm-profile-directory>"
There are new runtime dependencies in the wsanttasks.jar to the wsprofile.jar, and the system property user.install.root must be set to the dm profile directory. It makes sense, considering the new concept of the profile in the WAS installation configuration. I guess it was decided to not change the ant task APIs, and instead pass the new needed information through a new system property.
With those simple changes, our build/deploy process is now working as before for our scenario.
So, you can use ws_ant, or your own install of ant (at least for the scenario I described).
Sincerely,
Doug Newton -
Need help to resolve this websphere ant[ Go to top ]
- Posted by: mani gopalakrishnan
- Posted on: November 01 2011 10:26 EDT
- in response to Douglas Newton
There is no wsanttasks.jar on websphere 7.So how can I solve this kind of issue?
please help me !
Thanks,
Mani.
-
Thanks for posting that script[ Go to top ]
- Posted by: John Aronson
- Posted on: May 03 2005 18:57 EDT
- in response to Joe Fraser
It was very helpful to me. -
Ant Script to update the application[ Go to top ]
- Posted by: Narenra Nallapareddy
- Posted on: November 16 2005 16:27 EST
- in response to John Aronson
Can some help how to write a Ant script to update the application as I do not want to uninstall and Install application.
Thanks -
Ant WAS ADMIN tasks[ Go to top ]
- Posted by: C D
- Posted on: November 17 2005 11:16 EST
- in response to kumar dave
This thread has been very helpful, however I wanted to know few more things, if someone can help me that would be great.
I am using WS6 and am using "wsejbdeploy" ANT task to generate WS deploy build outside WSAD. However I am getting
same error as mentioned by Kumar and that is: "Unable to parse setupCmdLine: null\bin\setupCmdLine.bat"
The replies are regarding doing ear ftp to the server and installing remotely. Is this error related to remote ftp/install or the set-up is missing something?
Any help will be greatly appreciated!
Thanks,
CD
Details of wsejbdeploy task url: http://publib.boulder.ibm.com/infocenter/wasinfo/v5r1//index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/javadoc/ae/com/ibm/websphere/ant/tasks/WsEjbDeploy.html -
Ant WAS ADMIN tasks[ Go to top ]
- Posted by: C D
- Posted on: November 28 2005 08:11 EST
- in response to C D
I got around this problem by using ejbdeploy instead of wsejbdeploy on EAR file. -
Ant WAS ADMIN tasks[ Go to top ]
- Posted by: seshasai bhootadi
- Posted on: December 08 2005 01:31 EST
- in response to C D
Hi,
Even m getting the same error message.
I am trying to deploy and EAR file into the WAS6.0.2.
Getting error message.
Unable to parse setupCmdLine.bat( the system cannot find the specified file.)
Here is my code
<target name="deploy">
<ant antfile="xmls/appserver-websphere.xml" target="wsdeploy" >
<property name="debug" value="true"/>
<property name="classpath" value="${deploy.server.home}/appserver/lib/wsanttasks.jar;ant.jar;${deploy.server.home}/AppServer/lib/webservices.jar;"/>
<property name="inputFile" value="file.ear"/>
<property name="outputFile" value="output.ear"/>
<property name="ignoreErrors" value="false"/>
<property name="noValidate" value="false"/>
<property name="trace" value="false"/>
<property name="deploy.server.home" value="."/>
</ant>
</target>
<target name="wsdeploy">
<taskdef name="wsdeploy" classname="com.ibm.websphere.ant.tasks.WSDeploy">
<classpath>
<pathelement path="wsanttasks.jar;webservices.jar;"/>
</classpath>
</taskdef>
<ant antfile="xmls/appserver-websphere.xml" target="installEar" >
<!-- <property name="wasHome" value="${deploy.server.home}"/>
<property name="ear" value="file.ear"/>
<property name="profile" value="${deploy.server.home}/profiles/default/bin/setupCmdLine.bat"/>
<property name="conntype" value="SOAP"/>
<property name="host" value="localhost"/>
<property name="port" value="9060"/>-->
</ant>
</target>
<target name="installEar">
<taskdef name="wsInstallApp" classname="com.ibm.websphere.ant.tasks.InstallApplication">
<classpath>
<pathelement path="${deploy.server.home}/lib/wsanttasks.jar;${deploy.server.home}/lib/wsprofile.jar;${deploy.server.home}/lib/bootstrap.jar"/>
</classpath>
</taskdef>
<wsInstallApp
ear="file.ear"
wasHome="${deploy.server.home}"
conntype="SOAP"
host="localhost"
port="9060"
/>
</target>
Thanks and Regards,
Austin Carter -
Ant WAS ADMIN tasks[ Go to top ]
- Posted by: seshasai bhootadi
- Posted on: December 08 2005 02:55 EST
- in response to seshasai bhootadi
Hi,Even m getting the same error message.I am trying to deploy and EAR file into the WAS6.0.2.Getting error message.Unable to parse setupCmdLine.bat( the system cannot find the specified file.) Here is my code<target name="deploy"><ant antfile="xmls/appserver-websphere.xml" target="wsdeploy" > <property name="debug" value="true"/> <property name="classpath" value="${deploy.server.home}/appserver/lib/wsanttasks.jar;ant.jar;${deploy.server.home}/AppServer/lib/webservices.jar;"/> <property name="inputFile" value="file.ear"/> <property name="outputFile" value="output.ear"/> <property name="ignoreErrors" value="false"/> <property name="noValidate" value="false"/> <property name="trace" value="false"/> <property name="deploy.server.home" value="."/> </ant> </target> <target name="wsdeploy"> <taskdef name="wsdeploy" classname="com.ibm.websphere.ant.tasks.WSDeploy"> <classpath> <pathelement path="wsanttasks.jar;webservices.jar;"/> </classpath> </taskdef> <ant antfile="xmls/appserver-websphere.xml" target="installEar" > <!-- <property name="wasHome" value="${deploy.server.home}"/> <property name="ear" value="file.ear"/> <property name="profile" value="${deploy.server.home}/profiles/default/bin/setupCmdLine.bat"/> <property name="conntype" value="SOAP"/> <property name="host" value="localhost"/> <property name="port" value="9060"/>--> </ant> </target> <target name="installEar"> <taskdef name="wsInstallApp" classname="com.ibm.websphere.ant.tasks.InstallApplication"> <classpath> <pathelement path="${deploy.server.home}/lib/wsanttasks.jar;${deploy.server.home}/lib/wsprofile.jar;${deploy.server.home}/lib/bootstrap.jar"/> </classpath> </taskdef> <wsInstallApp ear="file.ear" wasHome="${deploy.server.home}" conntype="SOAP" host="localhost" port="9060" /> </target>
I have even tried to do the remote access but getting the FTPClient class not found exception.
Thanks and Regards,Austin Carter -
ANT WAS Admin, wsInstallApp and profile[ Go to top ]
- Posted by: Neven Cvetkovic
- Posted on: February 01 2006 17:17 EST
- in response to seshasai bhootadi
Hi Austin and Kumar,
It seems that your error is in the "profile", as Bill pointed out in the first reply.
"wsInstallApp" is a wrapper around $AdminApp from WSADMIN. You need to pass in the parameter for the profile (e.g. profileDmgr). See the example below:
<target name="install" depends="dist" description="Install application">
<wsInstallApp
wasHome="${washome}"
ear="${earfile}"
options="-cluster myCluster"
profile="profileDmgr"
conntype="SOAP"
host="ip.address.of.the.was.admin.machine"
port="8879"
/>
</target>
-
Having similar issue any solution update?[ Go to top ]
- Posted by: amit shah
- Posted on: March 19 2007 16:33 EDT
- in response to Neven Cvetkovic
I was going through the post but didn't find any solution that would work for me. Here is the error that i am getting [wsadmin] java.lang.reflect.InvocationTargetException: java.lang.NoClassDefFoundError: javax/security/auth/Refreshable [wsadmin] at java.lang.ClassLoader.defineClass0(Native Method) [wsadmin] at java.lang.ClassLoader.defineClass(ClassLoader.java:703) [wsadmin] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:133) [wsadmin] at java.net.URLClassLoader.defineClass(URLClassLoader.java:320) [wsadmin] at java.net.URLClassLoader.access$400(URLClassLoader.java:93) [wsadmin] at java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:678) [wsadmin] at java.security.AccessController.doPrivileged(Native Method) [wsadmin] at java.net.URLClassLoader.findClass(URLClassLoader.java:239) [wsadmin] at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:45) [wsadmin] at java.lang.ClassLoader.loadClass(ClassLoader.java:516) [wsadmin] at java.lang.ClassLoader.loadClass(ClassLoader.java:448) [wsadmin] at com.ibm.websphere.management.AdminClientFactory.createAdminClient(AdminClientFactory.java:150) [wsadmin] at com.ibm.ws.scripting.CommonScriptingObject.connectToAdminService(CommonScriptingObject.java:117) [wsadmin] at com.ibm.ws.scripting.CommonScriptingObject.(CommonScriptingObject.java:99) [wsadmin] at com.ibm.ws.scripting.AdminControlClient.(AdminControlClient.java:154) [wsadmin] at com.ibm.ws.scripting.AbstractShell.createControlClient(AbstractShell.java:888) [wsadmin] at com.ibm.ws.scripting.AbstractShell.run(AbstractShell.java:1552) [wsadmin] at com.ibm.ws.scripting.WasxShell.main(WasxShell.java:827) [wsadmin] at java.lang.reflect.Method.invoke(Native Method) [wsadmin] at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:105) -
Ant WAS ADMIN tasks[ Go to top ]
- Posted by: Andrew Hastie
- Posted on: June 27 2011 06:11 EDT
- in response to kumar dave
For various reasons, I wanted to use a standard ANT version in order to automate EJB deployment from inside IDEA IntelliJ and found that the following appears to work, at least for me. Hopefully may help someone out:-
1. Use the Java JDK that comes with WAS and not the standard Sun JDK (Set the JDK/JRE configuration to use <was_home>/java
2. Add the following JAR onto the Ant classpath:-
<was_home>/plugins/com.ibm.ws.runtime.jar
3. Add the JVM option "-Duser.install.root=/opt/was/profiles/<profile_name_here>
The above appears to work just fine for the basic <wsInstallApp> and <wsUninstallApp> custom Ant tasks.