[jboss-user] [EJB3] - Re: lookup for remote bean - failure (only from eclipse)

JN JNC do-not-reply at jboss.com
Wed Jan 23 04:31:04 EST 2013


JN JNC [https://community.jboss.org/people/jnjnc] created the discussion

"Re: lookup for remote bean - failure (only from eclipse)"

To view the discussion, visit: https://community.jboss.org/message/793718#793718

--------------------------------------------------------------
Hi,

I got exactly same issue when running same kind of remote EJB lookup from a unit test or from a simple java client with classpath corretcly setup to include JBOSS_HOME/client/jbossall-client.jar.






##
  10:24:11,528 INFO [ServerImpl] Starting JBoss (Microcontainer)...
10:24:11,528 INFO [ServerImpl] Release ID: JBoss [The Oracle] 5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)


**public** **static** **void** main(String[] args) **throws** NamingException {

Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
properties.put(Context.URL_PKG_PREFIXES, "org.jboss.naming.client");
properties.put(Context.PROVIDER_URL, "localhost:1099");
context = new InitialContext(properties);
Object bean = context.lookup("my-app-ear-name/myBean/remote");

}

Exception in thread "main" javax.naming.NamingException: Could not dereference object [Root exception is java.lang.RuntimeException: ...
        at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1504)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:822)
        at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
        at javax.naming.InitialContext.lookup(InitialContext.java:392)
....
Caused by: java.lang.RuntimeException: Exception while trying to locate proxy factory in JNDI, at key ProxyFactory/....
        at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getProxyFactoryFromJNDI(ProxyObjectFactory.java:
        at org.jboss.ejb3.proxy.impl.objectfactory.ProxyObjectFactory.getObjectInstance(ProxyObjectFactory.java:157)
        at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
        at org.jnp.interfaces.NamingContext.getObjectInstance(NamingContext.java:1479)
        at org.jnp.interfaces.NamingContext.getObjectInstanceWrapFailure(NamingContext.java:1496)
        ... 4 more
Caused by: javax.naming.NameNotFoundException: ProxyFactory not bound
        at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
        at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
        at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
        at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

A wrong classpath setup would give

Exception in thread "main" javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [
aces.NamingContextFactory]
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657)
        at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
        at javax.naming.InitialContext.init(InitialContext.java:223)
        at javax.naming.InitialContext.<init>(InitialContext.java:197)
        at com.temenos.tafj.tools.jmsinjector.EJBRemoteInvoker.main(EJBRemoteInvoker.java:23)
Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory

Do you have any suggestion ?

Thanks and regards.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/793718#793718]

Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130123/62034a3a/attachment.html 


More information about the jboss-user mailing list