I'm trying to get JBoss to use EJBs on other servers. I want to use a generic method to call all EJBs without deploying all EJB interfaces on the client. The interfaces should be loaded dynamically.
The jar files can be loaded within a class running in JBoss's Tomcat and I can obtain an instance of the Class object belonging to the EJBHome interface.
But how can I tell the InitialContext to use my custom ClassLoader for obtaining the interfaces. When I call
Hashtable props = new Hashtable();
props.put(InitialContext.PROVIDER_URL, "jnp://" + jnphost);
InitialContext context = new InitialContext(props);
home = context.lookup(jndiname);
the JNP NamingContextFactory does not look in the custom jar files and I get a ClassNotFoundException.
Is there a solution for this problem?