8 Replies Latest reply on Apr 29, 2002 10:39 AM by downingdn

    Blackbox resource adapter

    repa

      Hi

      I am using JBoss vesion 2.4.4.
      I try to deploy Sun's blackbox-tx.rar RA and got following error message:

      [java] [INFO,AutoDeployer] Auto deploy of file:/C:/APPS/JBossTomcat/jboss/d
      eploy/lib/cciblackbox-tx.rar
      [java] [INFO,RARDeployer] Attempting to deploy RAR at 'file:/C:/APPS/JBossT
      omcat/jboss/deploy/lib/cciblackbox-tx.rar'
      [java] [ERROR,RARDeployer] deploy failure
      [java] java.io.FileNotFoundException: C:\APPS\JBossTomcat\jboss\tmp\deploy\
      RARDeployer\rar.0\META-INF\ra.xml (The system cannot find the path specified)
      [java] at java.io.FileOutputStream.open(Native Method)
      [java] at java.io.FileOutputStream.(FileOutputStream.java:102)
      [java] at java.io.FileOutputStream.(FileOutputStream.java:62)
      [java] at java.io.FileOutputStream.(FileOutputStream.java:132)
      [java] at org.jboss.resource.RARDeployer.inflateJar(RARDeployer.java:47
      6)
      [java] at org.jboss.resource.RARDeployer.deploy(RARDeployer.java:272)
      [java] at org.jboss.deployment.DeployerMBeanSupport.deploy(DeployerMBea
      nSupport.java:70)
      [java] at java.lang.reflect.Method.invoke(Native Method)
      [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl
      .java:1628)
      [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl
      .java:1523)
      [java] at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:39
      5)
      [java] at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:233)
      [java] at org.jboss.deployment.AutoDeployer.startService(AutoDeployer.j
      ava:371)
      [java] at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.
      java:103)
      [java] at java.lang.reflect.Method.invoke(Native Method)
      [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl
      .java:1628)
      [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl
      .java:1523)
      [java] at org.jboss.configuration.ConfigurationService$ServiceProxy.inv
      oke(ConfigurationService.java:967)
      [java] at $Proxy0.start(Unknown Source)
      [java] at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
      [java] at java.lang.reflect.Method.invoke(Native Method)
      [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl
      .java:1628)
      [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl
      .java:1523)
      [java] at org.jboss.Main.(Main.java:208)
      [java] at org.jboss.Main$1.run(Main.java:110)
      [java] at java.security.AccessController.doPrivileged(Native Method)
      [java] at org.jboss.Main.main(Main.java:106)
      [java] [ERROR,AutoDeployer] DeploymentInfo failed:file:/C:/APPS/JBossTomcat
      /jboss/deploy/lib/cciblackbox-tx.rar
      [java] java.io.FileNotFoundException: C:\APPS\JBossTomcat\jboss\tmp\deploy\
      RARDeployer\rar.0\META-INF\ra.xml (The system cannot find the path specified)
      [java] at java.io.FileOutputStream.open(Native Method)
      [java] at java.io.FileOutputStream.(FileOutputStream.java:102)
      [java] at java.io.FileOutputStream.(FileOutputStream.java:62)
      [java] at java.io.FileOutputStream.(FileOutputStream.java:132)
      [java] at org.jboss.resource.RARDeployer.inflateJar(RARDeployer.java:47
      6)
      [java] at org.jboss.resource.RARDeployer.deploy(RARDeployer.java:272)
      [java] at org.jboss.deployment.DeployerMBeanSupport.deploy(DeployerMBea
      nSupport.java:70)
      [java] at java.lang.reflect.Method.invoke(Native Method)
      [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl
      .java:1628)
      [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl
      .java:1523)
      [java] at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:39
      5)
      [java] at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:233)
      [java] at org.jboss.deployment.AutoDeployer.startService(AutoDeployer.j
      ava:371)
      [java] at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.
      java:103)
      [java] at java.lang.reflect.Method.invoke(Native Method)
      [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl
      .java:1628)
      [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl
      .java:1523)
      [java] at org.jboss.configuration.ConfigurationService$ServiceProxy.inv
      oke(ConfigurationService.java:967)
      [java] at $Proxy0.start(Unknown Source)
      [java] at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
      [java] at java.lang.reflect.Method.invoke(Native Method)
      [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl
      .java:1628)



      Here is part of my jboss.jcml -file.



      <!-- Connection factory for the blabckbox-cci.rar resource adapter. . -->

      eis/CCIBB
      JCA:service=RARDeployer

      CciBlackBoxLocalTx


      ConnectionURL=jdbc:oracle:thin:@hrm017:1521:devT0


      MinervaSharedLocalCMFactory

      <!-- See the documentation for the specific connection manager
      implementation you are using for the properties you can set -->

      # Pool type - uncomment to force, otherwise it is the default
      #PoolConfiguration=per-factory

      # Connection pooling properties - see
      # org.jboss.pool.PoolParameters
      MinSize=0
      MaxSize=10
      Blocking=true
      GCEnabled=false
      IdleTimeoutEnabled=false
      InvalidateOnError=false
      TrackLastUsed=false
      GCIntervalMillis=120000
      GCMinIdleMillis=1200000
      IdleTimeoutMillis=1800000
      MaxIdleTimeoutPercent=1.0

      <!-- Principal mapping configuration -->

      org.jboss.resource.security.ManyToOnePrincipalMapping


      userName=
      password=



        • 1. Re: Blackbox resource adapter
          downingdn

          Hi Repa -

          I *think* this might be due to the RARDeployer not recursively unzipping directories inside of the .rar file.

          It looks as though this was fixed in rev 1.25 of RARDeployer.java by d_jencks and provided by Larry Sanderson. (See http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/jbosscx/src/main/org/jboss/resource/RARDeployer.java?r1=1.25).

          Now I have two follow-up questions for other people, if this is indeed the case:
          1. What version of JBOSS is that in 2.4.5 or 3.0?
          Or more generally, how do I find out what version of a dev branch file is in the prod branch of a given version of JBOSS)
          2. Is there any way to manually deploy a RAR file?

          Thanks

          • 2. Re: Blackbox resource adapter
            downingdn

            OK. I answered my own question...

            For manual deployment of RAR, follow these steps:

            INSTALLATION OF RAR IN JBOSS
            stop jboss
            copy cciblackbox-tx.rar to cciblackbox-tx-jboss.rar
            cd %JBOSS_HOME%\jboss\deploy\lib
            unzip cciblackbox-tx-jboss.rar to directory cciblackbox-tx.rar
            start jboss

            • 3. Re: Blackbox resource adapter
              davidjencks

              You guys are both running into a highly unusual problem. Autodeployment of packed rars has worked since about version 2.3, certainly every binary version since then, and every cvs version I have looked at: before I made autodeployment happen, packed rars were deployed "by hand" through the jmx interface. JBoss 3 would not get very far without autodeployment of rars, all db access is through jca wrappers. There is a sample datasource using a wrapper in the 2.4.x jboss.jcml, again set up with an autodeployed rar.

              Perhaps there is something odd about the particular rar you are trying to deploy. Could you tell me exactly where it came from?

              To find out what version of a file is in which release, consult the cvs log for the file, easily viewed on the web from the sourceforge site. Look at the tags and branch tags.

              • 4. Re: Blackbox resource adapter
                repa

                I am using Sun's cciblackbox-tx.rar adapter. I got it deployed by following instructionS that downingdn sent.
                Now the problem is that my program can not find the adapter when making lookup. I think that my RA newer get's bound to JNDI. I can not see it in JNDIview. But I can not see any errormessages in server log either.
                My program can find the example RA JmsXA, but not CciBB (I even changed it's name from eis/CCIBB to CciBB according to JmsXA).

                Here is the code how I am doing lookup.

                Context ic = new InitialContext();
                connectionFactory = (ConnectionFactory) ic.lookup("java:/CciBB");

                Here is some logging from starting jboss server:

                [java] [org.jboss.resource.ConnectionFactoryLoader.JmsXA,2002-04-28 13:49:5
                0,556,DEBUG] org.jboss.logging.Logger.JBossMain (Logger.java:106) - Binding obje
                ct 'org.jboss.jms.ra.JmsConnectionFactoryImpl@5d616e' into JNDI at 'java:/JmsXA'

                [java] [org.jboss.resource.ConnectionFactoryLoader.JmsXA,2002-04-28 13:49:5
                0,556,INFO ] org.jboss.logging.Logger.JBossMain (Logger.java:133) - Bound connec
                tion factory for resource adapter 'JMS Adapter' to JNDI name 'java:/JmsXA'
                [java] [org.jboss.resource.ConnectionFactoryLoader.CciBB,2002-04-28 13:49:5
                0,556,DEBUG] org.jboss.logging.Logger.JBossMain (Logger.java:106) - Evaluating n
                otification type='org.jboss.resource.deployment.deploy', message='JMS Adapter'
                [java] [org.jboss.ejb.AutoDeployer,2002-04-28 13:49:50,596,INFO ] org.jboss
                .logging.Logger.JBossMain (Logger.java:133) - Auto deploy of file:/C:/APPS/JBoss
                Tomcat/jboss/deploy/lib/jbosspool-jdbc.rar
                [java] [org.jboss.resource.RARDeployer,2002-04-28 13:49:50,596,INFO ] org.j
                boss.logging.Logger.JBossMain (Logger.java:133) - Attempting to deploy RAR at 'f
                ile:/C:/APPS/JBossTomcat/jboss/deploy/lib/jbosspool-jdbc.rar'
                [java] [org.jboss.resource.RARMetaData,2002-04-28 13:49:50,896,DEBUG] org.j
                boss.logging.Logger.JBossMain (Logger.java:106) - methodName = 'setDisplayName'
                [java] [org.jboss.resource.RARMetaData,2002-04-28 13:49:50,896,DEBUG] org.j
                boss.logging.Logger.JBossMain (Logger.java:106) - methodName = 'setDescription'


                Here is my ra.xml:

                <?xml version="1.0" encoding="UTF-8"?>
                <!DOCTYPE connector PUBLIC '-//Sun Microsystems, Inc.//DTD Connector 1.0//EN' 'http://java.sun.com/dtd/connector_1_0.dtd'>

                <display-name>CciBlackBoxLocalTx</display-name>
                <vendor-name>JavaSoft</vendor-name>
                <spec-version>1.0.1</spec-version>
                <eis-type>JDBC Database</eis-type>
                1.0.1

                <managedconnectionfactory-class>com.sun.connector.cciblackbox.CciLocalTxManagedConnectionFactory</managedconnectionfactory-class>
                <connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
                <connectionfactory-impl-class>com.sun.connector.cciblackbox.CciConnectionFactory</connectionfactory-impl-class>
                <connection-interface>javax.resource.cci.Connection</connection-interface>
                <connection-impl-class>com.sun.connector.cciblackbox.CciConnection</connection-impl-class>
                <transaction-support>LocalTransaction</transaction-support>
                <config-property>
                <config-property-name>ConnectionURL</config-property-name>
                <config-property-type>java.lang.String</config-property-type>
                <config-property-value>jdbc:oracle:thin:@hrm017:1521:devT0</config-property-value>
                </config-property>
                <authentication-mechanism>
                <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
                <credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
                </authentication-mechanism>
                <reauthentication-support>false</reauthentication-support>



                Can somebody give me detailed step by step instructions for deploying this.


                • 5. Re: Blackbox resource adapter
                  davidjencks

                  1. Don't change the ra.xml that comes with a resource adapter. Put configuration properties in a ConnectionFactoryLoader mbean in jboss.jcml (jboss 2.4.x) or a ConnectionManager/RARDeployment mbean ***-service.xml (jboss 3.x)

                  2. Do tell me where you got the resource adapter from if you want me to respond to any more of your posts. (For instance, I recently learned that there are some antique versions somewhere on the jboss website that won't deploy.)

                  3. You might try putting the resource adapter name on the same line as its tags with no spaces in jboss.jcml. Some versions of the deployer may not have done a lot of whitespace trimming.

                  • 6. Re: Blackbox resource adapter
                    repa

                    I got the cciblackbox-tx.rar adapter with j2sdkee version 1.3.1. It is in library C:\j2sdkee1.3.1\lib\connector.

                    I started it all again with the original adapter with original ra.xml, but the result was the same. I tried also the other adapters which came with j2sdkee. Got same answer with them all.

                    Here is what I did:

                    1. Copied adapter into jboss/deploy/lib folder.
                    ra.xml is following:

                    <?xml version="1.0" encoding="UTF-8"?>

                    <!DOCTYPE connector PUBLIC '-//Sun Microsystems, Inc.//DTD Connector 1.0//EN' 'http://java.sun.com/dtd/connector_1_0.dtd'>


                    <display-name>CciBlackBoxLocalTx</display-name>
                    <vendor-name>Java Software</vendor-name>
                    <spec-version>1.0</spec-version>
                    <eis-type>JDBC Database</eis-type>
                    1.0

                    <managedconnectionfactory-class>com.sun.connector.cciblackbox.CciLocalTxManagedConnectionFactory</managedconnectionfactory-class>
                    <connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
                    <connectionfactory-impl-class>com.sun.connector.cciblackbox.CciConnectionFactory</connectionfactory-impl-class>
                    <connection-interface>javax.resource.cci.Connection</connection-interface>
                    <connection-impl-class>com.sun.connector.cciblackbox.CciConnection</connection-impl-class>
                    <transaction-support>LocalTransaction</transaction-support>
                    <config-property>
                    <config-property-name>ConnectionURL</config-property-name>
                    <config-property-type>java.lang.String</config-property-type>
                    <config-property-value>jdbc:cloudscape:rmi:CloudscapeDB;create=true</config-property-value>
                    </config-property>
                    <authentication-mechanism>
                    <authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
                    <credential-interface>javax.resource.security.PasswordCredential</credential-interface>
                    </authentication-mechanism>
                    <reauthentication-support>false</reauthentication-support>





                    2. Added into jboss.jclm following

                    <!-- cciblackbox-tx.rar resource adapter -->

                    CciBB
                    JCA:service=RARDeployer
                    CciBlackBoxLocalTx
                    MinervaSharedLocalCMFactory
                    <!-- See the documentation for the specific connection manager
                    implementation you are using for the properties you can set -->

                    # Pool type - uncomment to force, otherwise it is the default
                    #PoolConfiguration=per-factory

                    # Connection pooling properties - see
                    # org.jboss.pool.PoolParameters
                    MinSize=0
                    MaxSize=10
                    Blocking=true
                    GCEnabled=false
                    IdleTimeoutEnabled=false
                    InvalidateOnError=false
                    TrackLastUsed=false
                    GCIntervalMillis=120000
                    GCMinIdleMillis=1200000
                    IdleTimeoutMillis=1800000
                    MaxIdleTimeoutPercent=1.0

                    <!-- Principal mapping configuration -->
                    org.jboss.resource.security.ManyToOnePrincipalMapping



                    3. Started jboss server and here is what I got:

                    [java] [INFO,AutoDeployer] Watching directory: C:\APPS\JBossTomcat\jboss\deploy
                    [java] [ERROR,RARDeployer] deploy failure
                    [java] [INFO,AutoDeployer] Watching directory: C:\APPS\JBossTomcat\jboss\deploy\lib
                    [java] java.io.FileNotFoundException: C:\APPS\JBossTomcat\jboss\tmp\deploy\RARDeployer\rar.0\ME
                    TA-INF\ra.xml (The system cannot find the path specified)
                    [java] at java.io.FileOutputStream.open(Native Method)
                    [java] [INFO,AutoDeployer] Auto deploy of file:/C:/APPS/JBossTomcat/jboss/deploy/lib/cciblackbo
                    x-tx.rar
                    [java] [INFO,RARDeployer] Attempting to deploy RAR at 'file:/C:/APPS/JBossTomcat/jboss/deploy/l
                    ib/cciblackbox-tx.rar'
                    [java] at java.io.FileOutputStream.(FileOutputStream.java:102)
                    [java] at java.io.FileOutputStream.(FileOutputStream.java:62)
                    [java] at java.io.FileOutputStream.(FileOutputStream.java:132)
                    [java] at org.jboss.resource.RARDeployer.inflateJar(RARDeployer.java:476)
                    [java] at org.jboss.resource.RARDeployer.deploy(RARDeployer.java:272)
                    [java] at org.jboss.deployment.DeployerMBeanSupport.deploy(DeployerMBeanSupport.java:70)
                    [java] at java.lang.reflect.Method.invoke(Native Method)
                    [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                    [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                    [java] at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:395)
                    [java] at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:233)
                    [java] at org.jboss.deployment.AutoDeployer.startService(AutoDeployer.java:371)
                    [java] at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103)
                    [java] at java.lang.reflect.Method.invoke(Native Method)
                    [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                    [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                    [java] at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationSer
                    vice.java:967)
                    [java] at $Proxy0.start(Unknown Source)
                    [java] at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
                    [java] at java.lang.reflect.Method.invoke(Native Method)
                    [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                    [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                    [java] at org.jboss.Main.(Main.java:208)
                    [java] at org.jboss.Main$1.run(Main.java:110)
                    [java] at java.security.AccessController.doPrivileged(Native Method)
                    [java] at org.jboss.Main.main(Main.java:106)
                    [java] [ERROR,AutoDeployer] DeploymentInfo failed:file:/C:/APPS/JBossTomcat/jboss/deploy/lib/cc
                    iblackbox-tx.rar
                    [java] java.io.FileNotFoundException: C:\APPS\JBossTomcat\jboss\tmp\deploy\RARDeployer\rar.0\ME
                    TA-INF\ra.xml (The system cannot find the path specified)
                    [java] at java.io.FileOutputStream.open(Native Method)
                    [java] at java.io.FileOutputStream.(FileOutputStream.java:102)
                    [java] at java.io.FileOutputStream.(FileOutputStream.java:62)
                    [java] at java.io.FileOutputStream.(FileOutputStream.java:132)
                    [java] at org.jboss.resource.RARDeployer.inflateJar(RARDeployer.java:476)
                    [java] at org.jboss.resource.RARDeployer.deploy(RARDeployer.java:272)
                    [java] at org.jboss.deployment.DeployerMBeanSupport.deploy(DeployerMBeanSupport.java:70)
                    [java] at java.lang.reflect.Method.invoke(Native Method)
                    [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                    [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                    [java] at org.jboss.deployment.AutoDeployer.deploy(AutoDeployer.java:395)
                    [java] at org.jboss.deployment.AutoDeployer.run(AutoDeployer.java:233)
                    [java] at org.jboss.deployment.AutoDeployer.startService(AutoDeployer.java:371)
                    [java] at org.jboss.util.ServiceMBeanSupport.start(ServiceMBeanSupport.java:103)
                    [java] at java.lang.reflect.Method.invoke(Native Method)
                    [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)
                    [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
                    [java] at org.jboss.configuration.ConfigurationService$ServiceProxy.invoke(ConfigurationSer
                    vice.java:967)
                    [java] at $Proxy0.start(Unknown Source)
                    [java] at org.jboss.util.ServiceControl.start(ServiceControl.java:79)
                    [java] at java.lang.reflect.Method.invoke(Native Method)
                    [java] at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1628)

                    • 7. Re: Blackbox resource adapter
                      repa

                      Some more information. I have a book JBoss Administration and Development and there is an example of deploying and RA in chapter 7. I tried that and it went ok. Also both of the example adapters, jbosspool-jdbc.rar and jms-ra.rar which came with JBoss, work fine. The problem exists only with Sun's RI blackbox adapters. Has anybody got them deployed?

                      • 8. Re: Blackbox resource adapter
                        downingdn

                        Yes! We just got our Blackbox deployed.

                        Errors and fixes were:
                        1. CANNOT DEPLOY .RAR
                        I used jar to extract and then recreate the jar file and it all seemed to work fine. Weird.
                        (Previous workaround was to unzip this and deploy manually - see previous email.)

                        2. JBOSS.JCML
                        These are the seetings I used in our JBOSS.JCML...
                        <!-- CCIBlackboxTx ConnectionFactory -->

                        CCIBB
                        JCA:service=RARDeployer
                        CciBlackBoxLocalTx

                        MinervaSharedLocalCMFactory
                        <!-- See the documentation for the specific connection manager
                        implementation you are using for the properties you can set -->


                        ConnectionURL=<enter your jdbc connection ref here>


                        <!-- Principal mapping configuration -->

                        org.jboss.resource.security.ManyToOnePrincipalMapping


                        userName=<enter your username here>
                        password=<enter your password here>



                        One of the problems we had here is that:
                        - ResourceAdapterName must be EXACTLY the same as in the ra.xml field display-name
                        - FactoryName is the name of the JNDI reference, which is then bound into JNDI tree as java:/CCIBB
                        - for RARDeployer, field ,name does not have to be the same as the JNDI reference

                        Here is an example of a successful deploy:
                        ============================
                        Auto deploy of file:/C:/APPS/JBossTomcat/jboss/deploy/lib/cciblackbox-tx.rar
                        Attempting to deploy RAR at 'file:/C:/APPS/JBossTomcat/jboss/deploy/lib/cciblackbox-tx.rar'
                        Bound connection factory for resource adapter 'CciBlackBoxLocalTx' to JNDI name 'java:/CCIBB'
                        ============================

                        Note: this was a JCA 1.01 blackbox connector, plus some custom modifications to get stored procedures working against the Oracle database.

                        I hope that works for you!