4 Replies Latest reply on Aug 19, 2005 9:06 AM by Evan Nail

    Entity EJB - DataSource

    Evan Nail Newbie

      Trying to move a few EJBs from wl to jboss for the first time. I've deployed the beans but can't seem to get the DataSource Mapping set up corretly.

      I have an oracle-ds.xml file deployed and the console tells me that it binds the jndi names. I assume that means the connections went ok but not sure.

      However when I try and use that jndi-name in my jboss-cmp-jdbc.xml file as the dafault datasource for my entity beans the finder methods dont return anything. I dont get any db errors, just either nulls or finder exceptions( no entity exists)

      I am using
      default
      datasource


      I can change the jndi name in that file to a nonesense jndiname and I get the same results, so I guess am just not setting up the datasource for these entity beans correclty.

      Any pointers would be appreciated.

        • 1. Re: Entity EJB - DataSource
          Darran Lofthouse Master

           

          "anotherjavaguy" wrote:

          I have an oracle-ds.xml file deployed and the console tells me that it binds the jndi names. I assume that means the connections went ok but not sure.


          At that stage the connections will not have been verified.

          "anotherjavaguy" wrote:

          However when I try and use that jndi-name in my jboss-cmp-jdbc.xml file as the dafault datasource for my entity beans


          Where is the 'jboss-cmp-jdbc.xml' when you deploy your beans and can you post is here.

          "anotherjavaguy" wrote:

          I am using
          default
          datasource


          If you are trying to post XML can you wrap it in [ code ][ /code ] tags without the spaces and use the preview button.

          "anotherjavaguy" wrote:

          I can change the jndi name in that file to a nonesense jndiname and I get the same results, so I guess am just not setting up the datasource for these entity beans correclty.


          Can you execute the command 'jar-tf jarname.jar' and show the output here.


          • 2. Re: Entity EJB - DataSource
            Evan Nail Newbie

            Thanks for responding

            I'm deploying as an ear but have attached the contents of the ejb jar file. I think the structure is fine since it deploys on wl8.1 fine using the wl descriptors. But I'll take any comments I can get.
            META-INF/
            META-INF/MANIFEST.MF
            META-INF/ejb-jar.xml
            META-INF/jboss-cmp-jdbc.xml
            META-INF/jboss.xml
            com/
            com/bn/
            com/bn/ejb/
            com/bn/ejb/appuser/
            com/bn/ejb/appuser/ApplicationUserFacade.class
            com/bn/ejb/appuser/ApplicationUserFacadeBean.class
            com/bn/ejb/appuser/ApplicationUserFacadeHome.class
            com/bn/ejb/appuser/ApplicationUserFacadeRemote.class
            com/bn/ejb/appuser/eb/
            com/bn/ejb/appuser/eb/ApplicationUserBean.class
            com/bn/ejb/appuser/eb/ApplicationUserLocal.class
            com/bn/ejb/appuser/eb/ApplicationUserLocalHome.class
            com/bn/ejb/appuser/eb/ApplicationUserPK.class
            com/bn/ejb/common/
            com/bn/ejb/common/EAEnterpriseBean.class
            com/bn/ejb/common/EAMessageDrivenBean.class
            com/bn/ejb/common/EASessionBean.class
            com/bn/ejb/common/EAStatelessSessionBean.class
            com/bn/ejb/deal/
            com/bn/ejb/deal/DealFacade.class
            com/bn/ejb/deal/DealFacadeBean.class
            com/bn/ejb/deal/DealFacadeHome.class
            com/bn/ejb/deal/DealFacadeRemote.class
            com/bn/ejb/deal/eb/
            com/bn/ejb/deal/eb/ArrangerBean.class
            com/bn/ejb/deal/eb/ArrangerLocal.class
            com/bn/ejb/deal/eb/ArrangerLocalHome.class
            com/bn/ejb/deal/eb/DealBean.class
            com/bn/ejb/deal/eb/DealLocal.class
            com/bn/ejb/deal/eb/DealLocalHome.class
            com/bn/ejb/deal/eb/DealPK.class
            com/bn/ejb/message/
            com/bn/ejb/message/InviteUser.class
            com/bn/rmi/
            com/bn/rmi/Callback.class
            com/bn/rmi/CallbackClient.class
            com/bn/rmi/CallbackClientIntf.class
            com/bn/rmi/CallbackImpl.class
            com/bn/rmi/DataObject.class

            Here is also the cmp xml file. I totally guessed on some of the differences between servers so I'm sure there something wrong here..among other places. It's huge so I'll just include the first entity.

            <?xml version="1.0" encoding="UTF-8"?>
            
            <!DOCTYPE jbosscmp-jdbc PUBLIC '-//JBoss//DTD JBOSSCMP-JDBC 4.0//EN' 'http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_4_0.dtd'>
            <jbosscmp-jdbc>
             <defaults>
             <datasource>java:jdbc/Assets</datasource>
             </defaults>
            
             <enterprise-beans>
             <entity>
            
             <ejb-name>DealEJB</ejb-name>
             <table-name>Deal</table-name>
            
             <cmp-field><field-name><field-name>dealId</field-name><column-name>DEAL_ID</column-name></cmp-field>
             <cmp-field><field-name><field-name>createdByUserId</field-name><column-name>CREATED_BY_USER_ID</column-name></cmp-field>
             <cmp-field><field-name><field-name>createdDtm</field-name><column-name>CREATED_DTM</column-name></cmp-field>
             <cmp-field><field-name><field-name>modifiedByUserId</field-name><column-name>MODIFIED_BY_USER_ID</column-name></cmp-field>
             <cmp-field><field-name><field-name>modifiedDtm</field-name><column-name>MODIFIED_DTM</column-name></cmp-field>
             <cmp-field><field-name><field-name>applicationUserId</field-name><column-name>APPLICATION_USER_ID</column-name></cmp-field>
             <cmp-field><field-name><field-name>productTypeId</field-name><column-name>PRODUCT_TYPE_ID</column-name></cmp-field>
             <cmp-field><field-name><field-name>visibilityTypeId</field-name><column-name>VISIBILITY_TYPE_ID</column-name></cmp-field>
             <cmp-field><field-name><field-name>amount</field-name><column-name>AMOUNT</column-name></cmp-field>
             <cmp-field><field-name><field-name>displayPeriodDaysDur</field-name><column-name>DISPLAY_PERIOD_DAYS_DUR</column-name></cmp-field>
             <cmp-field><field-name><field-name>visibleFlag</field-name><column-name>VISIBLE_FLAG</column-name></cmp-field>
             <cmp-field><field-name><field-name>publicPrivateId</field-name><column-name>PUBLIC_PRIVATE_ID</column-name></cmp-field>
             <cmp-field><field-name><field-name>adminApproverApplUserId</field-name><column-name>ADMIN_APPROVER_APPL_USER_ID</column-name></cmp-field>
             <cmp-field><field-name><field-name>adminApprovalDtm</field-name><column-name>ADMIN_APPROVAL_DTM</column-name></cmp-field>
             <cmp-field><field-name><field-name>bidStartDtm</field-name><column-name>BID_START_DTM</column-name></cmp-field>
             <cmp-field><field-name><field-name>bidEndDtm</field-name><column-name>BID_END_DTM</column-name></cmp-field>
             <cmp-field><field-name><field-name>closeDtm</field-name><column-name>CLOSE_DTM</column-name></cmp-field>
             <cmp-field><field-name><field-name>hideDtm</field-name><column-name>HIDE_DTM</column-name></cmp-field>
             <cmp-field><field-name><field-name>dealDesc</field-name><column-name>DEAL_DESC</column-name></cmp-field>
             <cmp-field><field-name><field-name>creditRatingTxt</field-name><column-name>CREDIT_RATING_TXT</column-name></cmp-field>
             <cmp-field><field-name><field-name>amountCurrencyCd</field-name><column-name>AMOUNT_CURRENCY_CD</column-name></cmp-field>
             <cmp-field><field-name><field-name>quantity</field-name><column-name>QUANTITY</column-name></cmp-field>
             <cmp-field><field-name><field-name>quantityUomId</field-name><column-name>QUANTITY_UOM_ID</column-name></cmp-field>
             <cmp-field><field-name><field-name>dealFrozenFlag</field-name><column-name>DEAL_FROZEN_FLAG</column-name></cmp-field>
             <cmp-field><field-name><field-name>inviteeEmailMessageTxt</field-name><column-name>INVITEE_EMAIL_MESSAGE_TXT</column-name></cmp-field>
             <cmp-field><field-name><field-name>issuingEntityLegalName</field-name><column-name>ISSUING_ENTITY_LEGAL_NAME</column-name></cmp-field>
             <cmp-field><field-name><field-name>invitedTotalAmt</field-name><column-name>INVITED_TOTAL_AMT</column-name></cmp-field>
             <cmp-field><field-name><field-name>invitedTotalCnt</field-name><column-name>INVITED_TOTAL_CNT</column-name></cmp-field>
             <unknown-pk>
             <unknown-pk-class>java.lang.Integer</unknown-pk-class>
             <field-name>dealId</field-name>
             <column-name>DEAL_ID</column-name>
             <jdbc-type>INTEGER</jdbc-type>
             <sql-type>NUMBER(10)</sql-type>
             </unknown-pk>
            
            
             <entity-command name="keygen">
             <attribute name="sequence">deal_seq</attribute>
             </entity-command>
            </entity>
            


            Let me know if I can give you anymore info. Thanks for taking the time to look at it.


            • 3. Re: Entity EJB - DataSource
              Darran Lofthouse Master

              The file name should be 'jbosscmp-jdbc.xml'.

              • 4. Re: Entity EJB - DataSource
                Evan Nail Newbie

                Ahh man . Talk about stupid mistakes.

                Dang I thought it just looked for the cmp-jdbc kind of like the ds.xml on the datasource stuff.

                Sigh..I'll just skulk away now embarassed