Hi, I'm new to Hibernate (and truth be told a Java novice as well). I'm trying to use Hibernate to connect to an existing database. I'm having trouble with DAO (tablenameHome.java files) that were generated automatically with the Hibernate Code generator in the Eclipse plugin from jboss.
Specifically, I don't seem to be able to create a session and get the tablenameHome.java to be able to see it.
Are there any examples online that specifically relate to using these objects?
Thanks in advance.
DEBUG JDBCTransaction:59 - current autocommit status: falsein10:17:56,632 DEBUG JDBCContext:214 - after transaction beginin10:17:56,648 ERROR AccrualHome:29 - Could not locate SessionFactory in JNDIinjavax.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.lookup(InitialContext.java:351)
at schema.AccrualHome.getSessionFactory(AccrualHome.java:27)
at schema.AccrualHome.<init>(AccrualHome.java:22)
at de.lal.example.TestClient.createAccrual(TestClient.java:111)
at de.lal.example.TestClient.main(TestClient.java:62)
Exception in thread "main" java.lang.IllegalStateException: Could not locate SessionFactory in JNDI
at schema.AccrualHome.getSessionFactory(AccrualHome.java:30)
at schema.AccrualHome.<init>(AccrualHome.java:22)
at de.lal.example.TestClient.createAccrual(TestClient.java:111)
at de.lal.example.TestClient.main(TestClient.java:62)
|