2017-10-29 344 views
0

我正在使用Websphere应用程序server 8.5.5中的启动客户端来启动独立的java程序。它工作正常,默认classLoaderMode(PARENT_FIRST)。在websphere中运行launchclient与parent_last classloader模式8.5.5

但是,当我将其更改为PARENT_LAST并且未能初始化应用程序组件时。这是命令

>   File to launch   = C:\workspace\myapp.ear 
>   CC Property File  = null 
>   Client Jar File   = <default> 
>   Alternate DD   = null 
>   BootstrapHost   = localhost 
>   BootstrapPort   = 2809 
>   Trace enabled   = false 
>   Tracefile    = null 
>   Init only    = false 
>   Classpath Parameter  = myjar.jar 
>   Security Manager  = disable 
>   Security Manager Class = Not used. -CCsecurityManager=disable 
>   Security Manager Policy = Not used. -CCsecurityManager=disable 
>   Exit VM     = true 
>   Soap Connector Port  = null 
>   Application Parameters = --name abc 
>   Provider URL   = null 
>   Dump Java Name Space = long 
>   Admin Connector Host = null 
>   Admin Connector Port = null 
>   Admin Connector Type = null 
>   Admin Connector User = null 
>   PARENT_LAST mode  = true 

这里是例外:

WSCL0910I: Initializing component: com.ibm.ejs.jms.JMSClientRegistration WSCL0911I: Component initialized successfully. [10/28/17 19:41:10:901 EDT] 00000001 W UOW= source=com.ibm.websphere.naming.genericURLInitialContextFactory thread=[P=69444:O=0:CT] NMSV0907E: Could not invoke method "getObjectInstance" on object of type "com.ibm.ws.naming.urlns.genericURLContextFactory". [10/28/17 19:41:11:145 EDT] 00000001 W UOW=null source=com.ibm.ws.naming.util.CommonHelpers org=IBM prod=WebSphere component=Application Server thread=[P=69444:O=0:CT] NMSV0303E: Exception occurred in NamingManager.getURLContext for the scheme: "services". [10/28/17 19:41:11:169 EDT] 00000001 E UOW=null source=com.ibm.ws.activity.ActivityServiceClientComponentImpl org=IBM prod=WebSphere component=Application Server thread=[P=69444:O=0:CT] WACT0001E: The method start in class com.ibm.ws.activity.ActivityServiceClientComponentImpl received an unexpected exception; the exception stack trace follows: javax.naming.ConfigurationException: Could not invoke method getObjectInstance on object of type com.ibm.ws.naming.ur lns.genericURLContextFactory. [Root exception is java.lang.reflect.InvocationTargetException] at com.ibm.websphere.naming.genericURLInitialContextFactory.getAndInvokeMethod(genericURLInitialContextFactory.java:483) at com.ibm.websphere.naming.genericURLContextFactory.getObjectInstance(genericURLContextFactory.java:162) at javax.naming.spi.NamingManager.getURLContext(NamingManager.java:706) at com.ibm.ws.naming.util.CommonHelpers.getContextIfUrlName(CommonHelpers.java:477) at com.ibm.ws.naming.util.CommonHelpers.getContextIfUrlName(CommonHelpers.java:438) at com.ibm.websphere.naming.JndiHelper.recursiveBind(JndiHelper.java:503) at com.ibm.websphere.naming.JndiHelper.recursiveRebind(JndiHelper.java:391) at com.ibm.ws.activity.ActivityServiceClientComponentImpl.start(ActivityServiceClientComponentImpl.java:106) at com.ibm.ws.runtime.component.ContainerHelper.startComponents(ContainerHelper.java:540) at com.ibm.ws.runtime.component.ContainerImpl.startComponents(ContainerImpl.java:627) at com.ibm.ws.client.applicationclient.ClientComponentInitImpl.start(ClientComponentInitImpl.java:77) at com.ibm.ws.client.applicationclient.ClientContainer.startComponents(ClientContainer.java:1945) at com.ibm.ws.client.applicationclient.ClientContainer.init(ClientContainer.java:326) at com.ibm.ws.client.applicationclient.launchClient.createContainerAndLaunchApp(launchClient.java:749) at com.ibm.ws.client.applicationclient.launchClient.main(launchClient.java:495) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at com.ibm.wsspi.bootstrap.WSLauncher.launchMain(WSLauncher.java:234) at com.ibm.wsspi.bootstrap.WSLauncher.main(WSLauncher.java:96) at com.ibm.wsspi.bootstrap.WSLauncher.run(WSLauncher.java:77) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) com.ibm.ws.exception.RuntimeError: javax.naming.ConfigurationException: Could not invoke method getObjectInstance on object of type com.ibm.ws.naming.urlns.genericURLContextFactory. [Root exception is java.lang.reflect.InvocationTargetException] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:340) at org.eclipse.core.launcher.Main.basicRun(Main.java:282) at org.eclipse.core.launcher.Main.run(Main.java:981) at com.ibm.wsspi.bootstrap.WSPreLauncher.launchEclipse(WSPreLauncher.java:406) at com.ibm.wsspi.bootstrap.WSPreLauncher.main(WSPreLauncher.java:169) at com.ibm.websphere.client.applicationclient.launchClient.main(launchClient.java:246) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:611) at com.ibm.websphere.naming.genericURLInitialContextFactory.getAndInvokeMethod(genericURLInitialContextFactory.java:469) ... 41 more Caused by: javax.naming.ConfigurationException: There is no name space for the URL scheme "services". at com.ibm.ws.naming.urlns.genericURLContextFactory.isNameSpaceAccessable(genericURLContextFactory.java:99) at com.ibm.ws.naming.urlbase.UrlContextFactory.getObjectInstance(UrlContextFactory.java:85) ... 46 more

是什么导致IBM推出客户端加载并与PARENT_LAST类加载器模式失败了吗?我想知道它是否是一个Websphere应用程序Server 8.5.5。或者我只是不正确地运行它。

在此先感谢。

回答

0

我可以自己解决这个问题。问题是我不小心将websphere库包含在classpath中。它会导致websphere使用classpath来初始化我的客户端应用程序,并且无法查找jndi。为了使用PARENT_LAST模式运行launchclient,我必须删除classpath中的websphere jar文件。该过程正确启动并正确初始化,没有任何问题。

只要发布我在这里的方法,以防万一任何人有同样的问题。

相关问题