[jboss-user] [EJB 3.0] - Re: javax.naming.NotContextException

psyllogism do-not-reply at jboss.com
Wed Jun 6 14:38:46 EDT 2007


Yes, I am using EJB 3.0. I currently do not have an ejb-jar.xml file. I have not developed with EJBs before but I thought that EJB 3.0 does not need one?

The lookup code:
// Lookup the meta-agent
  | Properties p = new Properties();
  | p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
  | p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
  | p.put(Context.PROVIDER_URL, "jnp://" + m_hostName + ":" + m_serverPortNumber);
  | Context jndiContext = new InitialContext(p);
  | 
  | Object ref = jndiContext.lookup("MetaAgentImpl");
  | m_metaAgent = (MetaAgent) PortableRemoteObject.narrow(ref, MetaAgent.class);

The MetaAgent interface:
@Remote
  | public interface MetaAgent {
  | ...
  | }

The MetaAgent implementation:
@Stateful
  | public class MetaAgentImpl
  |     extends AbstractSessionAgent implements MetaAgent,
  |     Serializable {
  | ...
  | }

Thanks for looking!

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

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



More information about the jboss-user mailing list