[jboss-user] Re: org.hibernate.AnnotationException: No identifier specified f

samk at twinix.com samk at twinix.com
Fri Jul 11 11:48:04 EDT 2008


See Thread at: http://www.techienuggets.com/Detail?tx=21231 Posted on behalf of a User


Hi i am getting this problem can u pls tell me what to do?

thanks a lot..

org.hibernate.AnnotationException: No identifier specified for entity: com.ge.corporate.taxes.fin48.model.TerminateReserve
	at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:627)
	at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:452)
	at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:268)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1283)
	at com.ge.corporate.taxes.fin48.service.Fin48HibernateSessionFactory.currentSession(Fin48HibernateSessionFactory.java:50)
	at com.ge.corporate.taxes.fin48.service.RightService.getById(RightService.java:47)
	at com.ge.corporate.taxes.fin48.service.RightServiceTest.getById(RightServiceTest.java:21)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
	at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
	at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
	at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
	at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
	at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
	at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
	at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
	at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
	at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
	at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
	at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


In Response To: 

First things first ... the exception is very clear .... however, I really believe that I have specified an @Id - but it's obviously not being recognized/located in the superclass.  What am I missing or doing wrong?  I'm using JBoss AS 4.2.1.GA with it's included hibernate version.

Please forgive the beginner question, but I've been searching for hours and keep coming up with the same Incomplete deployment error:  

org.hibernate.AnnotationException: No identifier specified for entity: x.y.z.DefaultMyEvent

I'd appreciate any and all help as I am stuck!

TIA!


I have a base class such as:


  | @MappedSuperclass
  | public class DefaultEventBase
  |     implements IEventBase, Serializable
  | {
  | 
  | .....
  |     @Id
  |     @Column( name="ID", unique=true, nullable=false, updatable=false )
  |     public String getID()
  |     {
  | 	return id_;
  |     }
  | 
  | 
  | .......
  | }
  | 
  | 


and a derived class such as:


  | 
  | @Entity
  | @Table( name="EVENTS", schema="foo",
  | 	uniqueConstraints={@UniqueConstraint( columnNames="ID" )})
  | public class DefaultMyEvent
  |     extends DefaultEventBase
  |     implements ISMSEvent, Serializable
  | {
  | 
  | ..... all other @Column definitions are here
  | 
  | }
  | 

I have a persistence.xml such as:


  | 
  | <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0"
  |   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  |   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
  |   
  |   <persistence-unit name = "foobar"
  |   				    transaction-type = "JTA">
  |   		
  | 	  <provider>org.hibernate.ejb.HibernatePersistence</provider>
  | 	  
  | 	  <jta-data-source>java:/MyDS</jta-data-source>
  | 	  
  | 	  <mapping-file>META-INF/orm.xml</mapping-file>
  | 
  | 	  <class>x.y.z.DefaultEventBase</class>	  
  | 	  <class>x.y.z.PayloadItem</class>
  | 	  <class>x.y.z.DefaultMyEvent</class>
  | 	  
  | 	  <properties>
  | 	  	  <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
  | 	  	  <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
  | 	  	  <property name="hibernate.format_sql" value="true"/>
  | 	  </properties>
  |   </persistence-unit>
  | </persistence> 
  | 
  | 
  | 

Finally, I have an empty orm.xml (as everything is specified via Annotations);


  | 
  | <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm" version="1.0"
  |   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  |   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm_1_0.xsd">
  |   
  | </entity-mappings>
  | 
  | 

The associated stack trace shows:


  | 
  |         at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:627)
  |         at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:452)
  |         at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:268)
  |         at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
  |         at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1233)
  |         at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:154)
  |         at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:869)
  |         at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:407)
  |         at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)
  |         at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:597)
  |         at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:103)
  |         at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
  |         at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
  |         at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:597)
  |         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  |         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  |         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  |         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  |         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  |         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
  |         at $Proxy0.start(Unknown Source)
  |         at org.jboss.system.ServiceController.start(ServiceController.java:417)
  |         at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:597)
  |         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  |         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  |         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  |         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  |         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  |         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  |         at $Proxy90.start(Unknown Source)
  |         at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:120)
  |         at org.jboss.ejb3.Ejb3Deployment.startPersistenceUnits(Ejb3Deployment.java:627)
  |         at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:351)
  |         at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91)
  |         at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
  |         at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
  |         at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:597)
  |         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  |         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  |         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  |         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  |         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  |         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
  |         at $Proxy0.start(Unknown Source)
  |         at org.jboss.system.ServiceController.start(ServiceController.java:417)
  |         at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:597)
  |         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  |         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  |         at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  |         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  |         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  |         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  |         at $Proxy33.start(Unknown Source)
  |         at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:512)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  |         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:597)
  |         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  |         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  |         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
  |         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  |         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
  |         at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
  |         at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
  |         at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
  |         at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
  |         at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
  |         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  |         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  |         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  |         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  |         at $Proxy34.start(Unknown Source)
  |         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
  |         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
  |         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
  |         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
  |         at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
  |         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:597)
  |         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  |         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  |         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
  |         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  |         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
  |         at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  |         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  |         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  |         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  |         at $Proxy9.deploy(Unknown Source)
  |         at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
  |         at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
  |         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
  |         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
  |         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
  | 





More information about the jboss-user mailing list