2 Replies Latest reply on Feb 17, 2006 6:15 PM by Walter Herbert

    Jboss 4.0.4 RC1 and EJB 1.1 package.jar

    Walter Herbert Newbie

      I have updated my Jboss 3.2.1 (20030504) to the new 4.0.4RC1.

      So, your JBoss 3.2.x application should run fine in the default configuration of JBoss AS 4.0.1 but your JBoss AS 4.0.0 applications may not be.

      I can deploy all my old packages and comunicate with it, store and read.
      But I'm using MySQL as Persistance and all old modules are using the Hipernate.
      Also all custom finders don't work.

      my packages looks like:
      package.jar
      |
      +-META-INF
      + jaws.xml
      + jboss.xml
      + ejb-jar.xml

      +package
      + some classes




      jaws.xml
      <?xml version="1.0" encoding="UTF-8"?>
      
      <!DOCTYPE jbosscmp-jdbc PUBLIC
       "-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN"
       "http://www.jboss.org/j2ee/dtd/jaws_2_4.dtd">
      
      <jaws>
       <datasource>java:/mySQL-bean-DS</datasource>
       <type-mapping>mySQL</type-mapping>
      
       <enterprise-beans>
      
       <entity>
       <ejb-name>BeanName</ejb-name>
       <cmp-field>
       <field-name> beanID </field-name>
       <column-name>bean_id</column-name>
       <dbindex/>
       </cmp-field>
       <cmp-field>
       <field-name>someField</field-name>
       <column-name>some_field</column-name>
       </cmp-field>
      
       <finder>
       <name>findAll</name>
       <query></query>
       <order></order>
       </finder>
       <finder>
       <name>findBySomeFiled</name>
       <query><![CDATA[where some_field = {0}]]></query>
       <order></order>
       </finder>
       <table-name>bean</table-name>
       </entity>
       </enterprise-beans>
      </jaws>
      
      


      ejb-jar.xml
      <?xml version="1.0" encoding="UTF-16"?>
      <!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>
       <entity>
       <ejb-name> BeanName </ejb-name>
       <home> pkg.BeanNameHome </home>
       <remote> pkg.BeanName </remote>
       <ejb-class> pkg.BeanNameBean </ejb-class>
       <persistence-type> Container </persistence-type>
       <prim-key-class> java.lang.Integer </prim-key-class>
       <primkey-field> beanID </primkey-field>
       <reentrant> False </reentrant>
      
       <cmp-field>
       <field-name>beanID</field-name>
       </cmp-field>
       <cmp-field>
       <field-name>someField</field-name>
       </cmp-field>
      
       <resource-ref>
       <res-ref-name>jdbc/DataSource</res-ref-name>
       <res-type>javax.sql.DataSource</res-type>
       <res-auth>Container</res-auth>
       </resource-ref>
       </entity>
      
       </enterprise-beans>
      
       <assembly-descriptor>
       <container-transaction>
       <method>
       <ejb-name>BeanName</ejb-name>
       <method-name>*</method-name>
       </method>
       <trans-attribute>Required</trans-attribute>
       </container-transaction>
       </assembly-descriptor>
      
      </ejb-jar>
      



      jboss.xml
      <?xml version="1.0" encoding="UTF-8"?>
      
      <!DOCTYPE jboss PUBLIC
       "-//JBoss//DTD JBOSS 3.2//EN"
       "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
      
      <jboss>
       <enforce-ejb-restrictions>true</enforce-ejb-restrictions>
       <enterprise-beans>
      
       <entity>
       <ejb-name>BeanName</ejb-name>
       <!-- DataSource verzweigen -->
       <resource-ref>
       <res-ref-name>jdbc/DataSource</res-ref-name>
       <resource-name>mySQL-bean-DS</resource-name>
       </resource-ref>
       </entity>
       </enterprise-beans>
      </jboss>
      





        • 1. Re: Jboss 4.0.4 RC1 and EJB 1.1 package.jar
          Walter Herbert Newbie

          I found this, look like the same problem...
          http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3853159#3853159
          but if i wont to try this the JAWSPersistenceManager class dosen't exist.
          Is there a way to modify my deploymend discriptors to make it right?

          I thing the problem is something with JAWS and CMP 1.x ?!?

          I also intrested in links or just idears !!

          sorry google wasn't my friend until know :-/

          • 2. Re: Jboss 4.0.4 RC1 and EJB 1.1 package.jar
            Walter Herbert Newbie

            I merged jaws.xml and jboss.xml to jbosscmp-jdbc.xml and leave the ejb-jar.xml

            jbosscmp-jdbc.xml

            <!DOCTYPE jbosscmp-jdbc PUBLIC
             "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN"
             "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">
            
            <jbosscmp-jdbc>
             <defaults>
             <datasource>java:/mySQL-bean-DS</datasource>
             <datasource-mapping>mySQL</datasource-mapping>
             </defaults>
            
             <enterprise-beans>
             <entity>
             <ejb-name>BeanName</ejb-name>
            
             <table-name>bean</table-name>
            
             <cmp-field>
             <field-name> beanID </field-name>
             <column-name>bean_id</column-name>
             </cmp-field>
             <cmp-field>
             <field-name>someField</field-name>
             <column-name>some_field</column-name>
             </cmp-field>
            
             <query>
             <query-method>
             <method-name>findBySomeFiled</method-name>
             <method-params>
             <method-param>int</method-param>
             </method-params>
             </query-method>
             <declared-sql>
             <where>[CDATA[ some_field = {0} ]]</where>
             </declared-sql>
             </query>
            
             </entity>
             </enterprise-beans>
            
            </jbosscmp-jdbc>


            Works fine on testing, only a WARNING on deploy, that the query-Funktions not in ejb-jar.xml.

            Are there any known Proplems with that kind of deploy?