[jboss-user] [EJB 3.0 Users] - Re: How to find Entity by Id

Fuchs do-not-reply at jboss.com
Tue Nov 17 06:28:52 EST 2009


I couldnt find a JNDIView where my CustomerHome is listed, so i took CustomerHome because of the console output where the ejbname is CustomerHome. 
Where could i proof the name of the jndi name for my CustomerHome?

I made a lookup in the client.

Context context = new InitialContext();
  | CustomerHome customer = (CustomerHome)context.lookup("CustomerHome");
  | customer.findById(1);	

And become the Error Message:
ERROR [JBossInjectionProvider] Injection failed on managed bean.
  | javax.naming.NameNotFoundException: de.counter.CounterBean not bound
  | 	at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
  | 
So I thought, jbossinjectionprovider doesnt know where the managedbean has to lookup. That way i gave it these properties.
Properties properties = new Properties();
  | properties.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
  | properties.put("java.naming.factory.url.pkgs","=org.jboss.naming:org.jnp.interfaces");
  | properties.put("java.naming.provider.url","localhost:1099");

Now, i am getting nothing. no error, no success message.
If i cancel my changes (the properties or give a other jndi name) it is always the same, no answers from the console.
Sorry, but that has completly confused me.



View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266039#4266039

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266039



More information about the jboss-user mailing list