1 Reply Latest reply on Jul 8, 2002 10:54 PM by Dain Sundstrom

    EMPTY content models must have no content?

    jawwad Newbie

      Well I am going to say jboss is not jboss it bugboss.
      I can't remove exception creating simple one-one unidirection relationship using oracle.All works fine when i set autamaticlly create table generation and don't use relationships tag.When i set to create-table to false.It give me exception on lines <ejb-relationship-role> of relationships tag of jbosscmp-jdbc.xml.The exception is.
      2002-07-09 01:30:05,790 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.AddressEJB] Initializing CMP plugin for AddressEJB
      2002-07-09 01:30:05,950 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.AddressEJB] Loading standardjbosscmp-jdbc.xml : file:/G:/jboss3/server/default/conf/standardjbosscmp-jdbc.xml
      2002-07-09 01:30:06,171 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.AddressEJB] jar:file:/G:/jboss3/server/default/tmp/deploy/server/default/deploy/ch.jar/58.ch.jar!/META-INF/jbosscmp-jdbc.xml found. Overriding defaults
      2002-07-09 01:30:06,241 ERROR [org.jboss.metadata.XmlFileLoader] File file:/G:/jboss3/server/default/tmp/deploy/server/default/deploy/ch.jar/58.ch.jar!/META-INF/jbosscmp-jdbc.xml process error. Line: 70. Error message:
      org.xml.sax.SAXParseException: EMPTY content models must have no content.
      at org.apache.crimson.parser.Parser2.error(Parser2.java:3086)
      at org.apache.crimson.parser.ValidatingParser$EmptyValidator.consume(ValidatingParser.java:296)
      at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1311)
      at org.apache.crimson.parser.Parser2.content(Parser2.java:1766)
      at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1494)
      at org.apache.crimson.parser.Parser2.content(Parser2.java:1766)
      at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1494)
      at org.apache.crimson.parser.Parser2.content(Parser2.java:1766)
      at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1494)
      ///////////////////////////////////////////////////////
      My jbosscmp-jdbc.xml file is
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jbosscmp-jdbc PUBLIC
      "-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN"
      "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_0.dtd">

      <jbosscmp-jdbc>

      java:/OracleDS
      <datasource-mapping>Oracle9i</datasource-mapping>
      <create-table>false</create-table>
      <remove-table>false</remove-table>
      <read-only>false</read-only>
      <preferred-relation-mapping>foreign-key</preferred-relation-mapping>

      <enterprise-beans>


      <ejb-name>CustomerEJB</ejb-name>
      <table-name>customer</table-name>

      <cmp-field>
      <field-name>id</field-name>
      <column-name>USERID</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(256)</sql-type>
      </cmp-field>

      <cmp-field>
      <field-name>name</field-name>
      <column-name>USERNAME</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(256)</sql-type>
      </cmp-field>



      <ejb-name>AddressEJB</ejb-name>
      <table-name>address</table-name>
      <cmp-field>
      <field-name>addressId</field-name>
      <column-name>ADDRESSID</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(256)</sql-type>
      </cmp-field>

      <cmp-field>
      <field-name>street</field-name>
      <column-name>STREET</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(256)</sql-type>
      </cmp-field>

      <cmp-field>
      <field-name>city</field-name>
      <column-name>CITY</column-name>
      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(256)</sql-type>
      </cmp-field>

      </enterprise-beans>


      <ejb-relation>
      <ejb-relation-name>Customer-Address</ejb-relation-name>
      <foreign-key-mapping>


      <ejb-relationship-role>
      <ejb-relationship-role-name>Customer-has-Address</ejb-relationship-role-name>
      <key-fields>
      <key-field>
      <field-name>addressId</field-name>
      <column-name>ADDRESSID</column-name>
      </key-field>
      </key-fields>

      </ejb-relationship-role>
      <ejb-relationship-role>

      <!-- exdented to fit on a printed page -->
      <ejb-relationship-role-name>Address-belongs-to-Customer</ejb-relationship-role-name>



      </ejb-relationship-role>


      </foreign-key-mapping>

      </ejb-relation>


      </jbosscmp-jdbc>

      Thanks