Results 1 to 2 of 2

Thread: Rmi

  1. #1
    flanjl2 is offline Member
    Join Date
    Aug 2011
    Posts
    21
    Rep Power
    0

    Default Rmi

    APPCLIENT non responsive after the deployment and execution of the following(have resolved all previous exceptions):

    package JVA.remote;

    import java.util.*; import java.rmi.*; import javax.ejb.spi.*; import javax.*; import javax.ejb.embeddable.EJBContainer; import javax.naming.*; import javax.ejb.*;
    import javax.naming.Context;
    import javax.naming.InitialContext;


    public class MainRemote {

    public static Context ctx;
    public static BookEJB bookejb;

    public static void main(String[] args) {
    Book book= new Book();

    System.setProperty("java.security.policy", "client.policy");
    if (System.getSecurityManager() == null)
    System.setSecurityManager(new RMISecurityManager());

    Properties env = new Properties();
    env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
    env.setProperty("java.naming.provider.url", "localhost:1527");
    env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
    env.setProperty("java.security","AllPermission");

    Hashtable envHash = new Hashtable();
    envHash.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
    envHash.put(Context.PROVIDER_URL, "localhost:1527");
    envHash.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" );

    Map<String, Object> properties= new HashMap<String, Object>();
    properties.put("ejb3Container", EJBContainer.APP_NAME);
    properties.put("java:global/EJBContainerProvider",EJBContainer.PROVIDER);

    try {
    ctx= new InitialContext(envHash);
    bookejb= (BookEJB)ctx.lookup("java:global/MainRemote-1.0/BookEJB");;
    }
    catch(NamingException ne) {
    System.out.println(ne+"...");
    }

    bookejb.createBook(book);

    System.out.println("Terminating Program...");
    System.exit(0);



    }

    }

  2. #2
    flanjl2 is offline Member
    Join Date
    Aug 2011
    Posts
    21
    Rep Power
    0

    Default Re: Rmi

    still having difficulties here. Have appended jnp to the database location :jnp://localhost:1527....... and have tried many other variations of this look-up. NSL.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •