Problem with Remote Lookup in JBoss

Discussions

EJB design: Problem with Remote Lookup in JBoss

  1. Problem with Remote Lookup in JBoss (3 messages)

    I am trying to lookup JBoss ports through this client Program

    env.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
    env.put(Context.PROVIDER_URL,"jnp://localhost:1199");
    env.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interface");
    Context ctx = new InitialContext(env);
    NamingEnumeration bl=(NamingEnumeration)ctx.listBindings("");
    while(bl.hasMore()){
    Binding b=(Binding)bl.next();
    System.out.println(b.getName() + " Object is -> " + b.getObject());


    On Executing this i am getting Exception:::::

    javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1199 and discovery failed with error: java.security.AccessControlException: access denied (java.net.SocketPermission 230.0.0.4 connect,accept,resolve) [Root exception is javax.naming.CommunicationExcepti
    on: Failed to connect to server localhost:1199 [Root exception is java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:1199 connect,resolve)]]

    if anyone knows the answer then do let me no please

    Threaded Messages (3)

  2. url and policy file[ Go to top ]

    i think you should do two things:

    1. check for service running at the URL
    2. modify the policy file. by default this file gives full pemission but in your case it may have been changed.

    cheers,
    shrini
  3. Info Required[ Go to top ]

    Hi Srini
    thanks for your feedback
    Can you please tell me which is the policy file for JBoss and where it is located

    thanks and regards
    Deep Singh
  4. use installed JRE policy file.[ Go to top ]

    Hi Deep,

    Well JBoss need not have its own policy file. It can use the default file of installed JRE which is found at %JRE_HOME%\jre\lib\security\java.policy.

    If you want to override it, you can define your own policy file. Please refer java giude for that purpose.

    cheers,
    shrini