Migrating a RAR from EAP 5 to AS 7
iceleftd Jun 27, 2012 11:22 PMThis 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?