Hi All, I'm using Jboss 3.2.3. I have a table in MSSQL which is having an auto-incrementing field as primary key. Im my jbosscmp-jdbc.xml, I have the following declarations to cater for the auto-increment field: <cmp-field> <field-name>job_no</field-name> <column-name>job_no</column-name> <auto-increment/> </cmp-field> <entity-command name="mssql-fetch-key"/>
But then, when I deploy my application, JBoss throws the following exception: 121. Error message: Element type "auto-increment" must be declared . 21:39:36,938 ERROR [XmlFileLoader] XmlFileLoader: File jar:file:/E:/cvs/jboss-3.2.3-src/build/output/jboss-3.2.3/server/default/tmp/deploy/tmp30365ProcessOrder.jar!/META-INF/jbosscmp-jdbc.xml process error. Line: 122. Error message: The content of element type "cmp-field" must match " (field-name,read-only?,read-time-out?,column-name?,not-null?,((jdbc-type,sql-type)|property+)?)". The auto-increment element type is not being recognised, and jboss seems to be complaining wrongly, coz according to the jbosscmp-jdbc_3_2.dtd : <!ELEMENT cmp-field (field-name, read-only?, read-time-out?, column-name?, not-null?, ((jdbc-type, sql-type) | (property+))?, auto-increment?, dbindex?, check-dirty-after-get?, state-factory? )> Does anybody has a clue why this is so? I've searched through the forum and checked out the JBoss pay-for docs, and I seem to be the only one having this issue. Thanks!
You have to be sure that your jbosscmp-jdbc.xml file reference the correct DTD: <!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd"> I had the same problem because the DTD was 3.0. But now even if I can add the auto-increment element, I have a JDBC error because JBOSS wants to insert a primary key value. Unfortunatly, I think that JBOSS is not friend with primary keys. Is anybody have the solution ? Thanks