A robust starter web application to ease Java webapp development.

Home | Tutorials | Demos | Issues

Inheritance Error

View: New views
1 Messages — Rating Filter:   Alert me  

Inheritance Error

by hassen () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 test' 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?