-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: composite-id Bad identifier type:
PostPosted: Tue Jun 06, 2006 10:38 am 
Newbie

Joined: Tue Jun 06, 2006 10:27 am
Posts: 1
I am getting the below exception when I try to intialize my sessionFactory. I am using spring to do this.

What I dont get is why I am getting a mapping exception. The below keys map fine if defined as normal properties. I also don't see where the net.sf.hibernate.type.ComponentType come into it. Why is hibernate looking for that.

I have tried setting the type and not setting the type for the key-properties. I get the same exception.

I am gratefull to anyone that can help.


Hibernate version: 2.17

Mapping documents:

<composite-id name="detailPK" class="OatsDetailPK" >
<key-property name="oatsOrderId" column="OATS_ORDER_NBR" />
<key-property name="DETAIL_TMSTMP" column="DETAIL_TMSTMP" />
<key-property name="DETAIL_TYP" column="DETAIL_TYP" />
</composite-id>


Full stack trace of any exception that occurs:

org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'oatsSessionFactory' defined in class path resource [oatsApplicationContext.xml]:
Initialization of bean failed;

nested exception is net.sf.hibernate.MappingException: Bad identifier type: net.sf.hibernate.type.ComponentType
net.sf.hibernate.MappingException: Bad identifier type: net.sf.hibernate.type.ComponentType


at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:669)
at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:690)
at net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:42)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:137)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:805)
at org.springframework.orm.hibernate.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:543)
at org.springframework.orm.hibernate.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1058)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:318)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:156)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48)
at weblogic.servlet.internal.WebAppServletContext.notifyCreated(WebAppServletContext.java:1351)
at weblogic.servlet.internal.WebAppServletContext.init(WebAppServletContext.java:1008)
at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:932)
at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:516)
at weblogic.j2ee.WebAppComponent.deploy(WebAppComponent.java:77)
at weblogic.j2ee.Application.deploy(Application.java:277)
at weblogic.j2ee.J2EEService.deployApplication(J2EEService.java:194)
at weblogic.management.mbeans.custom.Application.setLocalDeployed(Application.java:369)
at weblogic.management.mbeans.custom.Application.setDeployed(Application.java:303)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeSetter(DynamicMBeanImpl.java:1491)
at weblogic.management.internal.DynamicMBeanImpl.setAttribute(DynamicMBeanImpl.java:968)
at weblogic.management.internal.DynamicMBeanImpl.setAttribute(DynamicMBeanImpl.java:921)
at weblogic.management.internal.ConfigurationMBeanImpl.setAttribute(ConfigurationMBeanImpl.java:310)
at com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java:1358)
at com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java:1333)
at weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBeans(ConfigurationMBeanImpl.java:407)
at weblogic.management.internal.ConfigurationMBeanImpl.setAttribute(ConfigurationMBeanImpl.java:313)
at com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java:1358)
at com.sun.management.jmx.MBeanServerImpl.setAttribute(MBeanServerImpl.java:1333)
at weblogic.management.internal.MBeanProxy.setAttribute(MBeanProxy.java:320)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:202)
at $Proxy27.setDeployed(Unknown Source)
at weblogic.management.mbeans.custom.ApplicationManager.autoDeploy(ApplicationManager.java:940)
at weblogic.management.mbeans.custom.ApplicationManager.poll(ApplicationManager.java:890)
at weblogic.management.mbeans.custom.ApplicationManager.poll(ApplicationManager.java:781)
at weblogic.management.mbeans.custom.ApplicationManager.update(ApplicationManager.java:210)
at weblogic.management.mbeans.custom.ApplicationManager$ApplicationPoller.run(ApplicationManager.java:1135)



Name and version of the database you are using:
DB2 8.2


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 06, 2006 3:31 pm 
Beginner
Beginner

Joined: Tue Oct 18, 2005 3:57 pm
Posts: 48
Location: Los Angeles, CA
Did you do the following for OatsDetailPK?

Quote:
* Implement java.io.Serializable.
*Override equals() and hashCode(), consistently with the database's notion of composite key equality.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.