java - Could not invoke method getObjectInstance on object of type com.ibm.ws.naming.urlns.genericURLContextFactory error on JNDI lookup -


do know why i'm getting exception ?

string url = "corbaloc:iiop:localhost:2809"; string initial = "com.ibm.websphere.naming.wsninitialcontextfactory"; string jndi = "ejblocal:my/ejb/periodobo";  hashtable<string, string> pdenv = new hashtable<string, string>(); pdenv.put("java.naming.provider.url", url); pdenv.put("java.naming.factory.initial", initial); context initialcontext = new initialcontext(pdenv);  try{     object ejbhome = initialcontext.lookup(jndi); // <-- here     object obj = portableremoteobject.narrow(ejbhome, periodobo.class); }catch(namingexception e){     system.err.println(e.tostring()); } 

i'm sure jndi ok, struggling (what's default jndi name of ejb in websphere application server 7 (was)?).

could me please?

this run configuration :

enter image description here

update, have got stack trace, i'm analyzing :

wscl0910i: initializing component: com.ibm.ws.websvcs.component.wasaxis2clientimpl wscl0911i: component initialized successfully. wscl0910i: initializing component: com.ibm.ejs.jms.jmsclientregistration wscl0911i: component initialized successfully. wscl0901i: component initialization completed successfully. wscl0035i: initialization of java ee application client environment has completed. wscl0014i: invoking application client class xxxxx.tests.alltests .[02/06/14 17:21:45:963 cot] 00000000  w uow=1-46884688-4040963:dmflores source=com.ibm.websphere.naming.genericurlinitialcontextfactory org=ibm prod=websphere component=application server thread=[p=704708:o=0:ct]           nmsv0907e: not invoke method "getobjectinstance" on object of type "com.ibm.ws.naming.urlns.genericurlcontextfactory". e. time: 0,011 there 1 error: 1) testcursosllevados(xxxxx.cursostest)javax.naming.configurationexception: not invoke method getobjectinstance on object of type com.ibm.ws.naming.urlns.genericurlcontextfactory. [root exception java.lang.reflect.invocationtargetexception]     @ com.ibm.websphere.naming.genericurlinitialcontextfactory.getandinvokemethod(genericurlinitialcontextfactory.java:480)     @ com.ibm.websphere.naming.genericurlcontextfactory.getobjectinstance(genericurlcontextfactory.java:165)     @ javax.naming.spi.namingmanager.geturlcontext(unknown source)     @ javax.naming.initialcontext.geturlordefaultinitctx(unknown source)     @ javax.naming.initialcontext.lookup(unknown source)     @ xxxxxxx.tests.cursostest.testcursosllevados(cursostest.java:59)     @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)     @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:45)     @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:37)     @ xxxxxx.tests.alltests.main(alltests.java:17)     @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)     @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:45)     @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:37)     @ com.ibm.ws.client.applicationclient.launchclient.createcontainerandlaunchapp(launchclient.java:797)     @ com.ibm.ws.client.applicationclient.launchclient.main(launchclient.java:502)     @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)     @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:45)     @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:37)     @ com.ibm.wsspi.bootstrap.wslauncher.launchmain(wslauncher.java:213)     @ com.ibm.wsspi.bootstrap.wslauncher.main(wslauncher.java:93)     @ com.ibm.wsspi.bootstrap.wslauncher.run(wslauncher.java:74)     @ org.eclipse.core.internal.runtime.platformactivator$1.run(platformactivator.java:78)     @ org.eclipse.core.runtime.internal.adaptor.eclipseapplauncher.runapplication(eclipseapplauncher.java:92)     @ org.eclipse.core.runtime.internal.adaptor.eclipseapplauncher.start(eclipseapplauncher.java:68)     @ org.eclipse.core.runtime.adaptor.eclipsestarter.run(eclipsestarter.java:400)     @ org.eclipse.core.runtime.adaptor.eclipsestarter.run(eclipsestarter.java:177)     @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)     @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:45)     @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:37)     @ org.eclipse.core.launcher.main.invokeframework(main.java:340)     @ org.eclipse.core.launcher.main.basicrun(main.java:282)     @ org.eclipse.core.launcher.main.run(main.java:981)     @ com.ibm.wsspi.bootstrap.wsprelauncher.launcheclipse(wsprelauncher.java:341)     @ com.ibm.wsspi.bootstrap.wsprelauncher.main(wsprelauncher.java:111) caused by: java.lang.reflect.invocationtargetexception     @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)     @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:45)     @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:37)     @ com.ibm.websphere.naming.genericurlinitialcontextfactory.getandinvokemethod(genericurlinitialcontextfactory.java:466)     ... 49 more caused by: javax.naming.configurationexception: there no name space     @ com.ibm.ws.naming.urlns.genericurlcontextfactory.isnamespaceaccessable(genericurlcontextfactory.java:96)     @ com.ibm.ws.naming.urlbase.urlcontextfactory.getobjectinstance(urlcontextfactory.java:84)     ... 54 more 

ejblocal:my/ejb/periodobo points local interface. local interface cannot accessed java ee application client. need remote interface.

add @remote correct interface bean. during app initialization find in systemout.log binding name interface bound in jndi. in initialcontext.lookup(jndi); use jndi name.

hope helps


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -