Hello,
Is it possible to connect to retrieve a Hibernate session remotely?
I have a har deployed on Jboss. I know that is all configured correctly because I have successfully connect to it from jndi and use it from an ejb also deployed on the SAME Jboss server.
I am wondering if I can connect to the session factory from an application outside of the Jboss server and how?
This is what I have in the har:
Code:
<attribute name="SessionFactoryName">java:/foo/hibernate/SessionFactory</attribute>
I've been trying to look it up from a stand alone java application like this:
Code:
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
props.put(Context.PROVIDER_URL, "X.X.X.X:1099");
InitialContext ctx = new InitialContext(props);
ctx.lookup("java:/foo/hibernate/SessionFactory");
I get a name not bound exception.
Is this even possible to do?