Announcement Announcement Module
Collapse
No announcement yet.
java.lang.IllegalStateException: No supertype found Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • java.lang.IllegalStateException: No supertype found

    Hi there.When i try to set up my spring data jpa demo followed the example from spring-data-jpa-showcase, i got an exception "java.lang.IllegalStateException: No supertype found".But if i add a jpa entity in model package ,the exception will disappear.Do any experts can help me out of this difficulty.

    ------------------------------------------------------------------------

    ------------------------------------------------------------------------
    java.lang.IllegalStateException: Failed to load ApplicationContext
    at org.springframework.test.context.TestContext.getAp plicationContext(TestContext.java:308)
    at org.springframework.test.context.support.Dependenc yInjectionTestExecutionListener.injectDependencies (DependencyInjectionTestExecutionListener.java:109 )
    at org.springframework.test.context.support.Dependenc yInjectionTestExecutionListener.prepareTestInstanc e(DependencyInjectionTestExecutionListener.java:75 )
    at org.springframework.test.context.TestContextManage r.prepareTestInstance(TestContextManager.java:321)
    at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.createTest(SpringJUnit4ClassRunner.j ava:211)
    at org.springframework.test.context.junit4.SpringJUni t4ClassRunner$1.runReflectiveCall(SpringJUnit4Clas sRunner.java:287)
    at org.junit.internal.runners.model.ReflectiveCallabl e.run(ReflectiveCallable.java:15)
    at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.methodBlock(SpringJUnit4ClassRunner. java:289)
    at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.runChild(SpringJUnit4ClassRunner.jav a:231)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild( BlockJUnit4ClassRunner.java:49)
    at org.junit.runners.ParentRunner$3.run(ParentRunner. java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRu nner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentR unner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRu nner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRu nner.java:184)
    at org.springframework.test.context.junit4.statements .RunBeforeTestClassCallbacks.evaluate(RunBeforeTes tClassCallbacks.java:61)
    at org.springframework.test.context.junit4.statements .RunAfterTestClassCallbacks.evaluate(RunAfterTestC lassCallbacks.java:70)
    at org.junit.runners.ParentRunner.run(ParentRunner.ja va:236)
    at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.run(SpringJUnit4ClassRunner.java:174 )
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestR eference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecutio n.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRu nner.main(RemoteTestRunner.java:197)
    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'enquiryRepository': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: No supertype found
    at org.springframework.beans.factory.support.FactoryB eanRegistrySupport.doGetObjectFromFactoryBean(Fact oryBeanRegistrySupport.java:149)
    at org.springframework.beans.factory.support.FactoryB eanRegistrySupport.getObjectFromFactoryBean(Factor yBeanRegistrySupport.java:102)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getObjectForBeanInstance(AbstractBeanF actory.java:1440)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:304 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:192)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:585)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:425)
    at org.springframework.test.context.support.AbstractG enericContextLoader.loadContext(AbstractGenericCon textLoader.java:84)
    at org.springframework.test.context.support.AbstractG enericContextLoader.loadContext(AbstractGenericCon textLoader.java:1)
    at org.springframework.test.context.TestContext.loadA pplicationContext(TestContext.java:280)
    at org.springframework.test.context.TestContext.getAp plicationContext(TestContext.java:304)
    ... 24 more
    Caused by: java.lang.IllegalStateException: No supertype found
    at org.hibernate.ejb.metamodel.AbstractIdentifiableTy pe.requireSupertype(AbstractIdentifiableType.java: 85)
    at org.hibernate.ejb.metamodel.AbstractIdentifiableTy pe.getIdType(AbstractIdentifiableType.java:173)
    at org.hibernate.ejb.metamodel.AbstractIdentifiableTy pe.getIdType(AbstractIdentifiableType.java:173)
    at org.springframework.data.jpa.repository.support.Jp aMetamodelEntityInformation.<init>(JpaMetamodelEnt ityInformation.java:58)
    at org.springframework.data.jpa.repository.support.Jp aPersistableEntityInformation.<init>(JpaPersistabl eEntityInformation.java:40)
    at org.springframework.data.jpa.repository.support.Jp aEntityInformationSupport.getMetadata(JpaEntityInf ormationSupport.java:59)
    at org.springframework.data.jpa.repository.support.Jp aRepositoryFactory.getEntityInformation(JpaReposit oryFactory.java:145)
    at org.springframework.data.jpa.repository.support.Jp aRepositoryFactory.getTargetRepository(JpaReposito ryFactory.java:83)
    at org.springframework.data.jpa.repository.support.Jp aRepositoryFactory.getTargetRepository(JpaReposito ryFactory.java:66)
    at org.springframework.data.repository.core.support.R epositoryFactorySupport.getRepository(RepositoryFa ctorySupport.java:146)
    at org.springframework.data.repository.core.support.R epositoryFactoryBeanSupport.getObject(RepositoryFa ctoryBeanSupport.java:120)
    at org.springframework.data.repository.core.support.R epositoryFactoryBeanSupport.getObject(RepositoryFa ctoryBeanSupport.java:39)
    at org.springframework.beans.factory.support.FactoryB eanRegistrySupport.doGetObjectFromFactoryBean(Fact oryBeanRegistrySupport.java:142)
    ... 35 more
    Last edited by chase; Jan 20th, 2012, 01:01 AM.

  • #2
    I have figured out that.the problem is the entity extend AbstractPersistable. This class has id setter.
    Last edited by chase; Jan 20th, 2012, 03:43 AM.

    Comment

    Working...
    X