3 Replies Latest reply on Jun 28, 2012 4:24 PM by iceleftd

    Migrating a RAR from EAP 5 to AS 7

    iceleftd

      This is my first post in the forum and I'll preface my question by admitting a lack of experience with JBoss configuration, so be nice to the newbie, eh?

       

      I'm trying to port an application from JBoss EAP 5 to JBoss AS 7 with an eye towards supporting EAP 6 when it becomes available.  I've managed to work through quite a few configuration issues so far but one in particular is stumping me.

       

      The application has an EAR with multiple JAR and WAR files and a couple of RARs.  One of the RARs is for a policy server.  In JBoss 5, we used the following:

       

      policyserver.rar/impolicyserverra-ds.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <connection-factories>
                <tx-connection-factory>
                          <jndi-name>iam/im/rar/PolicyServer</jndi-name>
                          <rar-name>iam_im.ear#policyserver.rar</rar-name>
                          <connection-definition>com.netegrity.ra.policyserver.IPolicyServerConnectionFactory</connection-definition>
                </tx-connection-factory>
      </connection-factories>
      

       

      policyserver.rar/META-INF/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'>
      <connector>
          <display-name>PolicyServerRA</display-name>
          <spec-version>1.0</spec-version>
          <eis-type>Policy Store</eis-type>
          <version>1.0</version>
          <license>
              <license-required>false</license-required>
          </license>
          <resourceadapter id="PolicyServerResourceAdapter">
              <managedconnectionfactory-class>com.netegrity.ra.policyserver.impl.PSManagedConnectionFactory</managedconnectionfactory-class>
              <connectionfactory-interface>com.netegrity.ra.policyserver.IPolicyServerConnectionFactory</connectionfactory-interface>
              <connectionfactory-impl-class>com.netegrity.ra.policyserver.impl.PSConnectionFactory</connectionfactory-impl-class>
              <connection-interface>com.netegrity.ra.policyserver.IPolicyServerConnection</connection-interface>
              <connection-impl-class>com.netegrity.ra.policyserver.impl.PSConnection</connection-impl-class>
              <transaction-support>NoTransaction</transaction-support>
              <config-property>
                  <config-property-name>ValidateSMHeadersWithPS</config-property-name>
                  <config-property-type>java.lang.String</config-property-type>
                  <config-property-value>false</config-property-value>
              </config-property>                        
              <config-property>
                  <config-property-name>Enabled</config-property-name>
                  <config-property-type>java.lang.String</config-property-type>
                  <config-property-value>false</config-property-value>
              </config-property>
              <config-property>
                  <config-property-name>FIPSMode</config-property-name>
                  <config-property-type>java.lang.String</config-property-type>
                  <config-property-value>false</config-property-value>
              </config-property>
              <config-property>
                  <config-property-name>ConnectionURL</config-property-name>
                  <config-property-type>java.lang.String</config-property-type>
                  <config-property-value>${PS_HOST},44441,44442,44443</config-property-value>
              </config-property>
              <config-property>
                  <config-property-name>UserName</config-property-name>
                  <config-property-type>java.lang.String</config-property-type>
                  <config-property-value>${PS_USER}</config-property-value>
              </config-property>
              <config-property>
                  <config-property-name>AdminSecret</config-property-name>
                  <config-property-type>java.lang.String</config-property-type>
                  <config-property-value>{PBES}:kRHo/r6nUyPJcog0neSM9w==</config-property-value>
              </config-property>
              <config-property>
                  <config-property-name>AgentName</config-property-name>
                  <config-property-type>java.lang.String</config-property-type>
                  <config-property-value>${PS_AGENT}</config-property-value>
              </config-property>
              <config-property>
                  <config-property-name>AgentSecret</config-property-name>
                  <config-property-type>java.lang.String</config-property-type>
                  <config-property-value>{PBES}:L9hiypylDk+/7LwjkCISxQ==</config-property-value>
              </config-property>
              <config-property>
                  <config-property-name>ConnectionMin</config-property-name>
                  <config-property-type>java.lang.Integer</config-property-type>
                  <config-property-value>8</config-property-value>
              </config-property>
              <config-property>
                  <config-property-name>ConnectionMax</config-property-name>
                  <config-property-type>java.lang.Integer</config-property-type>
                  <config-property-value>128</config-property-value>
              </config-property>
              <config-property>
                  <config-property-name>ConnectionStep</config-property-name>
                  <config-property-type>java.lang.Integer</config-property-type>
                  <config-property-value>8</config-property-value>
              </config-property>
              <config-property>
                  <config-property-name>ConnectionTimeout</config-property-name>
                  <config-property-type>java.lang.Integer</config-property-type>
                  <config-property-value>1000</config-property-value>
              </config-property>
              <config-property>
                  <config-property-name>FailoverServers</config-property-name>
                  <config-property-type>java.lang.String</config-property-type>
                  <config-property-value></config-property-value>
              </config-property>
              <config-property>
                  <config-property-name>FailOver</config-property-name>
                  <config-property-type>java.lang.String</config-property-type>
                  <config-property-value></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>
          </resourceadapter>
      </connector>
      

       

      When the EAR is loaded at startup, one of the WAR files tries to look up a JNDI name - using the old-style method of InitialContext.lookup("java:/iam/im/rar/PolicyServer") - and gets this error:

       

      14:46:08,049 ERROR [ims.bootstrap.Main] (MSC service thread 1-2) javax.naming.NameNotFoundException: iam/im/rar/PolicyServer -- service jboss.naming.context.java.iam.im.rar.PolicyServer

                at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)

                at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:178)

                at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:113)

                at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:214)

                at javax.naming.InitialContext.lookup(InitialContext.java:392)

                at com.netegrity.llsdk6.imsimpl.utility.ServiceLocator.lookup(ServiceLocator.java:64)

                at com.netegrity.llsdk6.imsimpl.utility.ServiceLocator.lookup(ServiceLocator.java:43)

                at com.netegrity.ims.j2ee.ServiceLocator.lookup(ServiceLocator.java:110)

                at com.netegrity.ims.bootstrap.PSServiceNISConnectionImpl.startUp(PSServiceNISConnectionImpl.java:65)

                at com.netegrity.ims.bootstrap.Main.start(Main.java:159)

                at com.netegrity.webapp.SystemInitializer.contextInitialized(SystemInitializer.java:44)

                at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392)

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850)

                at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                at java.lang.Thread.run(Thread.java:619)

       

      I tried modifying standalone-full.xml to include this but it had no effect.

       

              <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
                  <resource-adapters>
                      <resource-adapter>
                          <archive>iam_im.ear#policyserver.rar</archive>
                          <transaction-support>NoTransaction</transaction-support>
                          <connection-definitions>
                              <connection-definition class-name="com.netegrity.ra.policyserver.impl.PSManagedConnectionFactory" jndi-name="java:/iam/im/rar/PolicyServer"
                                                      enabled="true" use-java-context="true" pool-name="policyserver" use-ccm="true"/>
                          </connection-definitions>
                      </resource-adapter>
                  </resource-adapters>
              </subsystem>
      

       

      I've scoured the forums and web and tried all the remedies I can think of.  Any ideas?

        • 1. Re: Migrating a RAR from EAP 5 to AS 7
          sergiu_pienar

          Try removing your -ds.xml file.


          Sergiu

          • 2. Re: Migrating a RAR from EAP 5 to AS 7
            iceleftd

            Removing the -ds.xml file has no effect (with or without the resource-adapter definition in standalone-full.xml).  I tried that a while ago, even though I was under the impression that the -ds.xml files are ignored by AS 7.

             

            In the console, I see JNDI bindings for my datasource entries and message queues and topics, but not for the resource adapter (explaining why the code can't look up the name, of course).

             

            The RAR consists of only the -ds.xml and the ra.xml.  There is no code as the managed connection factory class is defined in another WAR in the EAR.

             

            I view that that as the "old" way of doing it.  In AS 7, what are the necessary and sufficent steps to define a resource adapter and declare it's JNDI binding?  Does it matter that the resource "eis-type" is "Policy Store"?

             

            Stuart

            • 3. Re: Migrating a RAR from EAP 5 to AS 7
              iceleftd

              The configuration UI and CLI indicate that the resource adapter is configured (although bugs in the UI prevent me from making one - similar to https://issues.jboss.org/browse/AS7-3949).

               

              Here's the CLI output:

               

              [standalone@localhost:9999 /] ls subsystem=resource-adapters/resource-adapter=iam_im.ear#policyserver.rar/connection-definitions=policyserver

              config-properties                                                          allocation-retry=undefined

              allocation-retry-wait-millis=undefined                                     background-validation=false

              background-validation-millis=undefined                                     blocking-timeout-wait-millis=undefined

              class-name=com.netegrity.ra.policyserver.impl.PSManagedConnectionFactory   enabled=true

              flush-strategy=FailingConnectionOnly                                       idle-timeout-minutes=undefined

              interleaving=false                                                         jndi-name=java:/iam/im/rar/PolicyServer

              max-pool-size=20                                                           min-pool-size=0

              no-recovery=undefined                                                      no-tx-separate-pool=false

              pad-xid=false                                                              pool-prefill=false

              pool-use-strict-min=false                                                  recovery-password=undefined

              recovery-plugin-class-name=undefined                                       recovery-plugin-properties=undefined

              recovery-security-domain=undefined                                         recovery-username=undefined

              same-rm-override=undefined                                                 security-application=undefined

              security-domain=undefined                                                  security-domain-and-application=undefined

              use-ccm=true                                                               use-fast-fail=false

              use-java-context=true                                                      use-try-lock=undefined

              wrap-xa-resource=true                                                      xa-resource-timeout=undefined