glassfish
  1. glassfish
  2. GLASSFISH-377

misleading error thrown when column names and getter/setters are missing for Composite Primary Keys

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 9.0pe
    • Fix Version/s: 9.1pe_dev
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      377

      Description

      I have a persistence class with a composite Primary Key class which is embeddable.
      In the absence of getter/setter for the fields, and if no Column names for the
      fields are specified using @Column(name=<name>), then the following errors are
      thrown which are misleading.

      Proper Exception description should be displayed e.g. "Composite Primary Key
      class seems to be missing getter/setter methods or setting Column name
      annotations for its fields. Either the getter/setters should be declared, or
      Column names should be specified using the annotation."

      ==[server log error]=========================================
      [#|2006-03-09T16:23:31.597-0500|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.tools.deployment|_ThreadID=47;_ThreadName=Thread-102;_RequestID=66bd9653-2854-41db-b8fb-edbaef65c157;|Exception
      occured in J2EEC Phase

      com.sun.enterprise.deployment.backend.IASDeploymentException: Exception
      [TOPLINK-0] (Oracle TopLink Essentials - 10g release 4 (10.1.4.0.0) (Build
      060301Dev)): oracle.toplink.essentials.exceptions.IntegrityException

      Descriptor Exceptions:
      ---------------------------------------------------------
      Exception [TOPLINK-74] (Oracle TopLink Essentials - 10g release 4 (10.1.4.0.0)
      (Build 060301Dev)): oracle.toplink.essentials.exceptions.DescriptorException

      Exception Description: The primary key fields are not set for this descriptor.

      Descriptor: RelationalDescriptor(com.sun.asqe.entitystateless.ejb.car.Car -->
      [DatabaseTable(CAR)])

      Runtime Exceptions:
      ---------------------------------------------------------
      at
      oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createContainerEntityManagerFactory(EntityManagerFactoryProvider.java:172)
      at
      com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.loadPersistenceUnitBundle(PersistenceProcessor.java:453)
      at
      com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.generateDDLFiles(PersistenceProcessor.java:282)
      at
      com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.processAppBundle(PersistenceProcessor.java:170)
      at
      com.sun.jdo.spi.persistence.support.ejb.ejbc.PersistenceProcessor.processApplication(PersistenceProcessor.java:112)
      at
      com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processApplication(DeploymentEventListenerImpl.java:193)
      at
      com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.processEvent(DeploymentEventListenerImpl.java:152)
      at
      com.sun.jdo.spi.persistence.support.ejb.ejbc.DeploymentEventListenerImpl.notifyDeploymentEvent(DeploymentEventListenerImpl.java:109)
      at
      com.sun.enterprise.deployment.backend.DeploymentEventManager.notifyDeploymentEvent(DeploymentEventManager.java:66)
      at
      com.sun.enterprise.deployment.backend.AppDeployer.postDeploy(AppDeployer.java:418)
      at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:220)
      at
      com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:125)
      at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:169)
      at
      com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95)
      at
      com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:848)
      at
      com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:260)
      at
      com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:716)
      at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:170)
      at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:199)

      #]
      ==[console log error]=========================================
      [exec] CLI171 Command deploy failed : Deploying application in domain faile
      d; Exception [TOPLINK-0] (Oracle TopLink Essentials - 10g release 4 (10.1.4.0.0)
      (Build 060301Dev)): oracle.toplink.essentials.exceptions.IntegrityException
      [exec] Descriptor Exceptions:
      [exec] ---------------------------------------------------------
      [exec] Exception [TOPLINK-74] (Oracle TopLink Essentials - 10g release 4 (1
      0.1.4.0.0) (Build 060301Dev)): oracle.toplink.essentials.exceptions.DescriptorEx
      ception
      [exec] Exception Description: The primary key fields are not set for this d
      escriptor.
      [exec] Descriptor: RelationalDescriptor(com.sun.asqe.entitystateless.ejb.ca
      r.Car --> [DatabaseTable(CAR)])
      [exec] Runtime Exceptions:
      [exec] ---------------------------------------------------------

      ======================================================================

      1. Car.java
        0.9 kB
        aditya_dada
      2. CarPK.java
        1 kB
        aditya_dada

        Issue Links

          Activity

          Hide
          aditya_dada added a comment -

          Created an attachment (id=119)
          Primary Key Class

          Show
          aditya_dada added a comment - Created an attachment (id=119) Primary Key Class
          Hide
          aditya_dada added a comment -

          Created an attachment (id=120)
          Car: persistent entity class

          Show
          aditya_dada added a comment - Created an attachment (id=120) Car: persistent entity class
          Hide
          marina vatkina added a comment -

          Reassign

          Show
          marina vatkina added a comment - Reassign
          Hide
          marina vatkina added a comment -

          Really a misleading error

          Show
          marina vatkina added a comment - Really a misleading error
          Hide
          Sanjeeb Sahoo added a comment -

          I am working on this issue to provide an error message like this:
          Entity [class Car] uses [class CarPK] as embedded id class whose access-type has
          been determined as [PROPERTY]. But [class CarPK] does not define any [PROPERTY].
          It is likely that you have not provided sufficient metadata in your id class
          [class CarPK].

          – Sahoo

          Show
          Sanjeeb Sahoo added a comment - I am working on this issue to provide an error message like this: Entity [class Car] uses [class CarPK] as embedded id class whose access-type has been determined as [PROPERTY] . But [class CarPK] does not define any [PROPERTY] . It is likely that you have not provided sufficient metadata in your id class [class CarPK] . – Sahoo
          Hide
          Sanjeeb Sahoo added a comment -

          Checking in src/java/oracle/toplink/essentials/exceptions/ValidationException.java;
          /cvs/glassfish/entity-persistence/src/java/oracle/toplink/essentials/exceptions/ValidationException.java,v
          <-- ValidationException.java
          new revision: 1.25; previous revision: 1.24
          done
          Checking in
          src/java/oracle/toplink/essentials/exceptions/i18n/ValidationExceptionResource.java;
          /cvs/glassfish/entity-persistence/src/java/oracle/toplink/essentials/exceptions/i18n/ValidationExceptionResource.java,v
          <-- ValidationExceptionResource.java
          new revision: 1.24; previous revision: 1.23
          done
          Checking in
          src/java/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataValidator.java;
          /cvs/glassfish/entity-persistence/src/java/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataValidator.java,v
          <-- MetadataValidator.java
          new revision: 1.9; previous revision: 1.8
          done
          Checking in
          src/java/oracle/toplink/essentials/internal/ejb/cmp3/metadata/accessors/EmbeddedAccessor.java;
          /cvs/glassfish/entity-persistence/src/java/oracle/toplink/essentials/internal/ejb/cmp3/metadata/accessors/EmbeddedAccessor.java,v
          <-- EmbeddedAccessor.java
          new revision: 1.4; previous revision: 1.3
          done

          Show
          Sanjeeb Sahoo added a comment - Checking in src/java/oracle/toplink/essentials/exceptions/ValidationException.java; /cvs/glassfish/entity-persistence/src/java/oracle/toplink/essentials/exceptions/ValidationException.java,v <-- ValidationException.java new revision: 1.25; previous revision: 1.24 done Checking in src/java/oracle/toplink/essentials/exceptions/i18n/ValidationExceptionResource.java; /cvs/glassfish/entity-persistence/src/java/oracle/toplink/essentials/exceptions/i18n/ValidationExceptionResource.java,v <-- ValidationExceptionResource.java new revision: 1.24; previous revision: 1.23 done Checking in src/java/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataValidator.java; /cvs/glassfish/entity-persistence/src/java/oracle/toplink/essentials/internal/ejb/cmp3/metadata/MetadataValidator.java,v <-- MetadataValidator.java new revision: 1.9; previous revision: 1.8 done Checking in src/java/oracle/toplink/essentials/internal/ejb/cmp3/metadata/accessors/EmbeddedAccessor.java; /cvs/glassfish/entity-persistence/src/java/oracle/toplink/essentials/internal/ejb/cmp3/metadata/accessors/EmbeddedAccessor.java,v <-- EmbeddedAccessor.java new revision: 1.4; previous revision: 1.3 done

            People

            • Assignee:
              Sanjeeb Sahoo
              Reporter:
              aditya_dada
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: