| <?xml version="1.0" encoding="UTF-8"?>
  | <!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN" 
"http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd";>
  | 
  | <jbosscmp-jdbc>
  |    <defaults>
  |    </defaults>
  | 
  |    <enterprise-beans>
  | 
  |      <!--
  |        To add beans that you have deployment descriptor info for, add
  |        a file to your XDoclet merge directory called jbosscmp-jdbc-beans.xml
  |        that contains the <entity></entity> markup for those beans.
  |      -->
  | 
  |       <entity>
  |          <ejb-name>SecurityGroup</ejb-name>
  |          <create-table>true</create-table>
  |          <remove-table>false</remove-table>
  | 
  |          <post-table-create>
  |            <sql-statement>INSERT INTO SECURITY_GROUPS (SECURITY_GROUP_ID, 
SECURITY_GROUP_NAME, SECURITY_GROUP_COMMENT) VALUES(1,'roots','The root 
group.');</sql-statement>
  |          </post-table-create>
  | 
  |          <table-name>SECURITY_GROUPS</table-name>
  | 
  |          <cmp-field>
  |             <field-name>id</field-name>
  |             <column-name>SECURITY_GROUP_ID</column-name>
  |                     <not-null/>
  | 
  |                     <auto-increment/>
  |                 <dbindex/>
  |         </cmp-field>
  |          <cmp-field>
  |             <field-name>name</field-name>
  |             <column-name>SECURITY_GROUP_NAME</column-name>
  |                     <not-null/>
  | 
  |         </cmp-field>
  |          <cmp-field>
  |             <field-name>comment</field-name>
  |             <column-name>SECURITY_GROUP_COMMENT</column-name>
  | 
  |         </cmp-field>
  | 
  | <!-- jboss 3.2 features -->
  | <!-- optimistic locking does not express the exclusions needed -->
  |       </entity>
  | 
  |       <entity>
  |          <ejb-name>SecurityUser</ejb-name>
  | 
  |          <table-name>SECURITY_USERS</table-name>
  | 
  |          <cmp-field>
  |             <field-name>id</field-name>
  |             <column-name>SECURITY_USER_ID</column-name>
  |                     <not-null/>
  | 
  |                     <auto-increment/>
  |                 <dbindex/>
  |         </cmp-field>
  |          <cmp-field>
  |             <field-name>externalId</field-name>
  |             <column-name>SECURITY_USER_EXTERNAL_ID</column-name>
  | 
  |         </cmp-field>
  |          <cmp-field>
  |             <field-name>name</field-name>
  |             <column-name>SECURITY_USER_NAME</column-name>
  |                     <not-null/>
  | 
  |         </cmp-field>
  |          <cmp-field>
  |             <field-name>password</field-name>
  |             <column-name>SECURITY_USER_PASSWORD</column-name>
  |                     <not-null/>
  | 
  |         </cmp-field>
  |          <cmp-field>
  |             <field-name>comment</field-name>
  |             <column-name>SECURITY_USER_COMMENT</column-name>
  | 
  |         </cmp-field>
  | 
  | <!-- jboss 3.2 features -->
  | <!-- optimistic locking does not express the exclusions needed -->
  |       </entity>
  | 
  |       <entity>
  |          <ejb-name>SecurityRole</ejb-name>
  | 
  |          <table-name>SECURITY_ROLES</table-name>
  | 
  |          <cmp-field>
  |             <field-name>id</field-name>
  |             <column-name>SECURITY_ROLE_ID</column-name>
  |                     <not-null/>
  | 
  |                     <auto-increment/>
  |                 <dbindex/>
  |         </cmp-field>
  |          <cmp-field>
  |             <field-name>name</field-name>
  |             <column-name>SECURITY_ROLE_NAME</column-name>
  |                     <not-null/>
  | 
  |         </cmp-field>
  |          <cmp-field>
  |             <field-name>comment</field-name>
  |             <column-name>SECURITY_ROLE_COMMENT</column-name>
  | 
  |         </cmp-field>
  | 
  | <!-- jboss 3.2 features -->
  | <!-- optimistic locking does not express the exclusions needed -->
  |       </entity>
  | 
  |    </enterprise-beans>
  | 
  |   <relationships>
  |     <ejb-relation>
  |       <ejb-relation-name>SecurityRole-SecurityGroup</ejb-relation-name>
  |       <relation-table-mapping>
  |         <table-name>SECURITY_ROLES_GROUPS</table-name>
  |       </relation-table-mapping>
  | 
  |       <ejb-relationship-role>
  |           <ejb-relationship-role-name>groups-roles</ejb-relationship-role-name>
  |           <key-fields>
  |              <key-field>
  |                <field-name>id</field-name>
  |                <column-name>SECURITY_GROUP_ID</column-name>
  |              </key-field>
  |           </key-fields>
  | 
  |       </ejb-relationship-role>
  |       <ejb-relationship-role>
  |           <ejb-relationship-role-name>roles-groups</ejb-relationship-role-name>
  |           <key-fields>
  |              <key-field>
  |                <field-name>id</field-name>
  |                <column-name>SECURITY_ROLE_ID</column-name>
  |              </key-field>
  |           </key-fields>
  | 
  |       </ejb-relationship-role>
  |     </ejb-relation>
  |     <ejb-relation>
  |       <ejb-relation-name>SecurityUser-SecurityRole</ejb-relation-name>
  |       <relation-table-mapping>
  |         <table-name>SECURITY_USERS_ROLES</table-name>
  |       </relation-table-mapping>
  | 
  |       <ejb-relationship-role>
  |           <ejb-relationship-role-name>users-roles</ejb-relationship-role-name>
  |           <key-fields>
  |              <key-field>
  |                <field-name>id</field-name>
  |                <column-name>SECURITY_USER_ID</column-name>
  |              </key-field>
  |           </key-fields>
  | 
  |       </ejb-relationship-role>
  |       <ejb-relationship-role>
  |           <ejb-relationship-role-name>roles-users</ejb-relationship-role-name>
  |           <key-fields>
  |              <key-field>
  |                <field-name>id</field-name>
  |                <column-name>SECURITY_ROLE_ID</column-name>
  |              </key-field>
  |           </key-fields>
  | 
  |       </ejb-relationship-role>
  |     </ejb-relation>
  |      <!-- 
  |        To add jboss relationships for beans not managed by XDoclet, add
  |        a file to your XDoclet merge directory called 
jbosscmp-jdbc-relationships.xml that contains
  |        the <ejb-relation></ejb-relation> markups for those beans.
  |      --> 
  |   </relationships>
  | 
  | </jbosscmp-jdbc>
  | 
  | 
During deployement on a jboss-4.0.0 server with MySQL and an empty schema, the sql 
statement of SecurityGroup bean is called during SecurityRole and SecurityGroup table 
creation. The curious behaviour throws a duplicate key exception with a fixed primary 
key or a duplicate field when the inset statement used the auto-inc feature ?

Some one helps ? Thx ?

Fred Nowak

MBeans waiting for other MBeans:
  | ObjectName: jboss.j2ee:jndiName=ejb/SecurityRoleLocal,service=EJB
  |  state: FAILED
  |  I Depend On: 
  |  Depends On Me: org.jboss.deployment.DeploymentException: Error while issuing sql 
in post-table-create; - nested throwable: (java.sql.SQLException: Duplicate key or 
integrity constraint violation,  message from server: "Duplicate entry '1' for key 1")
  | ObjectName: jboss.j2ee:service=EJB,plugin=pool,jndiName=ejb/SecurityRoleLocal
  |  state: CREATED
  |  I Depend On: 
  |  Depends On Me: 
  | 
  | MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
  | ObjectName: jboss.j2ee:jndiName=ejb/SecurityRoleLocal,service=EJB
  |  state: FAILED
  |  I Depend On: 
  |  Depends On Me: org.jboss.deployment.DeploymentException: Error while issuing sql 
in post-table-create; - nested throwable: (java.sql.SQLException: Duplicate key or 
integrity constraint violation,  message from server: "Duplicate entry '1' for key 1")
  | ObjectName: jboss.j2ee:service=EJB,plugin=pool,jndiName=ejb/SecurityRoleLocal
  |  state: CREATED
  |  I Depend On: 
  |  Depends On Me: 

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3850944#3850944

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3850944


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to