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

Hibernate JIRA | abe zafar | 1 decade ago
  1. 0

    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?

    Hibernate JIRA | 1 decade ago | abe zafar
    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
  2. 0

    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?

    Hibernate JIRA | 1 decade ago | abe zafar
    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
  3. 0

    Hibernate Community • View topic - javax.naming.NoInitialContextException

    hibernate.org | 8 months ago
    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
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hibernate: Could not bind factory to JNDI

    com.br | 1 year ago
    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
  6. 0

    How can I fix JndiException on hibernate?

    Stack Overflow | 2 years ago | lrn2java
    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

    12 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. 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

      at javax.naming.spi.NamingManager.getInitialContext()
    2. Java RT
      InitialContext.getNameParser
      1. javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:640)
      2. javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
      3. javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:280)
      4. javax.naming.InitialContext.getNameParser(InitialContext.java:429)
      4 frames
    3. net.sf.hibernate
      Configuration.buildSessionFactory
      1. net.sf.hibernate.util.NamingHelper.bind(NamingHelper.java:52)
      2. net.sf.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90)
      3. net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:282)
      4. net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:618)
      4 frames
    4. com.rhi.mjq
      PersonDaoTest.testfindByLastName
      1. com.rhi.mjq.dataaccess.HbSessionHelper.<clinit>(HbSessionHelper.java:28)
      2. com.rhi.mjq.dataaccess.dao.PersonDao.findByLastName(PersonDao.java:36)
      3. com.rhi.mjq.dataaccess.dao.PersonDaoTest.testfindByLastName(PersonDaoTest.java:30)
      3 frames
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:324)
      4 frames
    6. JUnit
      TestSuite.run
      1. junit.framework.TestCase.runTest(TestCase.java:154)
      2. junit.framework.TestCase.runBare(TestCase.java:127)
      3. junit.framework.TestResult$1.protect(TestResult.java:106)
      4. junit.framework.TestResult.runProtected(TestResult.java:124)
      5. junit.framework.TestResult.run(TestResult.java:109)
      6. junit.framework.TestCase.run(TestCase.java:118)
      7. junit.framework.TestSuite.runTest(TestSuite.java:208)
      8. junit.framework.TestSuite.run(TestSuite.java:203)
      8 frames