我正在尝试执行 webSphere wsadmin 脚本的 wsStopApp ant 脚本。代码如下:
<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>
所有属性都在属性文件中正确设置。由was_cp
ant 脚本设置如下
<path id="was.runtime">
<fileset dir="${was_home}/lib">
<include name="**/*.jar" />
</fileset>
<fileset dir="${was_home}/plugins">
<include name="**/*.jar" />
</fileset>
<fileset dir="${was_home}/java/jre/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<property name="was_cp" value="${toString:was.runtime}" />
我可以看到它在类路径中包含所有给定的 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)
有人可以提供解决方案吗?我使用的 Websphere 版本是 8.5。