javax.naming.NoInitialContextException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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?
    via by Hassen BEN SLIMA,
  • 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?
    via by Hassen BEN SLIMA,
  • javax.naming.NoInitialContextException
    via Stack Overflow by MarwenBta
    ,
  • Failed to config warp-persist for junit test
    via by Hubert Yang,
    • 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)

    Users with the same issue

    ivanszkypeter
    2 times, last one,
    Andreas Häber
    2 times, last one,
    marcbouvierdav
    6 times, last one,
    andyglick
    1 times, last one,
    davidvanlaatum
    176 times, last one,
    51 more bugmates