Message:
The following issue has been closed.
Resolver: Christian Bauer
Date: Wed, 13 Aug 2003 1:45 PM
Read the documentation. Just ommit the "name" of the sessionfactory in your configuration.xml or properties and Hibernate won't try to bind it to a JNDI name.
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-257
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-257
Summary: There isn't a way to tell Hibernate not to bind to a jndi name
Type: Bug
Status: Closed
Priority: Major
Resolution: REJECTED
Project: Hibernate2
Assignee:
Reporter: abe zafar
Created: Wed, 13 Aug 2003 1:35 PM
Updated: Wed, 13 Aug 2003 1:45 PM
Environment: JDK1.4
Description:
When running junit tests outside an application server I can't bind the session factory to a jndi name, for that reason I got the following exception:
[junit] 2003-08-13 10:06:52,687 INFO net.sf.hibernate.impl.SessionFactoryImpl - echoing all SQL
to stdout
[junit] 2003-08-13 10:06:54,234 INFO net.sf.hibernate.impl.SessionFactoryObjectFactory - Factor
y name: java:comp/env/hibernate/SessionFactory
[junit] 2003-08-13 10:06:54,234 INFO net.sf.hibernate.util.NamingHelper - JNDI InitialContext p
roperties:{}
[junit] 2003-08-13 10:06:54,265 WARN net.sf.hibernate.impl.SessionFactoryObjectFactory - Could
not bind factory to JNDI
[junit] javax.naming.NoInitialContextException: Need to specify class name in environment or sys
tem property, or as an applet parameter, or in an application resource file: java.naming.factory.in
itial
[junit] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:640)
[junit] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
[junit] at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:280)
[junit] at javax.naming.InitialContext.getNameParser(InitialContext.java:429)
[junit] at net.sf.hibernate.util.NamingHelper.bind(NamingHelper.java:52)
[junit] at net.sf.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjec
tFactory.java:90)
[junit] at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:282)
[junit] at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:618)
[junit] at com.rhi.mjq.dataaccess.HbSessionHelper.<clinit>(HbSessionHelper.java:28)
[junit] at com.rhi.mjq.dataaccess.dao.PersonDao.findByLastName(PersonDao.java:36)
[junit] at com.rhi.mjq.dataaccess.dao.PersonDaoTest.testfindByLastName(PersonDaoTest.java:30
)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
:25)
[junit] at java.lang.reflect.Method.invoke(Method.java:324)
[junit] at junit.framework.TestCase.runTest(TestCase.java:154)
[junit] at junit.framework.TestCase.runBare(TestCase.java:127)
[junit] at junit.framework.TestResult$1.protect(TestResult.java:106)
[junit] at junit.framework.TestResult.runProtected(TestResult.java:124)
[junit] at junit.framework.TestResult.run(TestResult.java:109)
[junit] at junit.framework.TestCase.run(TestCase.java:118)
[junit] at junit.framework.TestSuite.runTest(TestSuite.java:208)
[junit] at junit.framework.TestSuite.run(TestSuite.java:203)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.
java:325)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner
How can this be resolved?
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|