1 Reply Latest reply on Jan 3, 2003 2:24 PM by glm

    Duplicate Field Error

    glm Newbie

      I am using JBuilder6 with an OpenSourceTool that integrates JBoss 3.x. The open source tool generates the jboss.xml and jbosscmp-jdbc.xml files automatically.

      I have attached these files to this message for reference purposes.

      The follow is a snipit from the log file which shows the error:

      2003-01-03 11:04:16,360 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.Boxes] Entity Exists SQL: SELECT COUNT(*) FROM boxes WHERE id=? AND PackId=?
      2003-01-03 11:04:16,360 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.Boxes] Insert Entity SQL: INSERT INTO boxes (id, PackId, Length, Width, Height, MaxWeight, BoxWeight, Type, PackingThickness, BoxPrice, PackId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      2003-01-03 11:04:16,360 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.Boxes] entity-command: [commandName=default,commandClass=class org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand,attributes={}]
      2003-01-03 11:04:16,360 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCRemoveEntityCommand.Boxes] Remove SQL: DELETE FROM boxes WHERE id=? AND PackId=?
      2003-01-03 11:04:16,370 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.Boxes] Executing SQL: CREATE TABLE boxes (id SMALLINT NOT NULL, PackId SMALLINT NOT NULL, Length BIGINT, Width BIGINT, Height BIGINT, MaxWeight BIGINT, BoxWeight BIGINT, Type BIGINT, PackingThickness BIGINT, BoxPrice DOUBLE, PackId SMALLINT, CONSTRAINT pk_boxes PRIMARY KEY (id, PackId))
      2003-01-03 11:04:16,370 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.Boxes] Could not create table boxes
      2003-01-03 11:04:16,370 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
      2003-01-03 11:04:16,380 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
      2003-01-03 11:04:16,380 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
      2003-01-03 11:04:16,390 ERROR [org.jboss.ejb.EntityContainer] Starting failed
      org.jboss.deployment.DeploymentException: Error while creating table; - nested throwable: (java.sql.SQLException: Invalid argument value: Duplicate column name 'PackId')

      I have bolded where the PackId is defined and as you can see PackId is being defined twice. I don't see what is causing this to be generated since the ejb-jar.xml only defines it as a cmp-field once for the Boxes table. Could someone explain this please?