0 Replies Latest reply on Aug 25, 2002 5:32 PM by steve bryant

    jbosscmp-jdbc.xml  - "datasource" not allowed under "default

    steve bryant Newbie

      Hi,

      I'm trying to get a simple Entity bean to deploy under JBoss 3 (tried 3.1.0alpha as well) but every time I deploy the JAR file the XmlFileLoader gives out the following message and exception.

      ###################################################
      21:19:30,578 ERROR [XmlFileLoader] XmlFileLoader: File file:/D:/apps/jboss-3.1.0alpha/server/default/tmp/deploy/D/apps/jboss-3.1.0alpha/server/default/deploy/test.jar/73.test.jar!/META-INF/jbosscmp-jdbc.xml process error. Line: 10. Error message: Element "defaults" does not allow "datasource" here.
      21:19:30,578 ERROR [XmlFileLoader] XmlFileLoader: File file:/D:/apps/jboss-3.1.0alpha/server/default/tmp/deploy/D/apps/jboss-3.1.0alpha/server/default/deploy/test.jar/73.test.jar!/META-INF/jbosscmp-jdbc.xml process error. Line: 11. Error message: Element "defaults" does not allow "datasource-mapping" here.
      21:19:30,593 ERROR [EntityContainer] Exception in service lifecyle operation: create org.jboss.deployment.DeploymentException: Invalid XML: file=file:/D:/apps/jboss-3.1.0alpha/server/default/tmp/deploy/D/apps/jboss-3.1.0alpha/server/default/deploy/ewa.jar/73.ewa.jar!/META-INF/jbosscmp-jdbc.xml
      at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:262)
      at org.jboss.metadata.XmlFileLoader.getDocumentFromURL(XmlFileLoader.java:229)
      at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:214)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLoader.java:74)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(JDBCStoreManager.java:595)
      ###################################################

      Here is my jbosscmp-jdbc.xml:
      #############################################
      <jbosscmp-jdbc>


      <create-table>true</create-table>
      <remove-table>true</remove-table>
      java:/testDS
      <datasource-mapping>Oracle9i</datasource-mapping>


      <enterprise-beans>

      <ejb-name>TestEntity</ejb-name>
      <table-name>test</table-name>

      <cmp-field>
      <field-name>id</field-name>
      <column-name>id</column-name>
      <not-null/>
      </cmp-field>
      <cmp-field>
      <field-name>test</field-name>
      <column-name>test</column-name>
      <not-null/>
      </cmp-field>

      </enterprise-beans>
      </jbosscmp-jdbc>
      #############################################

      Not quite sure why JBoss is taking issue with the element being nested under the element. I checked the DTD and looked at examples of this file and everything seems ol korrect. I'm probably being daft and not seeing something obvious but has anyone else run into this before?

      Cheers,
      Steve