4 Replies Latest reply on Aug 23, 2004 7:39 AM by ralf.siedow

    3.2.5 + JCA + CCIBlackBox

    deguoren

      Hi,

      I'm a newbie to JCA and I'm trying to run Sun's CCIBlackBox-Adaptor from J2EE SDK 1.3.1 to see how things are working before implementing an OPC adapter.
      I copied the RAR into the deploy folder and created a -ds.xml file according to the FAQ:


      <datasources>
       <local-tx-datasource>
       <adapter-display-name>CciBlackBoxLocalTx</adapter-display-name>
       <jndi-name>eis/CciBlackBoxLocalTx</jndi-name>
       <connection-url>jdbc:mysql://localhost:3306/sphinx_emp</connection-url>
       <driver-class>com.mysql.jdbc.Driver</driver-class>
       <user-name>sphinx_emp</user-name>
       <password>sphinx_emp</password>
       </local-tx-datasource>
      
      </datasources>


      The EJB descriptors are extended using the following xdoclet-tags:

      * @ejb.resource-ref jndi-name = "eis/CciBlackBoxLocalTx"
       * res-auth = "Container"
       * res-ref-name = "CciBlackBoxLocalTx"
       * res-type = "javax.resource.cci.ConnectionFactory"
       *
       * @jboss.resource-ref jndi-name = "eis/CciBlackBoxLocalTx"
       * resource-name = "CciBlackBoxLocalTx"
       * res-ref-name = "CciBlackBoxLocalTx"
      
      


      During deployment, everything seems to go well:

      11:44:33,311 INFO [eis/CciBlackBoxLocalTx] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=eis/CciBlackBoxLocalTx to JNDI name 'java:/eis/CciBlackBoxLocalTx'
      


      But I can't access the adapter using the following code:

      try
       {
       Context initCtx = new InitialContext();
       javax.resource.cci.ConnectionFactory cf = (javax.resource.cci.ConnectionFactory)initCtx.lookup( "java:comp/env/eis/CciBlackBoxLocalTx");
      


      The following exception is thrown:

      11:48:00,577 INFO [STDOUT] javax.naming.NameNotFoundException: eis not bound
      11:48:00,577 INFO [STDOUT] at
      
      ....
      
      


      I guess something is wrong with one of the descriptor files, but I couldn't find an example which is using cci, searching the forum and google. Any hints?

        • 1. Re: 3.2.5 + JCA + CCIBlackBox
          ralf.siedow

           

          "deguoren" wrote:
          Hi,
          try
           {
           Context initCtx = new InitialContext();
           javax.resource.cci.ConnectionFactory cf = (javax.resource.cci.ConnectionFactory)initCtx.lookup( "java:comp/env/eis/CciBlackBoxLocalTx");
          


          The following exception is thrown:

          11:48:00,577 INFO [STDOUT] javax.naming.NameNotFoundException: eis not bound
          11:48:00,577 INFO [STDOUT] at
          
          ....
          
          



          Did you try java:eis/CciBlackBoxLocalTx or java:/eis/CciBlackBoxLocalTx to lookup it?

          • 2. Re: 3.2.5 + JCA + CCIBlackBox
            matze79

            Hi, I tried all variations :-)

            CciBlackBoxLocalTx
            eis/CciBlackBoxLocalTx
            java:CciBlackBoxLocalTx
            java:eis/CciBlackBoxLocalTx
            java:/CciBlackBoxLocalTx
            java:/eis/CciBlackBoxLocalTx
            java:comp/env/CciBlackBoxLocalTx
            java:comp/env/eis/CciBlackBoxLocalTx
            java:/comp/env/CciBlackBoxLocalTx
            java:/comp/env/eis/CciBlackBoxLocalTx

            unfortunately, nothing works :-(

            but I found another warning, which occurs while deploying my application (if I only deploy the app, it doesn't occur)

            18:15:20,858 WARN [StatelessSessionContainer] No resource manager found for CciBlackBoxLocalTx

            But I found nothing about configuration of an resource manager for a JCA-Adapter and there is almost nothing about running an adapter implementing CCI on JBoss 3.2 on the web (only few for 2.4 and 3.0)... so where is the clue?

            Thanks in advance!

            • 3. Re: 3.2.5 + JCA + CCIBlackBox
              ralf.siedow

              Hi,

              "matze79" wrote:
              but I found another warning, which occurs while deploying my application (if I only deploy the app, it doesn't occur)

              18:15:20,858 WARN [StatelessSessionContainer] No resource manager found for CciBlackBoxLocalTx


              you could try to include the rar-name - tag in your -ds.xml. Mine (for JBoss 4) looks like that:
              <?xml version="1.0" encoding="UTF-8"?>
              
              <connection-factories>
               <no-tx-connection-factory>
               <jndi-name>ra/TestAdapter</jndi-name>
               <rar-name>TestRA.rar</rar-name>
               <connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
               <max-pool-size>1</max-pool-size>
               </no-tx-connection-factory>
              </connection-factories>
              


              I think in JBoss 3.2 you must still include the display-name ... this is not necessary in JBoss 4.
              Don't put the *-ds.xml in your RAR-File. Deploy it seperately.

              • 4. Re: 3.2.5 + JCA + CCIBlackBox
                ralf.siedow

                Regarding resource managers: a jboss.xml for a MDB looks in my case like the following. But I didn't figure out yet, if the resource-manager part is necessery.

                <?xml version="1.0" encoding="UTF-8"?>
                <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">
                
                <jboss>
                
                 <resource-managers>
                 <resource-manager>
                 <res-name>Test Adapter</res-name>
                 <res-jndi-name>java:ra/TestAdapter</res-jndi-name>
                 </resource-manager>
                 </resource-managers>
                
                 <enterprise-beans>
                 <message-driven>
                 <ejb-name>TestInfoBean</ejb-name>
                 <resource-adapter-name>TestRA.rar</resource-adapter-name>
                 <destination-jndi-name></destination-jndi-name>
                 </message-driven>
                 </enterprise-beans>
                
                </jboss>