2 Replies Latest reply on Dec 17, 2004 4:49 AM by Alexey Loubyansky

    CMP 1.1 EJB from JBoss 3.0 to JBoss 3.2: DefaultDS ???

    Bruce Wilson Newbie

      Hi,

      I'm trying to move a J2EE application from JBoss 3.0.7 to 3.2.6. I'm getting
      an error at JBoss startup, complaining about deployment of CMP entity beans;
      there's an error like this for each CMP entity EJB:

      org.jboss.deployment.DeploymentException: Error: can't find data source:
      java:/DefaultDS;] - nested throwable: (javax.naming.NameNotFoundException:
      DefaultDS not bound)

      Each of these CMP beans has a jaws.xml file which specified a different
      datasource name:

      <!DOCTYPE jaws PUBLIC "-//JBoss//DTD JAWS 3.0//EN"
      "http://www.jboss.org/j2ee/dtd/jaws_3_0.dtd">

      java:/SMSDS
      ...

      The ejb-jar.xml for each of these entity EJBs declares the ejb_jar_1.1 DTD:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC
      "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"
      "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd">
      <ejb-jar>
      <enterprise-beans>
      ...

      What an I doing wrong ? It seems that JBoss is not using the SMSDS data
      source that I specified in jaws.xml. I did convert the data source to the
      3.2 format (putting it in a "-ds.xml" file), and I can see in the JNDIView
      listing that both this data source and DefaultDS are deployed (they also
      show up under the "jboss.jca" domain in the JMX Console).

      Thanks in advance

      Bruce

      P.S.: anyone know of any general online guides for porting from JBoss 3.0 to 3.2 ?

        • 1. Re: CMP 1.1 EJB from JBoss 3.0 to JBoss 3.2: DefaultDS ???
          Bruce Wilson Newbie

          I tried adding a jbosscmp-jdbc.xml descriptor to the CMP EJBs with just
          a default defined:

          <jbosscmp-jdbc>
           <defaults>
           <datasource>java:/SonusSMSDS</datasource>
           </defaults>
          </jbosscmp-jdbc>
          


          This seems to have fixed the problem. Is this what has to be done in
          JBoss 3.2.x, even though I'm using 1.1 CMP EJBs ?

          The reason the data source couldn't be found is because we are using
          a custom DeploymentSorter which was used in 3.0.7; this class didn't
          recognize the new ds.xml suffix, so data sources were being deployed
          after EARs.

          So the question still remains, do I need to have both jaws.xml and
          jbosscmp-jdbc.xml present for 1.1 CMP EJBs in JBoss 3.2 ? Or is there
          a better way to do this (less deployment descriptors).

          - Bruce


          • 2. Re: CMP 1.1 EJB from JBoss 3.0 to JBoss 3.2: DefaultDS ???
            Alexey Loubyansky Master

            Yes, because in 3.2.6 JBossCMP is the default CMP engine for all CMP specs.

             <container-configuration>
             <container-name>Standard CMP EntityBean</container-name>
            ... <persistence-manager>org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager</persistence-manager>
             <!-- <persistence-manager>org.jboss.ejb.plugins.jaws.JAWSPersistenceManager</persistence-manager>-->
            ...
            

            If you want to use JAWS, switch back to JAWS persistence manager.