执行wsStopApp ant任务时出错无法实例化类com.ibm.ws.scripting.WasxShell

执行wsStopApp ant任务时出错无法实例化类com.ibm.ws.scripting.WasxShell,ant,classnotfoundexception,websphere-8,wsadmin,ibm-was,Ant,Classnotfoundexception,Websphere 8,Wsadmin,Ibm Was,我正在尝试执行webspherewsadmin脚本的wsstopappant脚本。代码如下: <target name="WAS_wsStopApp"> <property name="dep_var" value="was_home" /> <antcall target="depCheck" /> <property name="dep_var" value="was_appna

我正在尝试执行webspherewsadmin脚本的wsstopappant脚本。代码如下:

<target name="WAS_wsStopApp">
            <property name="dep_var" value="was_home" />
            <antcall target="depCheck" />
            <property name="dep_var" value="was_appname" />
            <antcall target="depCheck" />
            <taskdef name="wsStopApp" classname="com.ibm.websphere.ant.tasks.StopApplication" classpath="${was_cp}" />
            <echo message="Value of was_home is ${was_home} and classpath is ${was_cp}"/>
            <wsStopApp application="${was_appname}" user="${was_user}" password="${was_password}" failonerror="${was_failonerror}" washome="${was_home}" profileName="AppSrv03"/>
    </target>
我可以看到它在类路径中包含了所有给定的JAR。但是,在执行wsStopApp目标脚本后,出现以下错误:

[wsStopApp] profileHome=/opt/middleware/cloudapp/WebSphere/85-64/profiles/AppSrv03
[wsadmin] The IBM Class Sharing Adaptor will not work in this configuration.
[wsadmin] You are not running on a J9 Java VM.
[wsadmin] org.eclipse.core.runtime.CoreException: Plug-in "com.ibm.ws.admin.services" was unable to instantiate class com.ibm.ws.scripting.WasxShell".
[wsadmin]   at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
[wsadmin]   at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:188)
[wsadmin]   at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:904)
[wsadmin]   at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
[wsadmin]   at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
------
------
[wsadmin] Caused by: java.lang.NoClassDefFoundError: com/ibm/CORBA/iiop/ORB
[wsadmin]     at java.lang.Class.forName0(Native Method)
[wsadmin]     at java.lang.Class.forName(Class.java:190)
[wsadmin]     at com.ibm.ws.util.PlatformHelperFactory.getBackupHelper(PlatformHelperFactory.jav:123)
[wsadmin]     at com.ibm.ws.util.PlatformHelperFactory.getPlatformHelper(PlatformHelperFactory.java:89)
[wsadmin]     at com.ibm.ws.management.AdminHelper.getPlatformHelper(AdminHelper.java:139
[wsadmin]     at com.ibm.ws.scripting.AbstractShell.<init>(AbstractShell.java:240)
[wsadmin]     at com.ibm.ws.scripting.WasxShell.<init>(WasxShell.java:200)
[wsStopApp]profileHome=/opt/middleware/cloudapp/WebSphere/85-64/profiles/AppSrv03
[wsadmin]IBM类共享适配器在此配置中不工作。
[wsadmin]您没有在J9 Java虚拟机上运行。
[wsadmin]org.eclipse.core.runtime.CoreException:插件“com.ibm.ws.admin.services”无法实例化类com.ibm.ws.scripting.WasxShell”。
[wsadmin]位于org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throweException(RegistryStrategyOSGI.java:194)
[wsadmin]位于org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:188)
[wsadmin]位于org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:904)
[wsadmin]位于org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
[wsadmin]位于org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
------
------
[wsadmin]由以下原因引起:java.lang.NoClassDefFoundError:com/ibm/CORBA/iiop/ORB
[wsadmin]位于java.lang.Class.forName0(本机方法)
[wsadmin]位于java.lang.Class.forName(Class.java:190)
[wsadmin]位于com.ibm.ws.util.PlatformHelperFactory.getbackupulper(PlatformHelperFactory.jav:123)
[wsadmin]位于com.ibm.ws.util.PlatformHelperFactory.getPlatformHelper(PlatformHelperFactory.java:89)
[wsadmin]位于com.ibm.ws.management.AdminHelper.getPlatformHelper(AdminHelper.java:139
[wsadmin]位于com.ibm.ws.scripting.AbstractShell。(AbstractShell.java:240)
[wsadmin]位于com.ibm.ws.scripting.WasxShell.(WasxShell.java:200)

任何人都可以提供解决方案吗?我使用的Websphere版本是8.5。

您需要使用Websphere概要文件提供的
ws_ant.bat/sh
运行脚本。这对我很有用:

<?xml version="1.0" encoding="UTF-8"?>
<project name="proj" default="main">
        <taskdef name="wsStopApp" classname="com.ibm.websphere.ant.tasks.StopApplication"/>
        <target name="main">
            <wsStopApp application="TestAppEAR" user="wasadmin" password="password"/>
        </target>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project name="proj" default="main">
        <taskdef name="wsStopApp" classname="com.ibm.websphere.ant.tasks.StopApplication"/>
        <target name="main">
            <wsStopApp application="TestAppEAR" user="wasadmin" password="password"/>
        </target>
</project>
C:\IBM\WebSphere\AppServer85\profiles\AppSrv01\bin>ws_ant.bat -f stopAnt.xml

Buildfile: D:\workspacePWroc\AntTest\stopAnt.xml

main:
[wsStopApp] Stopping Application [TestAppEAR]...
  [wsadmin] WASX7209I: Connected to process "server1" on node node01 using
 SOAP connector;  The type of process is: UnManagedProcess
[wsStopApp] Stopped Application [TestAppEAR]

BUILD SUCCESSFUL
Total time: 8 seconds