Hello !
I'm doing some tests to acces EJBs from the Tuscany, the Apache's SCA Runtime.
I would like to acces an ejb deployed in JBoss, from a pojo client, I am using the following code :
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", "jnp://127.0.0.1:1099"); properties.put("jnp.disableDiscovery", "true"); InitialContext jndiContext = new InitialContext(properties); // Get a reference to the VegetablesCatalogEJB Bean Object o = jndiContext.lookup("VegetablesCatalogEJB"); // Get a reference to the Bean's Home interface CatalogEJBHome home=(CatalogEJBHome)PortableRemoteObject.narrow(o, CatalogEJBHome.class);
corbaname:iiop:1.2@localhost:1050#VegetablesCatalogEJB
InitialContext context = new InitialContext(); Object o = context.lookup("corbaname:iiop:1.2@localhost:1050#VegetablesCatalogEJB"); CatalogEJBHome home = (CatalogEJBHome)PortableRemoteObject.narrow(o, CatalogEJBHome.class);