7 Replies Latest reply: Feb 18, 2012 11:32 PM by jaikiran pai RSS

    resource adapter JCA, exception when i lookup the jndi-name

    Christian Avalos Newbie

      im trying to deploy a tuxedo jca adapter , but i cant get the connection by jndi, i get an exception when i lookup the jndi name

       

      the ra.xml inside rar file is  :

       

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

      <connector xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"

          version="1.5">

          <display-name>Tuxedo JCA Adapter verso</display-name>

          <vendor-name>Oracle</vendor-name>

          <eis-type>Tuxedo</eis-type>

          <resourceadapter-version>11gR1(11.1.1.2.1)</resourceadapter-version>

          <license>

              <description>Tuxedo SALT license</description>

              <license-required>false</license-required>

          </license>

          <resourceadapter>

              <resourceadapter-class>com.oracle.tuxedo.adapter.TuxedoClientSideResourceAdapter</resourceadapter-class>

       

              <config-property>

                  <config-property-name>traceLevel</config-property-name>

                  <config-property-type>java.lang.String</config-property-type>

                  <config-property-value>100000</config-property-value>

              </config-property>

       

              <config-property>

                  <config-property-name>xaAffinity</config-property-name>

                  <config-property-type>java.lang.String</config-property-type>

                  <config-property-value>true</config-property-value>

              </config-property>

              <config-property>

                  <config-property-name>appManagedLocalTxTimeout</config-property-name>

                  <config-property-type>java.lang.Integer</config-property-type>

                  <config-property-value>15</config-property-value>

              </config-property>

              <config-property>

       

       

                  <description>local access point specification of the format

                          //hostname:port/domainId=DOMAINID</description>

                  <config-property-name>localAccessPointSpec</config-property-name>

                  <config-property-type>java.lang.String</config-property-type>

                  <config-property-value>//192.168.19.1:9999/domainId=jcaTux</config-property-value>

              </config-property>

       

              <config-property>

                  <description>factory-wise RemoteAccessPoint specification of the

                          format //hostname:port/domainId=DOMAINID</description>

                  <config-property-name>remoteAccessPointSpec</config-property-name>

                  <config-property-type>java.lang.String</config-property-type>

                  <config-property-value>//192.168.19.2:8888/domainId=Gdomtux</config-property-value>

       

              </config-property>

             

       

             

       

             

             

              <outbound-resourceadapter>

                  <connection-definition>

                      <managedconnectionfactory-class>com.oracle.tuxedo.adapter.spi.TuxedoManagedConnectionFactory</managedconnectionfactory-class>

                      <connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>

                      <connectionfactory-impl-class>com.oracle.tuxedo.adapter.cci.TuxedoConnectionFactory</connectionfactory-impl-class>

                      <connection-interface>javax.resource.cci.Connection</connection-interface>

                      <connection-impl-class>com.oracle.tuxedo.adapter.cci.TuxedoJCAConnection</connection-impl-class>

                  </connection-definition>

                  <!-- <transaction-support>NoTransaction</transaction-support> <transaction-support>LocalTransaction</transaction-support> -->

                  <transaction-support>XATransaction</transaction-support>

                  <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>

              </outbound-resourceadapter>

          </resourceadapter>

      </connector>

       

      my standalone.xml descriptor is :

       

      <resource-adapter>

      <archive>

      com.oracle.tuxedo.TuxedoAdapter.rar

      </archive>

      <transaction-support>

      NoTransaction

      </transaction-support>

      <connection-definitions>

      <connection-definition class-name="com.oracle.tuxedo.adapter.spi.TuxedoManagedConnectionFactory"

              jndi-name="eis/TuxedoConnectionFactory" enabled="true"  use-java-context="false" />

      </connection-definitions>

      </resource-adapter>

       

      i have no error when deploy the rar, the log says that the communication is right , but when i try to lookup de connection factory

       

      ctx = new InitialContext();

      cf   = (TuxedoConnectionFactory) ctx.lookup("eis/TuxedoConnectionFactory");

       

      i get a javax.naming.NameNotFoundException: eis not bound.

        • 1. Re: resource adapter JCA, exception when i lookup the jndi-name
          Prasad Deshpande Expert

          <connection-definition class-name="com.oracle.tuxedo.adapter.spi.TuxedoManagedConnectionFactory"

                  jndi-name="eis/TuxedoConnectionFactory" enabled="true"  use-java-context="false" />

          </connection-definitions>

          7.1 won't let you bind custom namespace (eis in your case) that doesn't start with java:/ In your case, it's very unlikely that eis/TuxedoConnectionFactory is bound to that jndi. I'd suggest try using/binding to "java:/eis/TuxedoConnectionFactory" & then lookup likewise.. or may be "java:jboss/eis/TuxedoConnectionFactory" etc...

          • 2. Re: resource adapter JCA, exception when i lookup the jndi-name
            Christian Avalos Newbie

            Thank Prasad for your reply, but still have the same error, when i change my descriptor to java:jboss/eis/TuxedoConnectionFactory, the naming exception says jboss not bound , and when i change to "java:/eis/TuxedoConnectionFactory" eis not bound

             

            i dont see the resource adapter in jndi tree in jmx console , but i see a "tuxedo" name , but in global, and is not a Connection factory ,

             

            Global JNDI namespace

            +- tuxedo (Class: org.jnp.interfaces.NamingContext)

             

            any ideas?

             

            thanks

            • 3. Re: resource adapter JCA, exception when i lookup the jndi-name
              Prasad Deshpande Expert

              CR1 seems to have fixed this issue.. https://issues.jboss.org/browse/AS7-2075


              Thank Prasad for your reply, but still have the same error, when i change my descriptor to java:jboss/eis/TuxedoConnectionFactory, the naming exception says jboss not bound , and when i change to "java:/eis/TuxedoConnectionFactory" eis not bound

              I'm surprised it says java:jboss not bound... Where are you trying to lookup this? Have you tried looking up with java:jboss/jca/tuxedo as in above link? Also, have a look at this one.. https://community.jboss.org/message/630897  is it your case too?

              • 4. Re: resource adapter JCA, exception when i lookup the jndi-name
                Christian Avalos Newbie

                im using jboss 5.1 , and i havent problemn when deploying the connector , its seem that my standalone.xml doesnt anything, dont integrate with jboss.

                the adapter works well and the connection is stablished ,

                when im deploying the rar the jboss log says :

                 

                2012-02-13 12:19:29,346 INFO  [STDOUT] (main) TuxedoClientSideResourceAdapter.setRapAllowAnonymous() called:true

                2012-02-13 12:19:29,370 INFO  [STDOUT] (main) Tuxedo JCA Adapter is being started...

                2012-02-13 12:19:29,403 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) Tuxedo JCA Adapter, release 11gR1(11.1.1.2.1), resource archive version 1.1.0.0, build date: October 29 2010.

                2012-02-13 12:19:29,472 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) INFO: RemoteAccessPoint Gdomtux created.

                2012-02-13 12:19:29,474 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) INFO: Use Local to create default session profile property CredentialPolicy.

                2012-02-13 12:19:29,475 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) INFO: Use 0 to create default session profile property MinEncryptBits.

                2012-02-13 12:19:29,475 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) INFO: Use 128 to create default session profile property MaxEncryptBits.

                2012-02-13 12:19:29,476 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) INFO: Use NONE to create default session profile property Security.

                2012-02-13 12:19:29,477 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) INFO: Use ON_STARTUP to create default session profile property ConnectionPolicy.

                2012-02-13 12:19:29,478 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) INFO: Use 60,000 to create default session profile property BlockTime.

                2012-02-13 12:19:29,479 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) INFO: Use false to create default session profile property Interoperate.

                2012-02-13 12:19:29,480 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) INFO: Use 3,600,000 to create default session profile property RetryInterval.

                2012-02-13 12:19:29,480 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) INFO: Use 7,208,000 to create default session profile property MaxRetries.

                2012-02-13 12:19:29,481 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) INFO: Use 2,147,483,647 to create default session profile property CompressionLimit.

                2012-02-13 12:19:29,482 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) INFO: Use 0 to create default session profile property KeepAlive.

                2012-02-13 12:19:29,483 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) INFO: Use 10,000 to create default session profile property KeepAliveWait.

                2012-02-13 12:19:29,485 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) INFO: Default session profile created.

                2012-02-13 12:19:29,609 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) INFO: Default session created between LocalAccessPoint jcaTux and RemoteAccessPoint Gdomtux.

                2012-02-13 12:19:29,613 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) factory = null

                2012-02-13 12:19:29,614 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) name    = QSPACETEST

                2012-02-13 12:19:29,614 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) iname   = QSPACETEST

                2012-02-13 12:19:29,615 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) rsvc == null, create new ArrayList with key= QSPACETEST

                2012-02-13 12:19:29,619 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) INFO: Imported resource QSPACETEST created.

                2012-02-13 12:19:29,621 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) factory = null

                2012-02-13 12:19:29,622 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) name    = STRING

                2012-02-13 12:19:29,622 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) iname   = STRING

                2012-02-13 12:19:29,623 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) rsvc == null, create new ArrayList with key= STRING

                2012-02-13 12:19:29,624 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (main) INFO: Imported resource STRING created.

                2012-02-13 12:19:29,625 INFO  [STDOUT] (main) Tuxedo JCA Adapter is started

                2012-02-13 12:19:30,018 INFO  [STDOUT] (WorkManager(2)-1) <Mon Feb 13 12:19:30 ART 2012> <Debug> <WTC> <BEA-180072> <+++++ /tplle/crypFinishOne/send_key(16) +++++>

                2012-02-13 12:19:30,047 INFO  [STDOUT] (WorkManager(2)-1) <Mon Feb 13 12:19:30 ART 2012> <Debug> <WTC> <BEA-180113> <BE 56 BF 89 48 51 1C 18 BD 0A 00 05 E4 9D 3C 4C             ï¾¾V.ï¾HQ..ï¾½....ï¾

                2012-02-13 12:19:30,047 INFO  [STDOUT] (WorkManager(2)-1) <Mon Feb 13 12:19:30 ART 2012> <Debug> <WTC> <BEA-180073> <+++++ END +++++>

                2012-02ï¾ï¾Wï¾¥U...6...    >  [STDOUT] (WorkManager(2)-1) <Mon Feb 13 12:19:30 ART 2012> <Debug> <WTC> <BEA-180072> <+++++ /tplle/crypFinishOne/recv_key(16) +++++>

                2012-02-13 12:19:30,048 INFO  [STDOUT] (WorkManager(2)-1) <Mon Feb 13 12:19:30 ART 2012> <Debug> <WTC> <BEA-180073> <+++++ END +++++>9 57 A5 55 FD DD 3C 36 F8 F0 1D             ï¾

                 

                2012-02-13 12:19:30,087 INFO  [com.oracle.tuxedo.utils.TuxedoLogger] (WorkManager(2)-1) Established connection to remote domain Gdomtux.

                 

                 

                but when i execute the lookup :

                 

                org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'TestTuxedo' defined in ServletContext resource [/WEB-INF/context/context.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: jboss not bound

                 

                my java code is :

                ctx = new InitialContext();

                            cf   = (TuxedoConnectionFactory) ctx.lookup("java:jboss/eis/TuxedoConnectionFactory");

                            c    = cf.getConnection();

                 

                and my standalone.xml is :

                <resource-adapter>

                <archive>

                TuxedoAdapter.rar

                </archive>

                <transaction-support>

                NoTransaction

                </transaction-support>

                <connection-definitions>

                <connection-definition class-name="com.oracle.tuxedo.adapter.spi.TuxedoManagedConnectionFactory"

                    jndi-name="java:jboss/eis/TuxedoConnectionFactory" enabled="true" use-java-context="false"/>

                </connection-definitions>

                </resource-adapter>

                 

                and the jndi name is not in jndi view

                • 5. Re: resource adapter JCA, exception when i lookup the jndi-name
                  Erhard Siegl Newbie

                  I use

                                  <resource-adapter>
                                      <archive>
                                          tuxedoadapter.rar
                                      </archive>
                                      <connection-definitions>
                                          <connection-definition class-name="com.oracle.tuxedo.adapter.spi.TuxedoManagedConnectionFactory" jndi-name="java:/jca/tuxedo" pool-name="java:jboss/jca/tuxedo"/>
                                      </connection-definitions>
                                  </resource-adapter>
                  

                   

                   

                  with jndiName = "java:/jca/tuxedo" in an EJB that uses the Tuxedo-Adapter. Try this name and then tuxedoadapter.rar in lower case. (There was a bug once, but I think it's fixed now.) If you still have problems, tell me your mail-adress and I can send my test-installation to you.

                  • 6. Re: resource adapter JCA, exception when i lookup the jndi-name
                    Erhard Siegl Newbie

                    Since you use jboss 5.1 (you are in the wrong forum), you have to create a data-source (e.g. tuxedo-ds.xml) where you define the Adapter and JNDI-name.

                    <!DOCTYPE connection-factories PUBLIC
                              "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
                              "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
                    <!--   Oracle Tuxedo Adapter Configuration  -->
                    <connection-factories>
                        <no-tx-connection-factory>
                            <jndi-name>jca/tuxedo</jndi-name>
                            <rar-name>TuxedoAdapter.rar</rar-name>
                            <connection-definition>
                                 javax.resource.cci.ConnectionFactory
                            </connection-definition>
                        </no-tx-connection-factory>
                    </connection-factories>
                    

                     

                    • 7. Re: resource adapter JCA, exception when i lookup the jndi-name
                      jaikiran pai Master

                      Moved to the correct forum.