View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3820750#3820750
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3820750 Kasper: I have been using EJBs and I can call them from any server I want. Here is what I did to call them from a specific server. I have left all the cluster setting the default, my ejb-jar and jboss xml files, use the defaults, I am also using the full version of clustering, using the all server directory, with the farm as my cluster deploy directory. Our network king, set it up and is using the apache JK?mod for the session managment. Hope this helps, you sure helped me "jnp://" ! Six small characters, but they made it work! // show message on the server that is used,, this will help to show us how the // clustering is working, should see this message on all servers if round-robin // is used and this sevlet is called repeatedly. System.err.println("[FYI] - The cluster test servlet was initialized on this server"); int days=0; //dateofhire is passed into this as a valid date, it is used to calculate the days employeed try { 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"); // to lookup on all servers, if apps2 goes down, it will lookup on apps3. //p.put(Context.PROVIDER_URL,"jnp://apps2:1100,jnp://apps3:1100"); // to lookup on a specific server, not recommended as this does not make use // of the clustering (unless you have different groups of server that serve different // functions, and then you would still lookup on more than 1) p.put(Context.PROVIDER_URL,"jnp://apps3:1100"); InitialContext jndiContext = new InitialContext(p); Object ref = jndiContext.lookup("java:comp/env/ejb/employee"); empHome = (employeeHome) PortableRemoteObject.narrow(ref, employeeHome.class); employeeRemote bean = empHome.create(); bean.setdaysEmployeed(dateofhire); days=bean.getdaysEmployeed(); bean.remove(); System.err.println("Days employed = " + days); } catch(Exception e) { throw new ServletException("Failed due to : ", e); } } ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user