persistence@glassfish.java.net

Re: _at_IdClass issues

From: Gordon Yorke <gordon.yorke_at_oracle.com>
Date: Wed, 25 Feb 2009 22:40:25 -0400

Your PKClass is missing the cusID
--Gordon

Eve Pokua wrote:
> Hello everyone,
>
> I am having problems creating an IdClass. I get the following errors:
>
> [#|2009-02-26T00:06:06.435+0000|SEVERE|sun-appserver9.1|javax.enterprise.system.tools.deployment|_ThreadID=38;_ThreadName=Thread-127;_RequestID=01812ccb-53b3-4d7e-bafe-5a688d407eb3;|Exception
> occured in J2EEC Phase
> com.sun.enterprise.deployment.backend.IASDeploymentException:
> Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0 (Build
> b58g-fcs (09/07/2007))):
> oracle.toplink.essentials.exceptions.EntityManagerSetupException
> Exception Description: predeploy for PersistenceUnit
> [STOCKINFOR2-ejbPU] failed.
> Internal Exception: Exception [TOPLINK-7150] (Oracle TopLink
> Essentials - 2.0 (Build b58g-fcs (09/07/2007))):
> oracle.toplink.essentials.exceptions.ValidationException
> Exception Description: Invalid composite primary key specification.
> The names of the primary key fields or properties in the primary key
> class [stockInformation.OrdlinementKey] and those of the entity bean
> class [class stockInformation.Ordlineent] must correspond and their
> types must be the same. Also, ensure that you have specified id
> elements for the corresponding attributes in XML and/or an @Id on the
> corresponding fields or properties of the entity class.
> at
> oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:643)
> at
> oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createContainerEntityManagerFactory(EntityManagerFactoryProvider.java:244)
> at
> com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.loadPersistenceUnitBundle(PersistenceProcessor.java:512)
> at
> com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.createTablesInDB(PersistenceProcessor.java:353)
> at
> com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.processAppBundle(PersistenceProcessor.java:219)
> at
> com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.processApplication(PersistenceProcessor.java:146)
> at
> com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processApplication(DeploymentEventListenerImpl.java:211)
> at
> com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processEvent(DeploymentEventListenerImpl.java:172)
> at
> com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.notifyDeploymentEvent(DeploymentEventListenerImpl.java:122)
> at
> com.sun.enterprise.deployment.backend.DeploymentEventManager.notifyDeploymentEvent(DeploymentEventManager.java:79)
> at
> com.sun.enterprise.deployment.backend.AppDeployer.postDeploy(AppDeployer.java:392)
> at
> com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:251)
> at
> com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:148)
> at
> com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:191)
> at
> com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
> at
> com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:919)
> at
> com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:279)
> at
> com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:788)
> at
> com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:187)
> at
> com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:223)
> |#]
>
> I have attached the files for your convenience. As you may notice, I
> have been
> messing around with it trying to get it right. Orderlineent is the
> entity of the breakdown of many to many
> relationship for Order & Items and Customer. So Orderlineent does not
> have and Id of it's own that's why
> I need the IdClass.
>
> Please, help. I can't figure out why this error and can't deploy it.
>
> Thanks
>
> eve
>
>
> ------------------------------------------------------------------------
> Share your photos with Windows Live Photos - Free Try it Now!
> <http://www.microsoft.com/uk/windows/windowslive/products/messenger.aspx>