Deployment 使用Ant将EAR部署到远程websphereapplicationserver
我想在我们的持续集成服务器中自动将EAR文件构建部署到websphere application server。我查找了Ant任务Deployment 使用Ant将EAR部署到远程websphereapplicationserver,deployment,ant,websphere,Deployment,Ant,Websphere,我想在我们的持续集成服务器中自动将EAR文件构建部署到websphere application server。我查找了Ant任务wsdeploy,但它实际上一点帮助都没有。我在ant脚本中添加了以下内容: wsdeployant任务 <classpath> <fileset dir="${dir.was.plugins}"> <include name="**/*.jar" /> </fileset> </c
wsdeploy
,但它实际上一点帮助都没有。我在ant脚本中添加了以下内容:
wsdeployant任务
<classpath>
<fileset dir="${dir.was.plugins}">
<include name="**/*.jar" />
</fileset>
</classpath>
<taskdef name="wsdeploy" classname="com.ibm.websphere.ant.tasks.WSDeploy" />
<target name="deploy">
<wsdeploy inputFile="myearfile.ear"
outputFile="myearfile_fordeployment.ear"
classpath="${classpath}"
debug="true"
ignoreErrors="false"
noValidate="false"
trace="true" />
</target>
我想用EXPECTEDPROFILE
运行所有这些,但下面的错误消息表明,涉及另一个配置文件UNEXPECTEDPROFILE
输出:
wasListApps:
[wsadmin] WASX7023E: Fehler beim Erstellen der "SOAP"-Verbindung zu "MYHOST". Informationen zur Ausnahme: com.ibm.websphere.management.exception.ConnectorNotAvailableException: com.ibm.websphere.management.exception.ConnectorNotAvailableException: ADMC0016E: Das System kann keinen SOAP-Connector erstellen, um die Verbindung zum Host MYHOST an Port MYPORT herzustellen.
[wsadmin] WASX7213I: Dieser Script-Client ist mit keinem Serverprozess verbunden. Pr?fen Sie, ob in der Protokolldatei /PATH/TO/UNEXPECTEDT/PROFILE/logs\wsadmin.traceout n?here Einzelheiten enthalten sind.
[wsadmin] WASX8011W: Das AdminTask-Objekt ist nicht verfügbar.
[wsadmin] WASX7015E: Beim Ausf?hren des Befehls "$AdminApp list" ist eine Ausnahme eingetreten. Informationen zur Ausnahme:
[wsadmin] com.ibm.ws.scripting.ScriptingException: WASX7206W: Der Application Management Service ist nicht aktiv. Die Befehle f?r die Anwendungsverwaltung k?nnen nicht ausgef?hrt werden.
[wsadmin] Java Result: 103
更新1
使用wsinstallapp
阅读后,我尝试使用wsinstallapp
安装具有以下Ant目标的应用程序:
<taskdef name="wsInstallApp" classname="com.ibm.websphere.ant.tasks.InstallApplication" classpath="${dir.was.plugins}/com.ibm.ws.runtime_6.1.0.jar" />
<target name="deploy" depends="EAR">
<wsInstallApp
wasHome="${WAS_HOME}"
ear="MYAPPLICATION.ear"
options=""
properties=""
profile=""
conntype="SOAP"
host="${TargetServer}"
port="${TargetPort}"
user="${TargetUser}"
password="${TargetPwd}"
failonerror="true" />
</target>
我不知道为什么任务要搜索Eclipse类…我相信实际将EAR部署到远程Websphere的ant任务是
wsInstallApp
感谢您指向此任务。不幸的是,文档是。。。我还有另一个问题,但我将把它添加到我的Q中,而不是作为注释发布在这里。虽然这不能解释eclipse classnotfound-这里是一个真实的示例:。此URL和其他URL建议必须首先传入“配置文件”。你有没有这样做过?没有,实际上我们使用的是Ant(用SCP任务复制EAR)和运行在服务器机器上的jython脚本的混合体。jython由wsadmin加载,我们在节点/服务器上安装了服务器本地EAR文件。您必须在SCP任务完成后手动运行脚本,或者构建服务器是否位于具有WAS的计算机上?我觉得很可笑,我们不能从构建服务器进行自动部署。不,我们将EAR工件和jython脚本scp到WAS服务器,然后从那里执行wsadmin。事实上,jython脚本是基于这个异常的例子的,这个异常是由类路径中缺少2个jar文件引起的/deploytool/itp/batch2.jar&/deploytool/itp/batchboot.jar
<taskdef name="wsInstallApp" classname="com.ibm.websphere.ant.tasks.InstallApplication" classpath="${dir.was.plugins}/com.ibm.ws.runtime_6.1.0.jar" />
<target name="deploy" depends="EAR">
<wsInstallApp
wasHome="${WAS_HOME}"
ear="MYAPPLICATION.ear"
options=""
properties=""
profile=""
conntype="SOAP"
host="${TargetServer}"
port="${TargetPort}"
user="${TargetUser}"
password="${TargetPwd}"
failonerror="true" />
</target>
deploy:
[wsInstallApp] Anwendung wird installiert [/path/to/MYAPPLICATION.ear]...
[wsadmin] Exception in thread "main" java.lang.NoClassDefFoundError: org.eclipse.core.launcher.Main
[wsadmin] at com.ibm.wsspi.bootstrap.WSPreLauncher.launchEclipse(WSPreLauncher.java:335)
[wsadmin] at com.ibm.wsspi.bootstrap.WSPreLauncher.main(WSPreLauncher.java:91)
[wsadmin] Caused by: java.lang.ClassNotFoundException: org.eclipse.core.launcher.Main
[wsadmin] at java.net.URLClassLoader.findClass(URLClassLoader.java:496)
[wsadmin] at java.lang.ClassLoader.loadClass(ClassLoader.java:631)
[wsadmin] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
[wsadmin] at java.lang.ClassLoader.loadClass(ClassLoader.java:597)
[wsadmin] ... 2 more
<taskdef name="wsInstallApp" classname="com.ibm.websphere.ant.tasks.InstallApplication"/>
<wsInstallApp
wasHome="location of websphere installation"
ear="the ear file you wish to install"
options="the options to pass to the installation process"
properties="java properties file containing attributes to set in the JVM System properties"
profile="a script file to be executed before the main command or file"
conntype="specifies the type of connection to be used."
host="the host to connect to"
port="the port on the host to connect to"
user="user ID to authenticate with"
password="password to authenticate with"
failonerror="true | false"/>