-
1. Re: javax.naming.NameNotFoundException: comp not bound
peake Jan 11, 2005 9:54 AM (in response to peake)The Answer:
These are the properties:
-Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-Djava.naming.provider.url=jnp://JBOSS_HOST:1099/
-Djava.security.auth.login.config=login.conf
The login.conf file, pointed to by ?java.security.auth.login.config?, needs to contain:
jboss_client {
org.jboss.security.ClientLoginModule required;
};
Your remote application needs to authenticate before making any EJB (delegate) calls. This is the code:
LoginContext lc = new LoginContext( "jboss_client", new TextCallbackHandler() );
lc.login();
The TextCallbackHandler is an example that prompts for credentials from the console. Your app may instead opt to implement a custom callbackhandler that gets credentials by some other means?depends on requirements. -
2. Re: javax.naming.NameNotFoundException: comp not bound
wmprice Jan 11, 2005 10:36 AM (in response to peake)There is a reason for this:
the java:comp/env namespace is reserved for application components running in a managed environment. What this basically means is that each application component has its own private namespace bound to the context of
java:comp/env.
When running outside of the container, this does not work because the thin Java client does not have access to such a namespace. In this scenario, you would use the JNDI name directly, or develop an Application client that does have a java:comp/env namespace. -
3. Re: javax.naming.NameNotFoundException: comp not bound
anil.saldhana Jan 11, 2005 11:33 AM (in response to peake)Use the global JNDI namespace in JBoss. Don't bind to java:/