wood burning stoves*
The moose likes Object Relational Mapping and the fly likes referencedColumnNames .. no mapping to a single property Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "referencedColumnNames .. no mapping to a single property" Watch "referencedColumnNames .. no mapping to a single property" New topic
Author

referencedColumnNames .. no mapping to a single property

sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 208
With hibernate 3.5 and Netbeans 7.2, I built an EAR project using the following database relationship

Article (1) to (m) ArticleDesc
Article (1) to (m) ArticlePointForm

When I deploy the ear project, Jboss thorwn the following error:

01:13:20,965 INFO [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-7) Creating Service {http://articledesc.service.Product/}ArticleDescServiceImplService from class Product.service.articledesc.ArticleDescService
01:13:21,056 INFO [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-7) Setting the server's publish address to be http://localhost:8080/Product-ws-web/ArticleDescServices
01:13:21,078 INFO [org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher] (MSC service thread 1-7) WSDL published to: file:/usr/local/users/jboss/jboss711Final/standalone/data/wsdl/Product-ws-ear-1.0.ear/Product-ws-web-1.0.war/ArticleDescServiceImplService.wsdl
01:13:21,077 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.persistenceunit."Product-ws-ear-1.0.ear/Product-ws-ejb-1.0.jar#ProductPU": org.jboss.msc.service.StartException in service jboss.persistenceunit."Product-ws-ear-1.0.ear/Product-ws-ejb-1.0.jar#ProductPU": Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_07]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_07]
at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_07]
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: ProductPU] Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
... 3 more
Caused by: org.hibernate.AnnotationException: referencedColumnNames(article_id) of Product.entity.ArticleDesc.productArticle referencing Product.entity.ProductArticle not mapped to a single property
at org.hibernate.cfg.BinderHelper.createSyntheticPropertyReference(BinderHelper.java:205)
at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:116)
at org.hibernate.cfg.Configuration.processEndOfQueue(Configuration.java:1514)
at org.hibernate.cfg.Configuration.processFkSecondPassInOrder(Configuration.java:1437)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1355)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1724)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:84)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)
... 9 more


Here is ArticlePointForm.java class:



and ArticleDesc.java class:



What is wrong with the mapping?
Any suggestion is very appreciated
Thanks
Sam
 
wood burning stoves
 
subject: referencedColumnNames .. no mapping to a single property