7 Replies Latest reply on May 21, 2002 9:11 PM by matt

    EJB 2.0 CMP and jbosscmp-jdbc.xml

    matt Newbie

      Can some one tell me which version of the jbosscmp-jdbc.xml corrolates to which RC of jboss3.0

      It appears that the xml in the jbossCMP WorkBook do
      not corrospond to http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_0.dtd

      For example work book says <forign-key-fields>
      but the dtd says <key-fields>

      which am I suppose to use?????


        • 1. Re: EJB 2.0 CMP and jbosscmp-jdbc.xml
          matt Newbie

          I am still getting some deployment problems
          See attached??

          I have also upgraded to jboss3.0RC3

          I have 2 beans with a unidirectional M->1 relationship
          i.e players->team
          I have deployed each of the EJB in seperate jars.

          the team bean deplys fine (but the jbosscmp-jdbc.xml
          file is as per the xml in the CMP workbook)

          the player bean gives the error as in the capture.log
          and below. (The jbosscmp-jdbc.xml is as per the jbosscmp-jdbc_3_0.dtd)

          I can deploy the beans with out relation ships and query/update the database, no worries.

          2002-05-21 23:24:23,942 DEBUG [org.jboss.system.ServiceController] removing service: jboss.j2ee:service=EJB,jndiName=MLBTeamBean
          2002-05-21 23:24:23,943 DEBUG [org.jboss.system.ServiceController] no need to remove jboss.j2ee:service=EJB,jndiName=MLBTeamBean from server
          2002-05-21 23:24:23,943 INFO [org.jboss.ejb.EjbModule] Remove JSR-77 EJB Module: jboss.management.single:J2EEApplication= ,J2EEServer=Single,j2eeType=EJBMo
          2002-05-21 23:24:23,945 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] preDeregister(), parent: jboss.management.single:J2EEServer=Single,name=
          2002-05-21 23:24:23,946 ERROR [org.jboss.ejb.EjbModule] Initialization failed
          org.jboss.deployment.DeploymentException: Atleast one role of a foreign-key mapped relationship must have key fields: ejb-relation-name=player-team
          at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMetaData.(JDBCRelationMetaData.java:316)
          at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.(JDBCApplicationMetaData.java:325)
          at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLoader.java:67)
          at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(JDBCStoreManager.java:602)

          What am I still doing wrong ???


          • 3. Re: EJB 2.0 CMP and jbosscmp-jdbc.xml
            Tim Fox Master

            Hi matt
            I have had this problem too.
            The examples in the cmp workbook are well out of date- I have found it's best to ignore them and work from the latest dtds now.

            • 4. Re: EJB 2.0 CMP and jbosscmp-jdbc.xml
              matt Newbie

              All the DTD's now confirm too the new DTD, but
              I am still getting the same Exception

              • 5. Re: EJB 2.0 CMP and jbosscmp-jdbc.xml
                matt Newbie

                I have an entity bean drployed to jboss3.0RC3
                I could deploy it with the old DTD now I use the
                new DTD and get the following NullPointerExceptions

                2002-05-22 09:00:55,031 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.MLBTeamBean] Loading standardjbosscmp-jdbc.xml : file:/homes/odin3/matthewh/j
                2002-05-22 09:00:55,226 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.MLBTeamBean] jar:file:/homes/odin3/matthewh/jboss-3.0.0RC3_tomcat-4.0.3/serve
                r/default/tmp/deploy/server/default/deploy/mlbTeam.jar/109.mlbTeam.jar!/META-INF/jbosscmp-jdbc.xml found. Overriding defaults
                2002-05-22 09:00:55,233 ERROR [org.jboss.metadata.XmlFileLoader] java.lang.NullPointerException:-1:2
                at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:524)
                at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
                at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
                at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:185)
                at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:86)
                at org.jboss.metadata.XmlFileLoader.getDocument(XmlFileLoader.java:260)

                I do not have any empty fields in the xml.

                • 7. Re: EJB 2.0 CMP and jbosscmp-jdbc.xml
                  matt Newbie

                  Any Idears!! I have none! other than jboss may not be pharsing the xml file to the DTD.