Hi all,
I'm new to Hibernate. Everything is working quite fine. However, I always get a warning I would like to fix.
When calling buildSessionFactory(), I always get this warning:
Code:
15:19:43,451 WARN SessionFactoryObjectFactory:98 - Could not bind factory to JNDI
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
at javax.naming.InitialContext.getNameParser(InitialContext.java:439)
at org.hibernate.util.NamingHelper.bind(NamingHelper.java:52)
at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:306)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at com.ruag.panther.missionservice.provider.persistence.internal.HibernateManager$1.run(HibernateManager.java:74)
We do not use any application server. It is an application based on OSGi (Equinox). I guess we have no JNDI context registered. Actually, we do not need one. And using
hibernate.connection.url works well (I have not set
hibernate.connection.datasource).
Is JNDI really needed? Is it possible to tell Hibernate to skip all these JNDI things? Should I set a "dummy" context somewhere?
Thank you