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

AppFuse JIRA | Hassen BEN SLIMA | 7 years ago
  1. 0

    Hi,All I create inheritance relationship entitys : @Entity(name="piece_achat") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name="type",discriminatorType = DiscriminatorType.STRING, length = 1) @DiscriminatorValue(value="G") public class PieceAchat extends BaseObject { ........................................ } @Entity @DiscriminatorValue("C") public class BonCommande extends PieceAchat { private static final long serialVersionUID = -4273404022092747726L; public BonCommande() { super(); } } I am getting the following error on running the 'mvn est' command : WARN - SessionFactoryObjectFactory.removeInstance(123) | Could not unbind factory from 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:288) at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325) at javax.naming.InitialContext.unbind(InitialContext.java:416) at org.hibernate.impl.SessionFactoryObjectFactory.removeInstance(SessionFactoryObjectFactory.java:116) at org.hibernate.impl.SessionFactoryImpl.close(SessionFactoryImpl.java:806) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.destroy(AbstractSessionFactoryBean.java:251) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.destroy(LocalSessionFactoryBean.java:865) at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:151) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:453) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:431) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:404) at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:854) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:832) at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:765) Any ideas how to fix this?

    AppFuse JIRA | 7 years ago | Hassen BEN SLIMA
    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
  2. 0

    Hi,All I create inheritance relationship entitys : @Entity(name="piece_achat") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name="type",discriminatorType = DiscriminatorType.STRING, length = 1) @DiscriminatorValue(value="G") public class PieceAchat extends BaseObject { ........................................ } @Entity @DiscriminatorValue("C") public class BonCommande extends PieceAchat { private static final long serialVersionUID = -4273404022092747726L; public BonCommande() { super(); } } I am getting the following error on running the 'mvn est' command : WARN - SessionFactoryObjectFactory.removeInstance(123) | Could not unbind factory from 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:288) at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325) at javax.naming.InitialContext.unbind(InitialContext.java:416) at org.hibernate.impl.SessionFactoryObjectFactory.removeInstance(SessionFactoryObjectFactory.java:116) at org.hibernate.impl.SessionFactoryImpl.close(SessionFactoryImpl.java:806) at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.destroy(AbstractSessionFactoryBean.java:251) at org.springframework.orm.hibernate3.LocalSessionFactoryBean.destroy(LocalSessionFactoryBean.java:865) at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:151) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:453) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:431) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:404) at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:854) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:832) at org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:765) Any ideas how to fix this?

    AppFuse JIRA | 7 years ago | Hassen BEN SLIMA
    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
  3. 0

    JBoss Hibernate conflict with SessionFactory and JNDI

    Stack Overflow | 5 years ago | user1171773
    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

    javax.naming.NoInitialContextException: Need to specify class name in environment or system property

    Stack Overflow | 2 months ago | MarwenBta
    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

    javax.naming.NoInitialContextException

    Stack Overflow | 2 months ago | MarwenBta
    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

    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 system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial

      at javax.naming.spi.NamingManager.getInitialContext()
    2. Java RT
      InitialContext.unbind
      1. javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
      2. javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
      3. javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
      4. javax.naming.InitialContext.unbind(InitialContext.java:416)
      4 frames
    3. Hibernate
      SessionFactoryImpl.close
      1. org.hibernate.impl.SessionFactoryObjectFactory.removeInstance(SessionFactoryObjectFactory.java:116)
      2. org.hibernate.impl.SessionFactoryImpl.close(SessionFactoryImpl.java:806)
      2 frames
    4. Hibernate
      LocalSessionFactoryBean.destroy
      1. org.springframework.orm.hibernate3.AbstractSessionFactoryBean.destroy(AbstractSessionFactoryBean.java:251)
      2. org.springframework.orm.hibernate3.LocalSessionFactoryBean.destroy(LocalSessionFactoryBean.java:865)
      2 frames
    5. Spring Beans
      DefaultSingletonBeanRegistry.destroySingletons
      1. org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:151)
      2. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:453)
      3. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:431)
      4. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:404)
      4 frames
    6. Spring Context
      AbstractApplicationContext$1.run
      1. org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:854)
      2. org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:832)
      3. org.springframework.context.support.AbstractApplicationContext$1.run(AbstractApplicationContext.java:765)
      3 frames