Hi all,
I get error "javax.naming.NameNotFoundException: HibernateFactory not bound" when run to this statement:
Code:
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
InitialContext ctx = new InitialContext(env);
SessionFactory sessionFactory = (SessionFactory)ctx.lookup("java:HibernateFactory");
But when I deploy jboss-service.xml, JBoss console gave me feedback:
Code:
...
12:59:44,351 INFO [SessionFactoryImpl] building session factory
12:59:44,351 WARN [Configurator] No configuration found. Configuring ehcache fr
om ehcache-failsafe.xml found in the classpath: jar:file:/C:/jboss-4.0.2/server/
default/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
12:59:44,382 INFO [SessionFactoryObjectFactory] Factory name: java:HibernateFac
tory
12:59:44,382 INFO [NamingHelper] JNDI InitialContext properties:{}
12:59:44,382 INFO [SessionFactoryObjectFactory] Bound factory to JNDI name: jav
a:HibernateFactory
12:59:44,382 WARN [SessionFactoryObjectFactory] InitialContext did not implemen
t EventContext
12:59:44,382 INFO [NamingHelper] JNDI InitialContext properties:{}
12:59:44,398 INFO [SessionFactoryImpl] Checking 0 named queries
It seems for me that the service is started already.
I tried it in a two tier environment only. That means I just lookup the context outside the EJB Container. Isn't it wrong operation?
Thank you very much.
--
Best regards,
Diviner.