[jboss-cvs] JBossAS SVN: r109527 - in branches/JBoss-AS-6.0.x_ipv6: build/src and 30 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Nov 28 21:39:46 EST 2010


Author: smcgowan at redhat.com
Date: 2010-11-28 21:39:42 -0500 (Sun, 28 Nov 2010)
New Revision: 109527

Added:
   branches/JBoss-AS-6.0.x_ipv6/build/src/licenses.xml
   branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/EJBContextResource.java
   branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/EJBContextResourceEnvRefResourceProvider.java
   branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/EJBContextResourceProvider.java
   branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/TimerServiceResource.java
   branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/TimerServiceResourceEnvRefResourceProvider.java
   branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/TimerServiceResourceProvider.java
   branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/ejb3/deployers/Ejb3DeploymentDeployer.java
   branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/naming/javaee/JavaEEModuleIdentifier.java
   branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/switchboard/resource/provider/UserTransactionResourceEnvRefResourceProvider.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncBean.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncCommonBusiness.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncLocalBusiness.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncRemoteBusiness.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncTesterBean.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncTesterCommonBusiness.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/AppServerJDBCXARecovery.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/JPACrashHelperRem.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/recovery/CommonCrashHelper.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/recovery/CrashHelperRem.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/recovery/RecoveredXid.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-r2-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/postgres84-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/postgres90-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/sybase15.5-xa-ds.xml
Removed:
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncBean.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncCommonBusiness.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashHelperRem.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashLocalHome.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashRemHome.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/RecoveredXid.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-r2-1-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-r2-2-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac1-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac2-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/sybase12-xa-ds.xml
Modified:
   branches/JBoss-AS-6.0.x_ipv6/build/build.xml
   branches/JBoss-AS-6.0.x_ipv6/build/pom.xml
   branches/JBoss-AS-6.0.x_ipv6/component-matrix/pom.xml
   branches/JBoss-AS-6.0.x_ipv6/depchain/pom.xml
   branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/MessageDestinationReferenceResourceProvider.java
   branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/ejb3/deployers/Ejb3Deployer.java
   branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/ejb3/deployers/Ejb3JBoss5Deployment.java
   branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/ejb3/deployers/JBossASKernel.java
   branches/JBoss-AS-6.0.x_ipv6/ejb3/src/resources/META-INF/ejb3-as-deployers-jboss-beans.xml
   branches/JBoss-AS-6.0.x_ipv6/server/src/etc/deploy/jboss-logging.xml
   branches/JBoss-AS-6.0.x_ipv6/server/src/etc/deployers/core-naming-jboss-beans.xml
   branches/JBoss-AS-6.0.x_ipv6/server/src/etc/deployers/switchboard-clustered-jboss-beans.xml
   branches/JBoss-AS-6.0.x_ipv6/server/src/etc/deployers/switchboard-jboss-beans.xml
   branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/naming/javaee/NamingJavaEEComponentInformer.java
   branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/naming/javaee/NamingJavaEEModuleInformer.java
   branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/switchboard/resource/provider/UserTransactionRefResourceProvider.java
   branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/ejb/plugins/SecurityInterceptor.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/imports/config/tests-crash-recovery.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/pom.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/test/AsyncSessionBeanUnitTestCase.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/ASCrashRecovery01/TestWithJPA.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/ASCrashRecovery01/WipeOutTxsInDoubt.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/JTSContextPropagation01/TestContextPropagation.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashBMTBean.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashHelper.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/TestEntityHelper.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/taskdefs/TransactionLog.java
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/db2_97-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/mssql2005-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/mssql2008-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/mysql50-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/mysql51-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-lb-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-r2-lb-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle10-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle11-r2-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle11-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/postgres82-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/postgres83-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/sybase15-xa-ds.xml
   branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/scripts/as-tests.xml
   branches/JBoss-AS-6.0.x_ipv6/tomcat/src/main/java/org/jboss/web/tomcat/service/deployers/TomcatDeployment.java
   branches/JBoss-AS-6.0.x_ipv6/tomcat/src/main/java/org/jboss/web/tomcat/service/session/JBossCacheManager.java
   branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/pom.xml
   branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/WeldBootstrapDeployer.java
   branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/jndi/JBossBeanManagerObjectFactory.java
   branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/jndi/JavaEEComponentJndiBinderDeployer.java
   branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/jndi/JndiBinder.java
   branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/metadata/WeldEjbInterceptorMetadataDeployer.java
   branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/injection/Jsr299InjectorDeployer.java
   branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/instantiator/Jsr299BeanInstantiatorDeployer.java
   branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/util/JndiUtils.java
Log:
Merge with trunk Revions 109511

Modified: branches/JBoss-AS-6.0.x_ipv6/build/build.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/build/build.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/build/build.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -1680,15 +1680,6 @@
       <fileset refid="org.apache:xmlsec:jar"/>
       <mapper refid="remove-versions" />
     </copy>
-
-    <!-- Install wscommons-policy.jar (preventing naming collision with com.sun.xml.ws:policy:jar) -->
-    <copy todir="${install.common.lib}" filtering="no">
-      <fileset refid="ws-commons:policy:jar"/>
-      <chainedmapper>
-        <mapper refid="remove-versions" />
-        <globmapper from="*.jar" to="wscommons-*.jar"/>
-      </chainedmapper>
-    </copy>
   </target>
 
   <target name="install-jbossws-to-endorsed">
@@ -2055,6 +2046,7 @@
       <fileset refid="org.jboss.ejb3.container:jboss-ejb3-container-spi:jar"/>
       <fileset refid="org.jboss.ejb3.context:jboss-ejb3-context-base:jar"/>
       <fileset refid="org.jboss.ejb3.context:jboss-ejb3-context-naming:jar"/>
+      <fileset refid="org.jboss.ejb3.context:jboss-ejb3-context-spi:jar"/>
       <fileset refid="org.jboss.ejb3.effigy:jboss-ejb3-effigy-api:jar"/>
       <fileset refid="org.jboss.ejb3.effigy:jboss-ejb3-effigy-common:jar"/>
       <fileset refid="org.jboss.ejb3.effigy:jboss-ejb3-effigy-int2:jar"/>
@@ -2066,6 +2058,7 @@
       <fileset refid="org.jboss.ejb3.embedded:jboss-ejb3-embedded-impl-base:jar"/>
       <fileset refid="org.jboss.ejb3.embedded:jboss-ejb3-embedded-impl-shrinkwrap:jar"/>
       <fileset refid="org.jboss.ejb3.embedded:jboss-ejb3-embedded-spi:jar"/>
+      <fileset refid="org.jboss.ejb3.heks:jboss-ejb3-heks:jar"/>
       <fileset refid="org.jboss.ejb3:jboss-ejb3-core:jar"/>
       <fileset refid="org.jboss.ejb3:jboss-ejb3-deployers:jar"/>
       <fileset refid="org.jboss.ejb3:jboss-ejb3-endpoint:jar"/>
@@ -2424,7 +2417,7 @@
       <fileset refid="org.jboss.ejb3:jboss-ejb3-proxy-spi:jar:client"/>
       <fileset refid="org.jboss.ejb3:jboss-ejb3-proxy-clustered:jar:client"/>
       <fileset refid="org.jboss.ejb3:jboss-ejb3-security:jar:client"/>
-      <fileset refid="org.jboss.ejb3.context:jboss-ejb3-context-base:jar"/>
+      <fileset refid="org.jboss.ejb3.context:jboss-ejb3-context-spi:jar"/>
       <fileset refid="org.jboss.ejb3.singleton:jboss-ejb3-singleton-proxy-impl:jar"/>
       <fileset refid="org.jboss.ejb3.async:jboss-ejb3-async-spi:jar"/>
       <fileset refid="org.jboss.ejb3.async:jboss-ejb3-async-impl:jar"/>
@@ -2458,14 +2451,6 @@
         <globmapper from="*.jar" to="*-3.jar"/>
       </chainedmapper>
     </copy>
-    <!-- Install wscommons-policy.jar (preventing naming collision with com.sun.xml.ws:policy:jar) -->
-    <copy todir="${install.client}" filtering="no">
-      <fileset refid="ws-commons:policy:jar"/>
-      <chainedmapper>
-        <mapper refid="remove-versions" />
-        <globmapper from="*.jar" to="wscommons-*.jar"/>
-      </chainedmapper>
-    </copy>
 
     <!-- Copy thirdparty code to lib/endorsed -->
     <mkdir dir="${install.lib}/endorsed"/>

Modified: branches/JBoss-AS-6.0.x_ipv6/build/pom.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/build/pom.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/build/pom.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -42,9 +42,9 @@
         <plugins>
           <!-- Download the license files for each dependency -->
           <plugin>
-            <groupId>org.jboss.maven.plugins</groupId>
-            <artifactId>maven-jboss-license-plugin</artifactId>
-            <version>1.0.3</version>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>license-maven-plugin</artifactId>
+            <version>1.0-alpha-1-jboss-1</version>
             <inherited>false</inherited>
             <executions>
               <execution>
@@ -53,8 +53,9 @@
                 </goals>
                 <phase>package</phase>
                 <configuration>
-                  <outputDirectory>${project.build.directory}/jboss-${project.version}/docs/licenses</outputDirectory>
-                  <licenseSummaryFile>${project.build.directory}/jboss-${project.version}/docs/licenses/licenses.xml</licenseSummaryFile>
+                  <includeTransitiveDependencies>true</includeTransitiveDependencies>
+                  <licensesOutputDirectory>${project.build.directory}/jboss-${project.version}/docs/licenses</licensesOutputDirectory>
+                  <licensesSummaryOutputFile>${project.build.directory}/jboss-${project.version}/docs/licenses/licenses.xml</licensesSummaryOutputFile>
                 </configuration>
               </execution>
             </executions>

Copied: branches/JBoss-AS-6.0.x_ipv6/build/src/licenses.xml (from rev 109526, trunk/build/src/licenses.xml)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/build/src/licenses.xml	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/build/src/licenses.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,411 @@
+<?xml version="1.0"?>
+
+<licenseSummary xmlns="http://mojo.codehaus.org/"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://mojo.codehaus.org/ licenses.xsd">
+  <dependencies>
+    <dependency>
+      <groupId>com.wutka</groupId>
+      <artifactId>dtdparser</artifactId>
+      <!--  license information from POM in central Maven repo -->
+      <licenses>
+        <license>
+          <name>GNU Lesser General Public License</name>
+          <url>http://www.gnu.org/licenses/lgpl.txt</url>
+          <distribution>repo</distribution>
+        </license>
+        <!-- This URL of this license is not valid
+        <license>
+          <name>Apache-style license</name>
+          <url>http://www.wutka.com/dtdparserasllicense.html</url>
+          <distribution>repo</distribution>
+        </license>
+        -->
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>jcl-over-slf4j</artifactId>
+      <licenses>
+        <!-- license information located in version 1.6.1 in Maven central repo -->
+        <license>
+          <name>MIT License</name>
+          <url>http://www.opensource.org/licenses/mit-license.php</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>jgroups</groupId>
+      <artifactId>jgroups</artifactId>
+      <licenses>
+        <!-- license information from pom in trunk 
+             http://javagroups.cvs.sourceforge.net/viewvc/javagroups/JGroups/pom.xml?revision=1.43&view=markup 
+        -->
+        <license>
+          <name>GNU Lesser General Public License</name>
+          <url>http://www.gnu.org/licenses/lgpl.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>gnu-getopt</groupId>
+      <artifactId>getopt</artifactId>
+      <licenses>
+        <!-- license information from EAP 
+        -->
+        <license>
+          <name>GNU Lesser General Public License</name>
+          <url>http://www.gnu.org/licenses/lgpl.txt</url>
+          <comments>LGPLv2+</comments>
+        </license>
+      </licenses>
+    </dependency>
+    <!-- <dependency>
+      <groupId>org.hibernate.javax.persistence</groupId>
+      <artifactId>hibernate-jpa-2.0-api</artifactId>
+      <version>1.0.0.Final</version>
+      <licenses>
+        <!-  License Unknown      
+        <license>
+          <name></name>
+          <url></url>
+        </license>
+      </licenses>
+    </dependency> -->
+    <dependency>
+      <groupId>cglib</groupId>
+      <artifactId>cglib</artifactId>
+      <licenses>
+        <!-- license information from source jar in Maven central repository -->
+        <license>
+          <name>ASL 2.0</name>
+          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.ejb3.ejbref.resolver</groupId>
+      <artifactId>ejbref-resolver-ejb31</artifactId>
+      <licenses>
+        <license>
+          <name>GNU Lesser General Public License</name>
+          <url>http://www.gnu.org/licenses/lgpl.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.ejb3.ejbref.resolver</groupId>
+      <artifactId>ejbref-resolver-ejb30</artifactId>
+      <licenses>
+        <license>
+          <name>GNU Lesser General Public License</name>
+          <url>http://www.gnu.org/licenses/lgpl.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.ejb3.ejbref.resolver</groupId>
+      <artifactId>ejbref-resolver-spi</artifactId>
+      <licenses>
+        <license>
+          <name>GNU Lesser General Public License</name>
+          <url>http://www.gnu.org/licenses/lgpl.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.ejb3</groupId>
+      <artifactId>jboss-ejb3-timerservice-deployer</artifactId>
+      <licenses>
+        <license>
+          <name>GNU Lesser General Public License</name>
+          <url>http://www.gnu.org/licenses/lgpl.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.ejb3</groupId>
+      <artifactId>jboss-ejb3-timerservice-naming</artifactId>
+      <licenses>
+        <license>
+          <name>GNU Lesser General Public License</name>
+          <url>http://www.gnu.org/licenses/lgpl.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.ejb3.nointerface</groupId>
+      <artifactId>jboss-ejb3-nointerface-impl</artifactId>
+      <licenses>
+        <license>
+          <name>GNU Lesser General Public License</name>
+          <url>http://www.gnu.org/licenses/lgpl.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.ejb3.nointerface</groupId>
+      <artifactId>jboss-ejb3-nointerface-spi</artifactId>
+      <licenses>
+        <license>
+          <name>GNU Lesser General Public License</name>
+          <url>http://www.gnu.org/licenses/lgpl.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>org.hornetq</groupId>
+      <artifactId>hornetq-jms</artifactId>
+      <licenses>
+        <license>
+          <name>ASL 2.0</name>
+          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>i18nlog</groupId>
+      <artifactId>i18nlog</artifactId>
+      <licenses>
+        <!-- License from jar in JBoss repository        -->
+        <license>
+          <name>GNU Lesser General Public License</name>
+          <url>http://www.gnu.org/licenses/lgpl.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>org.rhq</groupId>
+      <artifactId>rhq-core-domain</artifactId>
+      <licenses>
+        <!-- License from jar in JBoss repository        -->
+        <license>
+          <name>GNU Lesser General Public License</name>
+          <url>http://www.gnu.org/licenses/lgpl.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>org.rhq</groupId>
+      <artifactId>rhq-core-util</artifactId>
+      <licenses>
+        <!-- License from jar in JBoss repository        -->
+        <license>
+          <name>GNU Lesser General Public License</name>
+          <url>http://www.gnu.org/licenses/lgpl.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>org.rhq</groupId>
+      <artifactId>rhq-core-plugin</artifactId>
+      <licenses>
+        <!-- License from jar in JBoss repository        -->
+        <license>
+          <name>GNU Lesser General Public License</name>
+          <url>http://www.gnu.org/licenses/lgpl.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>org.rhq</groupId>
+      <artifactId>rhq-core-native-system</artifactId>
+      <licenses>
+        <!-- License from jar in JBoss repository        -->
+        <license>
+          <name>GNU Lesser General Public License</name>
+          <url>http://www.gnu.org/licenses/lgpl.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>stax</groupId>
+      <artifactId>stax-api</artifactId>
+      <licenses>
+        <!--  Taken from POM of stax version 1.0.1       -->
+        <license>
+          <name>The Apache Software License, Version 2.0</name>
+          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+          <distribution>repo</distribution>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.httpcomponents</groupId>
+      <artifactId>httpclient</artifactId>
+      <licenses>
+        <!-- Bad URL in POM in Maven central for httpclient version 4.0    -->
+        <license>
+          <name>Apache License</name>
+          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+          <distribution>repo</distribution>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>com.google.code.guice</groupId>
+      <artifactId>guice</artifactId>
+      <licenses>
+        <!-- License information from Guice 1.0 POM in central Maven repo   -->
+        <license>
+          <name>The Apache Software License, Version 2.0</name>
+          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+          <distribution>repo</distribution>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>org.jyaml</groupId>
+      <artifactId>jyaml</artifactId>
+      <licenses>
+        <!-- License from POM and Jar contained license name but not URL        -->
+        <license>
+          <name>BSD style license</name>
+          <url>http://repository.jboss.org/licenses/bsd.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>org.apache</groupId>
+      <artifactId>xmlsec</artifactId>
+      <licenses>
+        <!-- License found in version 1.4.3 Jar in JBoss repository        -->
+        <license>
+          <name>The Apache Software License, Version 2.0</name>
+          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>bcel</groupId>
+      <artifactId>bcel</artifactId>
+      <licenses>
+        <!-- License found in version 5.1 Jar in Maven central repository    -->
+        <license>
+          <name>The Apache Software License, Version 1.1</name>
+          <url>http://www.apache.org/licenses/LICENSE-1.1.txt</url>
+          <distribution>repo</distribution>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>net.jcip</groupId>
+      <artifactId>jcip-annotations</artifactId>
+      <licenses>
+        <!-- Located in source files for jcip-annotations 1.0 in Maven central repository    -->
+        <license>
+          <name>Creative Commons Attribution License</name>
+          <url>http://creativecommons.org/licenses/by/2.5</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>opensaml</groupId>
+      <artifactId>opensaml</artifactId>
+      <licenses>
+        <!-- License from version 2.0 in JBoss repository        -->
+        <license>
+          <name>The Apache Software License, Version 2.0</name>
+          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>apache-velocity</groupId>
+      <artifactId>velocity</artifactId>
+      <licenses>
+        <!-- License info from POM in Maven central repository        -->
+        <license>
+          <name>The Apache Software License, Version 2.0</name>
+          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>commons-collections</groupId>
+      <artifactId>commons-collections</artifactId>
+      <licenses>
+        <!-- License info found in version 3.1 in Maven central repository        -->
+        <license>
+          <name>The Apache Software License, Version 2.0</name>
+          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>logkit</groupId>
+      <artifactId>logkit</artifactId>
+      <licenses>
+        <!-- License info found in binary jar version 2.0 in Maven central repository    -->
+        <license>
+          <name>The Apache Software License, Version 2.0</name>
+          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>apache-xalan</groupId>
+      <artifactId>serializer</artifactId>
+      <licenses>
+        <license>
+          <name>The Apache Software License, Version 2.0</name>
+          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>apache-xalan</groupId>
+      <artifactId>xalan</artifactId>
+      <licenses>
+        <license>
+          <name>The Apache Software License, Version 2.0</name>
+          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <licenses>
+        <license>
+          <name>The Apache Software License, Version 2.0</name>
+          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>commons-codec</groupId>
+      <artifactId>commons-codec</artifactId>
+      <licenses>
+        <license>
+          <name>The Apache Software License, Version 2.0</name>
+          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>emma</groupId>
+      <artifactId>emma</artifactId>
+      <licenses>
+        <!-- License info from version 2.1.5320 POM in Maven central   -->
+        <license>
+          <name>Common Public License v1.0</name>
+          <url>http://www.eclipse.org/legal/cpl-v10.html</url>
+          <distribution>repo</distribution>
+        </license>
+      </licenses>
+    </dependency>
+    <dependency>
+      <groupId>emma</groupId>
+      <artifactId>emma_ant</artifactId>
+      <licenses>
+        <!-- License info from version 2.1.5320 POM in Maven central   -->
+        <license>
+          <name>Common Public License v1.0</name>
+          <url>http://www.eclipse.org/legal/cpl-v10.html</url>
+          <distribution>repo</distribution>
+        </license>
+      </licenses>
+    </dependency>
+  </dependencies>
+</licenseSummary>
\ No newline at end of file

Modified: branches/JBoss-AS-6.0.x_ipv6/component-matrix/pom.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/component-matrix/pom.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/component-matrix/pom.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -49,14 +49,14 @@
     <version.javax.faces>2.0.3-b05</version.javax.faces>
     <version.javax.validation>1.0.0.GA</version.javax.validation>
     <version.jaxws-httpserver-httpspi>1.0.0.GA</version.jaxws-httpserver-httpspi>
-    <version.jboss.injection>1.0.0-alpha-3</version.jboss.injection>
+    <version.jboss.injection>1.0.0-alpha-5</version.jboss.injection>
     <version.jboss.jaxr>2.0.1</version.jboss.jaxr>
     <version.jboss.jbossts>4.13.1.Final</version.jboss.jbossts>
     <version.jboss.jbossws-native>3.4.0.CR3</version.jboss.jbossws-native>
     <version.jboss.jbossws-cxf>3.4.0.CR3</version.jboss.jbossws-cxf>
     <version.jboss.jbossws-common>1.4.1.CR1</version.jboss.jbossws-common>
     <version.jboss.jbossws-framework>3.4.1.CR1</version.jboss.jbossws-framework>
-    <version.jboss.jbossws-spi>1.4.1.CR1</version.jboss.jbossws-spi>
+    <version.jboss.jbossws-spi>1.4.1.CR2</version.jboss.jbossws-spi>
     <version.jboss.jms-integration-tests>1.0.1.GA</version.jboss.jms-integration-tests>
     <version.jboss.jsf-deployer>1.0.3</version.jboss.jsf-deployer>
     <version.jboss.web>3.0.0-beta-7</version.jboss.web>
@@ -85,7 +85,7 @@
     <version.org.jboss.cluster.cache.ispn>1.0.0.CR8</version.org.jboss.cluster.cache.ispn>
     <version.org.jboss.common.core>2.2.17.GA</version.org.jboss.common.core>
     <version.org.jboss.deployers>2.2.0.Alpha8</version.org.jboss.deployers>
-    <version.org.jboss.ejb3.depchain>1.0.0-alpha-20</version.org.jboss.ejb3.depchain>
+    <version.org.jboss.ejb3.depchain>1.0.0-alpha-25</version.org.jboss.ejb3.depchain>
     <!-- This to move into the EJB3 BOM -->
     <version.org.jboss.ejb3.embedded>1.0.0-alpha-1</version.org.jboss.ejb3.embedded>
     <version.org.jboss.ejb.api>1.0-alpha-1</version.org.jboss.ejb.api>
@@ -106,14 +106,14 @@
     <version.org.jboss.logging-service-metadata>1.0.0.CR9</version.org.jboss.logging-service-metadata>
     <version.org.jboss.logmanager>1.2.0.CR8</version.org.jboss.logmanager>
     <version.org.jboss.man>2.1.1.SP2</version.org.jboss.man>
-    <version.managed.beans.depchain>1.0.0-alpha-1</version.managed.beans.depchain>
+    <version.managed.beans.depchain>1.0.0-alpha-3</version.managed.beans.depchain>
     <version.org.jboss.marshalling>1.3.0.CR3</version.org.jboss.marshalling>
     <version.org.jboss.mc-int>2.2.0.Alpha3</version.org.jboss.mc-int>
     <version.org.jboss.mdr>2.2.0.Alpha3</version.org.jboss.mdr>
     <version.org.jboss.metadata.client>2.0.0.Alpha2</version.org.jboss.metadata.client>
-    <version.org.jboss.metadata.common>2.0.0.Alpha20</version.org.jboss.metadata.common>
+    <version.org.jboss.metadata.common>2.0.0.Alpha22</version.org.jboss.metadata.common>
     <version.org.jboss.metadata.ear>2.0.0.Alpha4</version.org.jboss.metadata.ear>
-    <version.org.jboss.metadata.ejb>2.0.0-alpha-22</version.org.jboss.metadata.ejb>
+    <version.org.jboss.metadata.ejb>2.0.0-alpha-24</version.org.jboss.metadata.ejb>
     <version.org.jboss.metadata.rar>2.0.0.Alpha</version.org.jboss.metadata.rar>
     <version.org.jboss.metadata.war>2.0.0.Alpha15</version.org.jboss.metadata.war>
     <version.org.jboss.mod_cluster>1.1.0.Final</version.org.jboss.mod_cluster>
@@ -122,7 +122,7 @@
     <!-- <version.org.jboss.naming>5.0.5-SNAPSHOT</version.org.jboss.naming> -->
     <version.org.jboss.profileservice>0.1.0.Alpha1</version.org.jboss.profileservice>
     <version.org.jboss.reflect>2.2.0.Alpha9</version.org.jboss.reflect>
-    <version.org.jboss.reloaded.naming>0.2.0</version.org.jboss.reloaded.naming>
+    <version.org.jboss.reloaded.naming>0.3.0</version.org.jboss.reloaded.naming>
     <version.org.jboss.resteasy>2.1-beta-1</version.org.jboss.resteasy>
     <version.org.jboss.remoting>2.5.3</version.org.jboss.remoting>
     <version.org.jboss.remoting3>3.1.0.Beta2</version.org.jboss.remoting3>
@@ -134,7 +134,7 @@
     <version.org.jboss.shrinkwrap>1.0.0-alpha-11</version.org.jboss.shrinkwrap>
     <version.org.jboss.slf4j>1.0.2.GA</version.org.jboss.slf4j>
     <version.org.jboss.stdio>1.0.0.CR3</version.org.jboss.stdio>
-    <version.org.jboss.switchboard.depchain>1.0.0-alpha-9</version.org.jboss.switchboard.depchain>
+    <version.org.jboss.switchboard.depchain>1.0.0-alpha-11</version.org.jboss.switchboard.depchain>
     <version.org.jboss.threads>2.0.0.CR7</version.org.jboss.threads>
     <version.org.jboss.threads-metadata>2.0.0.CR4</version.org.jboss.threads-metadata>
     <version.org.jboss.vfs>3.0.0.CR5</version.org.jboss.vfs>
@@ -1484,6 +1484,10 @@
             <groupId>org.apache.ws.policy</groupId>
             <artifactId>wscommons-policy</artifactId>
           </exclusion>
+          <exclusion>
+            <groupId>ws-commons</groupId>
+            <artifactId>policy</artifactId>
+          </exclusion>
         </exclusions>
       </dependency>
       
@@ -3880,12 +3884,6 @@
       </dependency>
       
       <dependency>
-        <groupId>ws-commons</groupId>
-        <artifactId>policy</artifactId>
-        <version>1.0</version>
-      </dependency>
-      
-      <dependency>
         <groupId>wutka-dtdparser</groupId>
         <artifactId>dtdparser</artifactId>
         <version>1.21-brew</version>
@@ -4083,6 +4081,7 @@
                         <exclude>org.jboss.reloaded:jboss-reloaded-naming-deployers</exclude>
                         <exclude>quartz:quartz</exclude>
                         <exclude>jgroups:jgroups</exclude>
+                        <exclude>ws-commons:policy</exclude>
                       </excludes>
                       <includes>
                         <include>javax.xml.bind:jaxb-api:jar:2.1</include>

Modified: branches/JBoss-AS-6.0.x_ipv6/depchain/pom.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/depchain/pom.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/depchain/pom.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -1172,10 +1172,6 @@
       <artifactId>streambuffer</artifactId>
     </dependency>
     <dependency>
-      <groupId>ws-commons</groupId>
-      <artifactId>policy</artifactId>
-    </dependency>
-    <dependency>
       <groupId>com.sun.xml.ws</groupId>
       <artifactId>policy</artifactId>
     </dependency>

Copied: branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/EJBContextResource.java (from rev 109526, trunk/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/EJBContextResource.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/EJBContextResource.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/EJBContextResource.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.ejb3.switchboard.resource.provider;
+
+import javax.ejb.EJBContext;
+import javax.naming.LinkRef;
+
+import org.jboss.switchboard.spi.Resource;
+
+/**
+ * {@link Resource} for {@link EJBContext} reference
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public class EJBContextResource implements Resource
+{
+
+   /**
+    * The name of MC bean responsible for binding the internal (java:internal/EJBContext)
+    * jndi name
+    */
+   private String mcBeanName;
+
+   public EJBContextResource(String mcBeanDependencyName)
+   {
+      this.mcBeanName = mcBeanDependencyName;
+
+   }
+
+   @Override
+   public Object getDependency()
+   {
+      return this.mcBeanName;
+   }
+
+   @Override
+   public Object getTarget()
+   {
+      return new LinkRef("java:internal/EJBContext");
+   }
+}

Copied: branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/EJBContextResourceEnvRefResourceProvider.java (from rev 109526, trunk/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/EJBContextResourceEnvRefResourceProvider.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/EJBContextResourceEnvRefResourceProvider.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/EJBContextResourceEnvRefResourceProvider.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.ejb3.switchboard.resource.provider;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.switchboard.javaee.jboss.environment.JBossResourceEnvRefType;
+import org.jboss.switchboard.mc.spi.MCBasedResourceProvider;
+import org.jboss.switchboard.spi.Resource;
+
+/**
+ * {@link MCBasedResourceProvider} for resource-env-ref which references EJBContext
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public class EJBContextResourceEnvRefResourceProvider implements MCBasedResourceProvider<JBossResourceEnvRefType>
+{
+   /**
+    * The name of MC bean which is responsible for setting up java:internal/EJBContext 
+    */
+   private String ejbContextBinderMCBeanName;
+
+   /**
+    * 
+    * @param ejbContextBinderMCBeanName The name of MC bean which is responsible for setting up java:internal/EJBContext 
+    */
+   public EJBContextResourceEnvRefResourceProvider(String ejbContextBinderMCBeanName)
+   {
+      if (ejbContextBinderMCBeanName == null || ejbContextBinderMCBeanName.trim().isEmpty())
+      {
+         throw new IllegalArgumentException("EJBContext binder MC bean name cannot be null or empty");
+      }
+      this.ejbContextBinderMCBeanName = ejbContextBinderMCBeanName;
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public Class<JBossResourceEnvRefType> getEnvironmentEntryType()
+   {
+      return JBossResourceEnvRefType.class;
+   }
+
+   @Override
+   public Resource provide(DeploymentUnit unit, JBossResourceEnvRefType resEnvRef)
+   {
+      return new EJBContextResource(this.ejbContextBinderMCBeanName);
+   }
+
+}

Copied: branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/EJBContextResourceProvider.java (from rev 109526, trunk/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/EJBContextResourceProvider.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/EJBContextResourceProvider.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/EJBContextResourceProvider.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.ejb3.switchboard.resource.provider;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.switchboard.javaee.environment.EJBContextRefType;
+import org.jboss.switchboard.mc.spi.MCBasedResourceProvider;
+import org.jboss.switchboard.spi.Resource;
+import org.jboss.switchboard.spi.ResourceProvider;
+
+/**
+ * {@link ResourceProvider} for java:comp/EJBContext
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public class EJBContextResourceProvider implements MCBasedResourceProvider<EJBContextRefType>
+{
+
+   /**
+    * The name of MC bean which is responsible for setting up java:internal/EJBContext 
+    */
+   private String ejbContextBinderMCBeanName;
+
+   /**
+    * 
+    * @param ejbContextBinderMCBeanName The name of MC bean which is responsible for setting up java:internal/EJBContext
+    */
+   public EJBContextResourceProvider(String ejbContextBinderMCBeanName)
+   {
+      if (ejbContextBinderMCBeanName == null || ejbContextBinderMCBeanName.trim().isEmpty())
+      {
+         throw new IllegalArgumentException("EJBContext binder MC bean name cannot be null or empty");
+      }
+      this.ejbContextBinderMCBeanName = ejbContextBinderMCBeanName;
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public Class<EJBContextRefType> getEnvironmentEntryType()
+   {
+      return EJBContextRefType.class;
+   }
+
+   /**
+    * Returns a {@link EJBContextResource} for a java:comp/EJBContext reference
+    */
+   @Override
+   public Resource provide(DeploymentUnit unit, EJBContextRefType ejbContextRef)
+   {
+      return new EJBContextResource(this.ejbContextBinderMCBeanName);
+   }
+
+}

Modified: branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/MessageDestinationReferenceResourceProvider.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/MessageDestinationReferenceResourceProvider.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/MessageDestinationReferenceResourceProvider.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -72,9 +72,6 @@
       // Now check if a message-destination link is specified.
       // The "link" itself is a logical name to the destination, so we'll
       // use a resolver to resolve a jndi name out of it.
-      // Note that a message-destination can *only* be specified in a ejb-jar deployment
-      // (see Java EE6 spec, EE.5.9.2), so the message-destination link resolver 
-      // needs to be provided by some JBoss EJB3 container component
       String messageDestLink = messageDestRef.getMessageDestinationLink();
       if (messageDestLink != null && !messageDestLink.trim().isEmpty())
       {
@@ -86,7 +83,16 @@
          }
          else
          {
-            String resolvedJNDIName = this.messageDestinationResolver.resolveMessageDestinationJndiName(unit, messageDestLink);
+            // the DU which depends on this message-destination-ref 
+            DeploymentUnit dependentDU = unit;
+            // the MessageDestinationReferenceResolver works on non-component deployment units.
+            // So if we are currently processing component DUs (like we do for EJBs), then pass the
+            // component DUs parent during resolution.
+            if (unit.isComponent())
+            {
+               dependentDU = unit.getParent();
+            }
+            String resolvedJNDIName = this.messageDestinationResolver.resolveMessageDestinationJndiName(dependentDU, messageDestLink);
             logger.debug("Resolved jndi-name: " + resolvedJNDIName + " for message-destination link: "
                   + messageDestLink + " in message-destination-ref: " + messageDestRef.getName());
             if (resolvedJNDIName != null && !resolvedJNDIName.trim().isEmpty())

Copied: branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/TimerServiceResource.java (from rev 109526, trunk/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/TimerServiceResource.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/TimerServiceResource.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/TimerServiceResource.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.ejb3.switchboard.resource.provider;
+
+import javax.ejb.TimerService;
+import javax.naming.LinkRef;
+
+import org.jboss.switchboard.spi.Resource;
+
+/**
+ * {@link Resource} for {@link TimerService} reference
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public class TimerServiceResource implements Resource
+{
+
+   /**
+    * The name of MC bean responsible for binding the internal (java:internal/TimerService)
+    * jndi name
+    */
+   private String mcBeanName;
+   
+   public TimerServiceResource(String mcBeanDependencyName)
+   {
+      this.mcBeanName = mcBeanDependencyName;
+   }
+   
+   @Override
+   public Object getDependency()
+   {
+      return this.mcBeanName;
+   }
+
+   @Override
+   public Object getTarget()
+   {
+      return new LinkRef("java:internal/TimerService");
+   }
+
+}

Copied: branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/TimerServiceResourceEnvRefResourceProvider.java (from rev 109526, trunk/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/TimerServiceResourceEnvRefResourceProvider.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/TimerServiceResourceEnvRefResourceProvider.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/TimerServiceResourceEnvRefResourceProvider.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.ejb3.switchboard.resource.provider;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.switchboard.javaee.jboss.environment.JBossResourceEnvRefType;
+import org.jboss.switchboard.mc.spi.MCBasedResourceProvider;
+import org.jboss.switchboard.spi.Resource;
+
+/**
+ * {@link MCBasedResourceProvider} for resource-env-ref which references TimerService
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public class TimerServiceResourceEnvRefResourceProvider implements MCBasedResourceProvider<JBossResourceEnvRefType>
+{
+
+   /**
+    * The name of MC bean which is responsible for setting up java:internal/TimerService 
+    */
+   private String timerServiceBinderMCBeanName;
+   
+   /**
+    * 
+    * @param timerServiceBinderMCBeanName The name of MC bean which is responsible for setting up java:internal/TimerService 
+    */
+   public TimerServiceResourceEnvRefResourceProvider(String timerServiceBinderMCBeanName)
+   {
+      if (timerServiceBinderMCBeanName == null || timerServiceBinderMCBeanName.trim().isEmpty())
+      {
+         throw new IllegalArgumentException("TimerService binder MC bean name cannot be null or empty");
+      }
+      this.timerServiceBinderMCBeanName = timerServiceBinderMCBeanName;
+   }
+
+   @Override
+   public Class<JBossResourceEnvRefType> getEnvironmentEntryType()
+   {
+      return JBossResourceEnvRefType.class;
+   }
+
+   @Override
+   public Resource provide(DeploymentUnit unit, JBossResourceEnvRefType resEnvRef)
+   {
+      return new TimerServiceResource(this.timerServiceBinderMCBeanName);
+   }
+
+}

Copied: branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/TimerServiceResourceProvider.java (from rev 109526, trunk/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/TimerServiceResourceProvider.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/TimerServiceResourceProvider.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/as/ejb3/switchboard/resource/provider/TimerServiceResourceProvider.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.ejb3.switchboard.resource.provider;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.switchboard.javaee.environment.TimerServiceRefType;
+import org.jboss.switchboard.mc.spi.MCBasedResourceProvider;
+import org.jboss.switchboard.spi.Resource;
+
+/**
+ * {@link MCBasedResourceProvider} for java:comp/TimerService
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public class TimerServiceResourceProvider implements MCBasedResourceProvider<TimerServiceRefType>
+{
+
+   /**
+    * The name of MC bean which is responsible for setting up java:internal/TimerService 
+    */
+   private String timerServiceBinderMCBeanName;
+   
+   /**
+    * 
+    * @param timerServiceBinderMCBeanName The name of MC bean which is responsible for setting up java:internal/TimerService 
+    */
+   public TimerServiceResourceProvider(String timerServiceBinderMCBeanName)
+   {
+      if (timerServiceBinderMCBeanName == null || timerServiceBinderMCBeanName.trim().isEmpty())
+      {
+         throw new IllegalArgumentException("TimerService binder MC bean name cannot be null or empty");
+      }
+      this.timerServiceBinderMCBeanName = timerServiceBinderMCBeanName;
+   }
+   
+   /**
+    * {@inheritDoc}
+    */
+   @Override
+   public Class<TimerServiceRefType> getEnvironmentEntryType()
+   {
+      return TimerServiceRefType.class;
+   }
+
+   @Override
+   public Resource provide(DeploymentUnit unit, TimerServiceRefType timerServiceRef)
+   {
+      return new TimerServiceResource(this.timerServiceBinderMCBeanName);
+   }
+
+}

Modified: branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/ejb3/deployers/Ejb3Deployer.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/ejb3/deployers/Ejb3Deployer.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/ejb3/deployers/Ejb3Deployer.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -91,7 +91,7 @@
 	   // Using addInput ensures ordering http://www.jboss.org/index.html?module=bb&op=viewtopic&t=156725
       addInput(AttachmentNames.PROCESSED_METADATA);
       addInput(BeanInstantiator.class);
-      // TODO: should we really output this
+
       setOutput(Ejb3Deployment.class);
       // JBossASKernel install output
       setOutput(KernelDeployment.class);
@@ -181,7 +181,10 @@
             deployment.destroy();
             return;
          }
-         deployment.start();
+         // We'll delay the start and let org.jboss.ejb3.deployers.Ejb3DeploymentDeployer start the deployment
+         // deployment.start();
+         
+         // add the Ejb3Deployment as attachment
          unit.addAttachment(Ejb3Deployment.class, deployment);
          // TODO: temporarily disable the security deployment
          unit.addAttachment(JaccPolicyUtil.IGNORE_ME_NAME, true, Boolean.class);

Copied: branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/ejb3/deployers/Ejb3DeploymentDeployer.java (from rev 109526, trunk/ejb3/src/main/java/org/jboss/ejb3/deployers/Ejb3DeploymentDeployer.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/ejb3/deployers/Ejb3DeploymentDeployer.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/ejb3/deployers/Ejb3DeploymentDeployer.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ejb3.deployers;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.ejb3.Ejb3Deployment;
+import org.jboss.injection.manager.spi.InjectionManager;
+import org.jboss.switchboard.spi.Barrier;
+
+/**
+ * Deployer responsible for "starting" a {@link Ejb3Deployment}.
+ * 
+ * <p>
+ *  The {@link Ejb3Deployer} creates and attaches a {@link Ejb3Deployment} into
+ *  the deployment unit. The attached {@link Ejb3Deployment} will have it {@link Ejb3Deployment#create()}
+ *  invocation completed by the {@link Ejb3Deployer}. This {@link Ejb3DeploymentDeployer} is just responsible
+ *  for invoking {@link Ejb3Deployer#start()} *after* the deployment unit has been processed by the deployers
+ *  which are responsible for attaching {@link Barrier SwitchBoard barrier} and {@link InjectionManager InjectionManager}
+ *  to the unit. 
+ * </p>
+ *
+ * <p>
+ *  Note: This deployer ideally shouldn't have been required and the other {@link Ejb3Deployer} should have been 
+ *  sufficient for starting the {@link Ejb3Deployment}. But as soon as the {@link Barrier} is added a an input to the
+ *  {@link Ejb3Deployer}, things start falling apart due to the weird circular dependencies that get introduced between the deployers,
+ *  due to the various JBoss WS deployers. 
+ * </p>
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public class Ejb3DeploymentDeployer extends AbstractRealDeployer
+{
+
+   public Ejb3DeploymentDeployer()
+   {
+      this.setInput(Ejb3Deployment.class);
+
+      // SwitchBoard
+      addInput(Barrier.class);
+      // InjectionManager
+      addInput(InjectionManager.class);
+
+   }
+
+   @Override
+   protected void internalDeploy(DeploymentUnit unit) throws DeploymentException
+   {
+      Ejb3Deployment ejb3Deployment = unit.getAttachment(Ejb3Deployment.class);
+      
+      try
+      {
+         // start the deployment
+         ejb3Deployment.start();
+      }
+      catch (Exception e)
+      {
+         throw new DeploymentException("Error starting Ejb3Deployment: " + ejb3Deployment.getName(), e);
+      }
+   }
+
+}

Modified: branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/ejb3/deployers/Ejb3JBoss5Deployment.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/ejb3/deployers/Ejb3JBoss5Deployment.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/ejb3/deployers/Ejb3JBoss5Deployment.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -21,13 +21,19 @@
 */
 package org.jboss.ejb3.deployers;
 
+import java.util.Collection;
 import java.util.Map;
 
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 import javax.security.jacc.PolicyConfiguration;
 
+import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData;
 import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData;
+import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.dependency.spi.ControllerState;
 import org.jboss.deployment.MappedReferenceMetaDataResolverDeployer;
 import org.jboss.deployment.dependency.ContainerDependencyMetaData;
 import org.jboss.ejb3.Container;
@@ -39,12 +45,23 @@
 import org.jboss.ejb3.javaee.JavaEEApplication;
 import org.jboss.ejb3.javaee.JavaEEComponent;
 import org.jboss.ejb3.kernel.JNDIKernelRegistryPlugin;
+import org.jboss.injection.injector.metadata.EnvironmentEntryType;
+import org.jboss.injection.injector.metadata.InjectionTargetType;
+import org.jboss.injection.injector.metadata.JndiEnvironmentRefsGroup;
+import org.jboss.injection.manager.spi.InjectionManager;
+import org.jboss.injection.manager.spi.Injector;
+import org.jboss.injection.mc.injector.LazyEEInjector;
+import org.jboss.injection.mc.metadata.JndiEnvironmentImpl;
 import org.jboss.kernel.Kernel;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
 import org.jboss.metadata.ejb.jboss.JBossMetaData;
 import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
 import org.jboss.metadata.ejb.jboss.jndipolicy.spi.EjbDeploymentSummary;
+import org.jboss.metadata.ejb.spec.InterceptorMetaData;
+import org.jboss.metadata.ejb.spec.InterceptorsMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.switchboard.spi.Barrier;
 
 /**
  * JBoss 5.0 Microkernel specific implementation
@@ -132,6 +149,32 @@
       // EJBTHREE-1335: container name in meta data
       generateContainerName(container, beanMD);
       
+      // setup switchboard
+      Barrier switchBoard = this.getSwitchBoardBarrier(container);
+      // the container cannot function without an SwitchBoard Barrier
+      if (switchBoard == null)
+      {
+         throw new RuntimeException("No SwitchBoard Barrier found for bean: " + container.getEjbName() + " in unit: "
+               + this.jbossUnit + " (or its component deployment unit)");
+      }
+      // Add dependency on switchboard
+      dependsPolicy.addDependency(switchBoard.getId());
+      log.debug("Added dependency on Switchboard " + switchBoard.getId() + " for EJB container " + ejbContainer.getName());
+      
+      
+      // create and setup Injector(s) for InjectionManager  
+      InjectionManager injectionManager = this.getInjectionManager(container);
+      // the container cannot function without an InjectionManager
+      if (injectionManager == null)
+      {
+         throw new RuntimeException("No InjectionManager found for bean: " + container.getEjbName() + " in unit: "
+               + this.jbossUnit + " (or its component deployment unit)");
+      }
+      // setup the injectors for the bean and any of its interceptors
+      this.setupInjectors(ejbContainer, injectionManager, switchBoard);
+      // set the InjectionManager on the EJBContainer
+      ejbContainer.setInjectionManager(injectionManager);
+      
       super.registerEJBContainer(container);
    }
 
@@ -165,4 +208,192 @@
       summary.setService(beanMD.isService());
       return summary;
    }   
+   
+   protected Barrier getSwitchBoardBarrier(Container container)
+   {
+      if (this.isSharedENC(this.jbossUnit))
+      {
+         return this.jbossUnit.getAttachment(Barrier.class);
+      }
+      
+      // This is a bit brittle since we are relying on the internal knowledge of
+      // what org.jboss.ejb3.deployers.EJBsDeployer uses as a name to attach the EJB metadata
+      // component to the deployment unit. However, we don't have an alternate way to get hold
+      // of the name. So for now, let's just use this
+      String ejbComponentName = JBossEnterpriseBeanMetaData.class.getName() + "." + container.getEjbName();
+      // get the component DU for the EJB of this container from the parent (non-component) DU
+      org.jboss.deployers.structure.spi.DeploymentUnit componentDU = this.jbossUnit.getComponent(ejbComponentName);
+      if (componentDU == null)
+      {
+         // without the component DU, there's no way we can get hold of the switchboard Barrier.
+         // That effectively makes the container unusable. Hence throw this exception
+         throw new RuntimeException("Component Deployment Unit for bean: " + container.getEjbName()
+               + " not found in unit: " + this.jbossUnit);
+      }
+      return componentDU.getAttachment(Barrier.class);
+   }
+   
+   protected InjectionManager getInjectionManager(Container container)
+   {
+      // This is a bit brittle since we are relying on the internal knowledge of
+      // what org.jboss.ejb3.deployers.EJBsDeployer uses as a name to attach the EJB metadata
+      // component to the deployment unit. However, we don't have an alternate way to get hold
+      // of the name. So for now, let's just use this
+      String ejbComponentName = JBossEnterpriseBeanMetaData.class.getName() + "." + container.getEjbName();
+      // get the component DU for the EJB of this container from the parent (non-component) DU
+      org.jboss.deployers.structure.spi.DeploymentUnit componentDU = this.jbossUnit.getComponent(ejbComponentName);
+      if (componentDU == null)
+      {
+         // without the component DU, there's no way we can get hold of the correct InjectionManager.
+         // That effectively makes the container unusable. Hence throw this exception
+         throw new RuntimeException("Component Deployment Unit for bean: " + container.getEjbName()
+               + " not found in unit: " + this.jbossUnit);
+      }
+      // get the InjectionManager
+      return componentDU.getAttachment(InjectionManager.class);
+   }
+   
+   protected void setupInjectors(EJBContainer ejbContainer, InjectionManager injectionManager, Barrier switchBoard)
+   {
+      // Let's first create EEInjector (which pulls from ENC and pushes to EJB instance) for EJB
+      // and then create a EEInjector for each of the interceptors for the bean
+
+      JBossEnterpriseBeanMetaData beanMetaData = ejbContainer.getXml();
+      // convert JBMETA metadata to jboss-injection specific metadata
+      JndiEnvironmentRefsGroup jndiEnvironment = new JndiEnvironmentImpl(beanMetaData, ejbContainer.getClassloader());
+      // For optimization, we'll create an Injector only if there's atleast one InjectionTarget
+      if (this.hasInjectionTargets(jndiEnvironment))
+      {
+         // create the injector
+         LazyEEInjector lazyEEInjector = new LazyEEInjector(jndiEnvironment);
+         // add the injector the injection manager
+         injectionManager.addInjector(lazyEEInjector);
+         // Deploy the Injector as a MC bean (so that the fully populated naming context (obtained via the SwitchBoard
+         // Barrier) gets injected.
+         String injectorMCBeanName = this.getInjectorMCBeanNamePrefix() + ",bean=" + ejbContainer.getEjbName();
+         BeanMetaData injectorBMD = this.createInjectorBMD(injectorMCBeanName, lazyEEInjector, switchBoard);
+         this.jbossUnit.addAttachment(BeanMetaData.class + ":" + injectorMCBeanName, injectorBMD);
+         
+         // Add the Injector dependency on the deployment (so that the DU doesn't
+         // get started till the Injector is available)
+         DependencyPolicy dependsPolicy = ejbContainer.getDependencyPolicy();
+         dependsPolicy.addDependency(injectorMCBeanName);
+         log.debug("Added Injector dependency: " + injectorMCBeanName + " for EJB: " + ejbContainer.getEjbName() + " in unit " + this.jbossUnit);
+      }
+      
+      // Now setup injectors for the interceptors of the bean
+      InterceptorsMetaData interceptors = JBossMetaData.getInterceptors(beanMetaData.getEjbName(), beanMetaData.getJBossMetaData());
+      if (interceptors == null || interceptors.isEmpty())
+      {
+         return;
+      }
+      for (InterceptorMetaData interceptor : interceptors)
+      {
+         if (interceptor == null)
+         {
+            continue;
+         }
+         JndiEnvironmentRefsGroup jndiEnvironmentForInterceptor = new JndiEnvironmentImpl(interceptor, ejbContainer.getClassloader());
+         // For optimization, we'll create an Injector only if there's atleast one InjectionTarget
+         if (this.hasInjectionTargets(jndiEnvironmentForInterceptor))
+         {
+            // create the injector
+            LazyEEInjector lazyEEInjector = new LazyEEInjector(jndiEnvironmentForInterceptor);
+            // add the injector the injection manager
+            injectionManager.addInjector(lazyEEInjector);
+            // Deploy the Injector as a MC bean (so that the fully populated naming context (obtained via the SwitchBoard
+            // Barrier) gets injected.
+            String interceptorInjectorMCBeanName = this.getInjectorMCBeanNamePrefix() + ",bean=" + ejbContainer.getEjbName() + ",interceptor=" + interceptor.getName();
+            BeanMetaData injectorBMD = this.createInjectorBMD(interceptorInjectorMCBeanName, lazyEEInjector, switchBoard);
+            this.jbossUnit.addAttachment(BeanMetaData.class + ":" + interceptorInjectorMCBeanName, injectorBMD);
+            
+            // Add the Injector dependency on the deployment (so that the DU doesn't
+            // get started till the Injector is available)
+            DependencyPolicy dependsPolicy = ejbContainer.getDependencyPolicy();
+            dependsPolicy.addDependency(interceptorInjectorMCBeanName);
+            log.debug("Added Injector dependency: " + interceptorInjectorMCBeanName + " for interceptor "
+                  + interceptor.getName() + " of EJB: " + ejbContainer.getEjbName() + " in unit " + this.jbossUnit);
+         }
+         
+      }
+
+   }
+
+   /**
+    * Returns true if the passed {@link JndiEnvironmentRefsGroup} has atleast one {@link EnvironmentEntryType environment entry}
+    * with an {@link InjectionTargetType injection target}. Else, returns false
+    *  
+    * @param jndiEnv
+    * @return
+    */
+   private boolean hasInjectionTargets(JndiEnvironmentRefsGroup jndiEnv)
+   {
+      Collection<EnvironmentEntryType> envEntries = jndiEnv.getEntries();
+      if (envEntries == null || envEntries.isEmpty())
+      {
+         return false;
+      }
+      for (EnvironmentEntryType envEntry : envEntries)
+      {
+         Collection<InjectionTargetType> injectionTargets = envEntry.getInjectionTargets();
+         if (injectionTargets != null && !injectionTargets.isEmpty())
+         {
+            return true;
+         }
+      }
+      return false;   
+   }
+   
+   /**
+    * Creates and returns {@link BeanMetaData} for the passed {@link LazyEEInjector injector} and sets up
+    * dependency on the passed {@link Barrier SwitchBoard barrier}.
+    * 
+    * @param injectorMCBeanName
+    * @param injector
+    * @param barrier
+    * @return
+    */
+   protected BeanMetaData createInjectorBMD(String injectorMCBeanName, LazyEEInjector injector, Barrier barrier)
+   {
+      BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(injectorMCBeanName, injector.getClass().getName());
+      builder.setConstructorValue(injector);
+
+      // add injection dependency on INSTALLED state of SwitchBoard Barrier
+      AbstractInjectionValueMetaData barrierInjection = new AbstractInjectionValueMetaData(barrier.getId());
+      barrierInjection.setDependentState(ControllerState.INSTALLED);
+      builder.addPropertyMetaData("barrier", barrierInjection);
+
+      // return the Injector BMD
+      return builder.getBeanMetaData();
+   }
+   
+
+   /**
+    * Returns the prefix for the MC bean name, for a {@link Injector injector}
+    * 
+    * @return
+    */
+   protected String getInjectorMCBeanNamePrefix()
+   {
+      StringBuilder sb = new StringBuilder("jboss-injector:");
+      org.jboss.deployers.structure.spi.DeploymentUnit topLevelUnit = this.jbossUnit.isTopLevel() ? this.jbossUnit : this.jbossUnit.getTopLevel();
+      sb.append("topLevelUnit=");
+      sb.append(topLevelUnit.getSimpleName());
+      sb.append(",");
+      sb.append("unit=");
+      sb.append(this.jbossUnit.getSimpleName());
+
+      return sb.toString();
+   }
+
+   private boolean isSharedENC(org.jboss.deployers.structure.spi.DeploymentUnit deploymentUnit)
+   {
+      JBossMetaData jbossMetaData = deploymentUnit.getAttachment(JBossMetaData.class);
+      JBossWebMetaData jbosswebMetaData = deploymentUnit.getAttachment(JBossWebMetaData.class);
+      if (jbossMetaData != null && jbosswebMetaData != null)
+      {
+         return true;
+      }
+      return false;
+   }
 }

Modified: branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/ejb3/deployers/JBossASKernel.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/ejb3/deployers/JBossASKernel.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/ejb3/src/main/java/org/jboss/ejb3/deployers/JBossASKernel.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -21,17 +21,6 @@
  */
 package org.jboss.ejb3.deployers;
 
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.management.MBeanInfo;
-import javax.management.MBeanOperationInfo;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
 import org.jboss.as.ejb3.naming.NamingComponentEjbEncFactory;
 import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
 import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData;
@@ -48,9 +37,13 @@
 import org.jboss.ejb3.EJBContainer;
 import org.jboss.ejb3.KernelAbstraction;
 import org.jboss.ejb3.MCDependencyPolicy;
+import org.jboss.ejb3.heks.businessobject.EJB31StatefulBusinessObjectFactory;
+import org.jboss.ejb3.heks.businessobject.EJB31StatelessBusinessObjectFactory;
 import org.jboss.ejb3.instantiator.spi.BeanInstantiatorRegistration;
 import org.jboss.ejb3.javaee.JavaEEApplication;
 import org.jboss.ejb3.javaee.JavaEEModule;
+import org.jboss.ejb3.stateful.StatefulContainer;
+import org.jboss.ejb3.stateless.StatelessContainer;
 import org.jboss.kernel.Kernel;
 import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment;
 import org.jboss.kernel.spi.deployment.KernelDeployment;
@@ -58,6 +51,16 @@
 import org.jboss.logging.Logger;
 import org.jboss.reloaded.naming.spi.JavaEEComponent;
 
+import javax.management.MBeanInfo;
+import javax.management.MBeanOperationInfo;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Set;
+
 /**
  * The JBossAS implementation of the ejb3 KernelAbstraction integration api
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
@@ -172,6 +175,13 @@
          String beanInstantiatorMcName = BeanInstantiatorRegistration.getInstantiatorRegistrationName(appName, moduleName, container.getEjbName());
          builder.addPropertyMetaData("beanInstantiator", new AbstractInjectionValueMetaData(beanInstantiatorMcName));
 
+         // ahem
+         if(service instanceof StatelessContainer)
+         {
+            ((StatelessContainer) service).setBusinessObjectFactory(new EJB31StatelessBusinessObjectFactory());
+         }
+         if(service instanceof StatefulContainer)
+            ((StatefulContainer) service).setBusinessObjectFactory(new EJB31StatefulBusinessObjectFactory(kernel));
       }
 
       if(unit != null)

Modified: branches/JBoss-AS-6.0.x_ipv6/ejb3/src/resources/META-INF/ejb3-as-deployers-jboss-beans.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/ejb3/src/resources/META-INF/ejb3-as-deployers-jboss-beans.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/ejb3/src/resources/META-INF/ejb3-as-deployers-jboss-beans.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -149,6 +149,8 @@
       </uninstall>
 
    </bean>
+
+   <bean name="Ejb3DeploymentDeployer" class="org.jboss.ejb3.deployers.Ejb3DeploymentDeployer"/>
    
    <bean name="AppClientParsingDeployer" class="org.jboss.ejb3.deployers.AppClientParsingDeployer">
       <!-- TODO: check depends -->

Modified: branches/JBoss-AS-6.0.x_ipv6/server/src/etc/deploy/jboss-logging.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/server/src/etc/deploy/jboss-logging.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/server/src/etc/deploy/jboss-logging.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -103,7 +103,7 @@
          <property name="to">admin at myhost.domain.com</property>
          <property name="from">nobody at myhost.domain.com</property>
          <property name="subject">JBoss Sever Errors</property>
-         <property name="sMTPHost">localhost</property>
+         <property name="SMTPHost">localhost</property>
          <property name="bufferSize">10</property>
       </properties>
 

Modified: branches/JBoss-AS-6.0.x_ipv6/server/src/etc/deployers/core-naming-jboss-beans.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/server/src/etc/deployers/core-naming-jboss-beans.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/server/src/etc/deployers/core-naming-jboss-beans.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -14,7 +14,7 @@
 
     <bean name="NameSpaces" class="org.jboss.reloaded.naming.service.NameSpaces"/>
 
-    <bean name="JavaEEModuleIdentifier" class="org.jboss.as.javaee.SimpleJavaEEModuleIdentifier"/>
+    <bean name="JavaEEModuleIdentifier" class="org.jboss.as.naming.javaee.JavaEEModuleIdentifier"/>
 
     <bean name="NamingJavaEEApplicationInformer" class="org.jboss.as.naming.javaee.NamingJavaEEApplicationInformer"/>
     <bean name="NamingJavaEEModuleInformer" class="org.jboss.as.naming.javaee.NamingJavaEEModuleInformer">

Modified: branches/JBoss-AS-6.0.x_ipv6/server/src/etc/deployers/switchboard-clustered-jboss-beans.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/server/src/etc/deployers/switchboard-clustered-jboss-beans.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/server/src/etc/deployers/switchboard-clustered-jboss-beans.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -5,17 +5,22 @@
     <bean  name="org.jboss.switchboard.WebEnvironmentSwitchBoardDeployer" class="org.jboss.switchboard.mc.deployer.WebEnvironmentSwitchBoardDeployer">
         <constructor><parameter class="org.jboss.reloaded.naming.deployers.javaee.JavaEEComponentInformer"><inject/></parameter></constructor>
     </bean>
-    <!--  Disabled till we have EJB3 containers integrated with switchboard    
     <bean  name="org.jboss.switchboard.EJBEnvironmentSwitchBoardDeployer" class="org.jboss.switchboard.mc.deployer.EJBEnvironmentSwitchBoardDeployer">
         <constructor><parameter class="org.jboss.reloaded.naming.deployers.javaee.JavaEEComponentInformer"><inject/></parameter></constructor>
     </bean>
-    -->
     
     <!--  Resource providers -->
 
     <!--  processes env-entry resources (EE.5.4 of Java EE6 spec) -->
     <bean name="org.jboss.switchboard.EnvEntryResourceProvider" class="org.jboss.switchboard.mc.resource.provider.EnvEntryResourceProvider"/>
 
+    <!-- Resource provider for resource-env-ref of type javax.ejb.EJBContext, javax.ejb.SessionContext -->
+    <bean name="org.jboss.switchboard.EJBContextResEnvRefProvider" class="org.jboss.as.ejb3.switchboard.resource.provider.EJBContextResourceEnvRefResourceProvider">
+        <constructor>
+            <parameter class="java.lang.String"><value>EJBContextBinder</value></parameter>
+        </constructor>
+    </bean>    
+
     <!--  processes resource-env-ref resources (EE.5.8 of Java EE6 spec) -->
     <bean name="org.jboss.switchboard.ResourceEnvRefResourceProvider" class="org.jboss.switchboard.mc.resource.provider.ResourceEnvRefProvider">
         <property name="typedResourceEnvRefResourceProviders">
@@ -24,6 +29,34 @@
                     <key>javax.xml.ws.WebServiceContext</key>
                     <value><inject bean="org.jboss.switchboard.WebServiceContextResourceProvider"/></value>
                 </entry>
+                <entry>
+                    <key>javax.ejb.EJBContext</key>
+                    <value><inject bean="org.jboss.switchboard.EJBContextResEnvRefProvider"/></value>
+                </entry>
+                <entry>
+                    <key>javax.ejb.SessionContext</key>
+                    <value><inject bean="org.jboss.switchboard.EJBContextResEnvRefProvider"/></value>
+                </entry>
+                <entry>
+                    <key>javax.ejb.MessageDrivenContext</key>
+                    <value><inject bean="org.jboss.switchboard.EJBContextResEnvRefProvider"/></value>
+                </entry>
+                <entry>
+                    <key>javax.ejb.TimerService</key>
+                    <value>
+                        <bean name="org.jboss.switchboard.TimerServiceResEnvRefProvider" class="org.jboss.as.ejb3.switchboard.resource.provider.TimerServiceResourceEnvRefResourceProvider">
+                            <constructor>
+                                <parameter class="java.lang.String"><value>TimerServiceBinder</value></parameter>
+                            </constructor>                    
+                        </bean>
+                    </value>
+                </entry>
+                <entry>
+                    <key>javax.transaction.UserTransaction</key>
+                    <value>
+                        <bean name="org.jboss.switchboard.UserTransactionResEnvRefResourceProvider" class="org.jboss.as.switchboard.resource.provider.UserTransactionResourceEnvRefResourceProvider"/>
+                    </value>
+                </entry>
             </map>           
         </property>
     </bean>
@@ -38,6 +71,11 @@
                 </entry>
             </map>           
         </property>
+        <property name="fallbackResourceRefResourceProviders">
+            <list>
+                <inject bean="org.jboss.switchboard.ManagedBeanResourceRefResourceProvider"/>
+            </list>
+        </property>
     </bean>
 
     <!--  ResourceProvider for java:comp/ORB (EE.5.12 of Java EE6 spec) -->
@@ -49,6 +87,19 @@
     <!--  ResourceProvider for java:comp/TransactionSynchronizationRegistry (EE.5.11 of Java EE 6 spec) -->
     <bean name="org.jboss.switchboard.TransactionSyncRegistryRefResourceProvider" class="org.jboss.as.switchboard.resource.provider.TransactionSynchronizationRefResourceProvider"/>
 
+    <!-- ResourceProvider for java:comp/EJBContext -->
+    <bean name="org.jboss.switchboard.EJBContextResourceProvider" class="org.jboss.as.ejb3.switchboard.resource.provider.EJBContextResourceProvider">
+        <constructor>
+            <parameter class="java.lang.String"><value>EJBContextBinder</value></parameter>
+        </constructor>
+    </bean>
+
+    <!-- ResourceProvider for java:comp/TimerService -->
+    <bean name="org.jboss.switchboard.TimerServiceResourceProvider" class="org.jboss.as.ejb3.switchboard.resource.provider.TimerServiceResourceProvider">
+        <constructor>
+            <parameter class="java.lang.String"><value>TimerServiceBinder</value></parameter>
+        </constructor>                    
+    </bean>
     
     <!-- Resource provider registry -->
     <bean name="org.jboss.switchboard.ResourceProviderRegistry" class="org.jboss.switchboard.mc.resource.provider.ResourceProviderRegistry">
@@ -65,10 +116,10 @@
                 <inject bean="org.jboss.switchboard.AnnotatedEJBRefResourceProvider"/>
                 -->
                 <inject bean="org.jboss.switchboard.BeanManagerResourceProvider"/>
-                <!-- Disabled till container themselves stop binding into java:comp 
-                    <inject bean="org.jboss.switchboard.ORBRefResourceProvider"/>
-                    <inject bean="org.jboss.switchboard.UserTransactionRefResourceProvider"/>
-                -->
+                <inject bean="org.jboss.switchboard.ORBRefResourceProvider"/>
+                <inject bean="org.jboss.switchboard.UserTransactionRefResourceProvider"/>
+                <inject bean="org.jboss.switchboard.EJBContextResourceProvider"/>
+                <inject bean="org.jboss.switchboard.TimerServiceResourceProvider"/>
                 <!-- Disabled till https://jira.jboss.org/browse/JBAS-8465 is fixed 
                 <inject bean="org.jboss.switchboard.TransactionSyncRegistryRefResourceProvider"/>
                 -->

Modified: branches/JBoss-AS-6.0.x_ipv6/server/src/etc/deployers/switchboard-jboss-beans.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/server/src/etc/deployers/switchboard-jboss-beans.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/server/src/etc/deployers/switchboard-jboss-beans.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -5,17 +5,22 @@
     <bean  name="org.jboss.switchboard.WebEnvironmentSwitchBoardDeployer" class="org.jboss.switchboard.mc.deployer.WebEnvironmentSwitchBoardDeployer">
         <constructor><parameter class="org.jboss.reloaded.naming.deployers.javaee.JavaEEComponentInformer"><inject/></parameter></constructor>
     </bean>
-    <!--  Disabled till we have EJB3 containers integrated with switchboard    
     <bean  name="org.jboss.switchboard.EJBEnvironmentSwitchBoardDeployer" class="org.jboss.switchboard.mc.deployer.EJBEnvironmentSwitchBoardDeployer">
         <constructor><parameter class="org.jboss.reloaded.naming.deployers.javaee.JavaEEComponentInformer"><inject/></parameter></constructor>
     </bean>
-    -->
     
     <!--  Resource providers -->
 
     <!--  processes env-entry resources (EE.5.4 of Java EE6 spec) -->
     <bean name="org.jboss.switchboard.EnvEntryResourceProvider" class="org.jboss.switchboard.mc.resource.provider.EnvEntryResourceProvider"/>
 
+    <!-- Resource provider for resource-env-ref of type javax.ejb.EJBContext, javax.ejb.SessionContext -->
+    <bean name="org.jboss.switchboard.EJBContextResEnvRefProvider" class="org.jboss.as.ejb3.switchboard.resource.provider.EJBContextResourceEnvRefResourceProvider">
+        <constructor>
+            <parameter class="java.lang.String"><value>EJBContextBinder</value></parameter>
+        </constructor>
+    </bean>    
+
     <!--  processes resource-env-ref resources (EE.5.8 of Java EE6 spec) -->
     <bean name="org.jboss.switchboard.ResourceEnvRefResourceProvider" class="org.jboss.switchboard.mc.resource.provider.ResourceEnvRefProvider">
         <property name="typedResourceEnvRefResourceProviders">
@@ -24,6 +29,34 @@
                     <key>javax.xml.ws.WebServiceContext</key>
                     <value><inject bean="org.jboss.switchboard.WebServiceContextResourceProvider"/></value>
                 </entry>
+                <entry>
+                    <key>javax.ejb.EJBContext</key>
+                    <value><inject bean="org.jboss.switchboard.EJBContextResEnvRefProvider"/></value>
+                </entry>
+                <entry>
+                    <key>javax.ejb.SessionContext</key>
+                    <value><inject bean="org.jboss.switchboard.EJBContextResEnvRefProvider"/></value>
+                </entry>
+                <entry>
+                    <key>javax.ejb.MessageDrivenContext</key>
+                    <value><inject bean="org.jboss.switchboard.EJBContextResEnvRefProvider"/></value>
+                </entry>
+                <entry>
+                    <key>javax.ejb.TimerService</key>
+                    <value>
+                        <bean name="org.jboss.switchboard.TimerServiceResEnvRefProvider" class="org.jboss.as.ejb3.switchboard.resource.provider.TimerServiceResourceEnvRefResourceProvider">
+                            <constructor>
+                                <parameter class="java.lang.String"><value>TimerServiceBinder</value></parameter>
+                            </constructor>                    
+                        </bean>
+                    </value>
+                </entry>
+                <entry>
+                    <key>javax.transaction.UserTransaction</key>
+                    <value>
+                        <bean name="org.jboss.switchboard.UserTransactionResEnvRefResourceProvider" class="org.jboss.as.switchboard.resource.provider.UserTransactionResourceEnvRefResourceProvider"/>
+                    </value>
+                </entry>
             </map>           
         </property>
     </bean>
@@ -38,6 +71,11 @@
                 </entry>
             </map>           
         </property>
+        <property name="fallbackResourceRefResourceProviders">
+            <list>
+                <inject bean="org.jboss.switchboard.ManagedBeanResourceRefResourceProvider"/>
+            </list>
+        </property>
     </bean>
 
     <!--  ResourceProvider for java:comp/UserTransaction (EE.5.10 of Java EE 6 spec) -->
@@ -46,6 +84,20 @@
     <!--  ResourceProvider for java:comp/TransactionSynchronizationRegistry (EE.5.11 of Java EE 6 spec) -->
     <bean name="org.jboss.switchboard.TransactionSyncRegistryRefResourceProvider" class="org.jboss.as.switchboard.resource.provider.TransactionSynchronizationRefResourceProvider"/>
 
+    <!-- ResourceProvider for java:comp/EJBContext -->
+    <bean name="org.jboss.switchboard.EJBContextResourceProvider" class="org.jboss.as.ejb3.switchboard.resource.provider.EJBContextResourceProvider">
+        <constructor>
+            <parameter class="java.lang.String"><value>EJBContextBinder</value></parameter>
+        </constructor>
+    </bean>
+
+    <!-- ResourceProvider for java:comp/TimerService -->
+    <bean name="org.jboss.switchboard.TimerServiceResourceProvider" class="org.jboss.as.ejb3.switchboard.resource.provider.TimerServiceResourceProvider">
+        <constructor>
+            <parameter class="java.lang.String"><value>TimerServiceBinder</value></parameter>
+        </constructor>                    
+    </bean>
+    
     <!-- Resource provider registry -->
     <bean name="org.jboss.switchboard.ResourceProviderRegistry" class="org.jboss.switchboard.mc.resource.provider.ResourceProviderRegistry">
         <property name="resourceProviders">
@@ -61,12 +113,13 @@
                 <inject bean="org.jboss.switchboard.AnnotatedEJBRefResourceProvider"/>
                 -->
                 <inject bean="org.jboss.switchboard.BeanManagerResourceProvider"/>
-                <!-- Disabled till container themselves stop binding into java:comp
-                    <inject bean="org.jboss.switchboard.UserTransactionRefResourceProvider"/>
-                -->
+                <inject bean="org.jboss.switchboard.UserTransactionRefResourceProvider"/>
+                <inject bean="org.jboss.switchboard.EJBContextResourceProvider"/>
+                <inject bean="org.jboss.switchboard.TimerServiceResourceProvider"/>
                 <!-- Disabled till https://jira.jboss.org/browse/JBAS-8465 is fixed
                 <inject bean="org.jboss.switchboard.TransactionSyncRegistryRefResourceProvider"/>
                 -->
+                <!-- java:comp/ -->
             </list>
         </property>
 

Copied: branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/naming/javaee/JavaEEModuleIdentifier.java (from rev 109526, trunk/server/src/main/java/org/jboss/as/naming/javaee/JavaEEModuleIdentifier.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/naming/javaee/JavaEEModuleIdentifier.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/naming/javaee/JavaEEModuleIdentifier.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.naming.javaee;
+
+import org.jboss.as.javaee.SimpleJavaEEModuleIdentifier;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.metadata.client.jboss.JBossClientMetaData;
+import org.jboss.metadata.ejb.jboss.JBossMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.reloaded.naming.deployers.javaee.JavaEEModuleInformer;
+import org.jboss.reloaded.naming.deployers.javaee.JavaEEModuleInformer.ModuleType;
+
+/**
+ * @see #getModuleType(DeploymentUnit) to see why we have this class instead
+ * of just using {@link SimpleJavaEEModuleIdentifier}
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public class JavaEEModuleIdentifier extends SimpleJavaEEModuleIdentifier
+{
+
+   /**
+    * The original {@link SimpleJavaEEModuleIdentifier#getModuleType(DeploymentUnit)} has a hackish way of
+    * identifying the Module type for a EJB deployment. That original implementation doesn't consider a unit
+    * to be of type {@link ModuleType#EJB} if the deployment only contains (EJB2.x) entity beans.
+    * <p>
+    *    Unlike that original implementation, in this overridden implementation, we consider a unit to be
+    *    of type {@link ModuleType#EJB} if it contains {@link JBossMetaData} attachment and we don't do any additional
+    *    checks.
+    * </p>
+    */
+   @Override
+   public org.jboss.reloaded.naming.deployers.javaee.JavaEEModuleInformer.ModuleType getModuleType(DeploymentUnit unit) 
+   {
+      if(unit.isAttachmentPresent(JBossClientMetaData.class))
+         return JavaEEModuleInformer.ModuleType.APP_CLIENT;
+      if(unit.isAttachmentPresent(JBossMetaData.class))
+         return JavaEEModuleInformer.ModuleType.EJB;
+      if(unit.isAttachmentPresent(JBossWebMetaData.class))
+         return JavaEEModuleInformer.ModuleType.WEB;
+      return JavaEEModuleInformer.ModuleType.JAVA;
+   }
+}

Modified: branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/naming/javaee/NamingJavaEEComponentInformer.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/naming/javaee/NamingJavaEEComponentInformer.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/naming/javaee/NamingJavaEEComponentInformer.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -24,6 +24,7 @@
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
 import org.jboss.metadata.web.jboss.JBossServletMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
 import org.jboss.reloaded.naming.deployers.javaee.JavaEEComponentInformer;
 
 /**
@@ -56,4 +57,10 @@
    {
       return unit.isAttachmentPresent(JBossEnterpriseBeanMetaData.class) || unit.isAttachmentPresent(JBossServletMetaData.class);
    }
+   
+   @Override
+   public boolean belongsToWebModule(DeploymentUnit deploymentUnit)
+   {
+      return deploymentUnit.isAttachmentPresent(JBossWebMetaData.class);
+   }
 }

Modified: branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/naming/javaee/NamingJavaEEModuleInformer.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/naming/javaee/NamingJavaEEModuleInformer.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/naming/javaee/NamingJavaEEModuleInformer.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -21,19 +21,19 @@
  */
 package org.jboss.as.naming.javaee;
 
+import java.lang.reflect.Array;
+
 import org.jboss.as.javaee.SimpleJavaEEModuleIdentifier;
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.reloaded.naming.deployers.javaee.JavaEEModuleInformer;
 
-import java.lang.reflect.Array;
-
 /**
  * @author <a href="cdewolf at redhat.com">Carlo de Wolf</a>
  */
 public class NamingJavaEEModuleInformer extends NamingJavaEEApplicationInformer implements JavaEEModuleInformer
 {
    // TODO: for now we delegate to the former JPA SPI informer. This informer should be merged with that one into one integration component
-   private SimpleJavaEEModuleIdentifier identifier;
+   private SimpleJavaEEModuleIdentifier identifier = new JavaEEModuleIdentifier();
 
    private String[] requiredAttachments;
 
@@ -93,4 +93,5 @@
       this.identifier = identifier;
       this.requiredAttachments = concat(super.getRequiredAttachments(), identifier.getRequiredAttachments());
    }
+   
 }

Modified: branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/switchboard/resource/provider/UserTransactionRefResourceProvider.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/switchboard/resource/provider/UserTransactionRefResourceProvider.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/switchboard/resource/provider/UserTransactionRefResourceProvider.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -10,7 +10,7 @@
 import org.jboss.switchboard.spi.Resource;
 
 /**
- * UserTransactionRefResourceProvider
+ * {@link MCBasedResourceProvider} for java:comp/UserTransaction
  *
  * @author Jaikiran Pai
  * @version $Revision: $
@@ -23,7 +23,7 @@
       return UserTransactionRefType.class;
    }
 
-   public Resource provide(DeploymentUnit context, UserTransactionRefType type)
+   public Resource provide(DeploymentUnit context, UserTransactionRefType userTransactionRef)
    {
       return new LinkRefResource("UserTransaction");
    }

Copied: branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/switchboard/resource/provider/UserTransactionResourceEnvRefResourceProvider.java (from rev 109526, trunk/server/src/main/java/org/jboss/as/switchboard/resource/provider/UserTransactionResourceEnvRefResourceProvider.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/switchboard/resource/provider/UserTransactionResourceEnvRefResourceProvider.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/as/switchboard/resource/provider/UserTransactionResourceEnvRefResourceProvider.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.switchboard.resource.provider;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.switchboard.impl.resource.LinkRefResource;
+import org.jboss.switchboard.javaee.jboss.environment.JBossResourceEnvRefType;
+import org.jboss.switchboard.mc.spi.MCBasedResourceProvider;
+import org.jboss.switchboard.spi.Resource;
+
+/**
+ * {@link MCBasedResourceProvider} for resource-env-ref which references UserTransaction
+ *
+ * @author Jaikiran Pai
+ * @version $Revision: $
+ */
+public class UserTransactionResourceEnvRefResourceProvider implements MCBasedResourceProvider<JBossResourceEnvRefType>
+{
+
+   @Override
+   public Class<JBossResourceEnvRefType> getEnvironmentEntryType()
+   {
+      return JBossResourceEnvRefType.class;
+   }
+
+   @Override
+   public Resource provide(DeploymentUnit unit, JBossResourceEnvRefType resEnvRef)
+   {
+      return new LinkRefResource("UserTransaction");
+   }
+
+}

Modified: branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/ejb/plugins/SecurityInterceptor.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/ejb/plugins/SecurityInterceptor.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/server/src/main/java/org/jboss/ejb/plugins/SecurityInterceptor.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -248,18 +248,19 @@
          throw e;
       }
 
+      RunAs runAsIdentityToPush = runAsIdentity;
       /**
        * Special case: if <use-caller-identity> configured and
        * the caller is arriving with a run-as, we need to push that run-as
        */
       if (callerRunAsIdentity != null && this.isUseCallerIdentity)
-         this.runAsIdentity = callerRunAsIdentity;
+         runAsIdentityToPush = callerRunAsIdentity;
 
       /* If a run-as role was specified, push it so that any calls made
        by this bean will have the runAsRole available for declarative
        security checks.
       */
-      SecurityActions.pushRunAsIdentity(runAsIdentity);
+      SecurityActions.pushRunAsIdentity(runAsIdentityToPush);
 
       try
       {

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/imports/config/tests-crash-recovery.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/imports/config/tests-crash-recovery.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/imports/config/tests-crash-recovery.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -17,7 +17,7 @@
   -->
 
    <!-- 
-    | JBQA-2176 - JBossTS crash recovery tests.
+    | JBQA-2176 - JBossTS crash recovery tests with EJB3.
     |
     | Usage for all tests:
     |    ./build.sh tests-ts-crash-recovery
@@ -28,29 +28,63 @@
     |  or for particular test scenario:
     |    ./build.sh tests-ts-crash-recovery -Djbossts.db=psql_8.3 -Djbossts.tstype=jts -Djbossts.tsdemarc=bmt -Djbossts.testcase=none.rev -Djbossts.target=crash-tests-single
     |
-    | Note: If you want to force the wiping out any txs in doubt from DB before the test you can use the property -DwipeOutTxsInDoubtBeforeTest=true. 
+    | Usage for cluster tests:
+    |    ./build.sh tests-ts-crash-recovery -Djbossts.db=oracle_rac -Djbossts.tstype=jts -Djbossts.target=crash-tests-single-db-tstype 
+    |
+    | Added new option for settings of datasource credentials:
+    |    -Djbossts.credentials=cr1 - the default one
+    |         <xa-datasource-property name="User">crashrec</xa-datasource-property>
+    |         <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+    |    -Djbossts.credentials=cr2
+    |         <user-name>crash0</user-name>
+    |         <password>crash0</password>
+    |         <recover-user-name>crashrec</recover-user-name>
+    |         <recover-password>crashrec</recover-password>
+    |    -Djbossts.credentials=cr3
+    |         <security-domain>CrashRecoveryDomain0</security-domain>
+    |         <recover-user-name>crashrec</recover-user-name>
+    |         <recover-password>crashrec</recover-password>
+    |    -Djbossts.credentials=cr4
+    |         <security-domain>CrashRecoveryDomain0</security-domain>
+    |         <recover-security-domain>CrashRecoveryDomain</recover-security-domain>
+    |
+    | Note 1: The 'jbossts.credentials' property is useless in connection with -Djbossts.db=[oracle_rac|oracle_rac_r2].
+    | Note 2: If you want to force the wiping out any txs in doubt from DB before the test you can use the property -DwipeOutTxsInDoubtBeforeTest=true.
+    | Note 3: For EWP, use '-Djbossts.jtaonly=true' to prepare only jta profile in the AS server. Otherwise both JTA/JTS profiles are always created/checked.
+    |
+    | Possible values for the jbossts.db parameter are: 
+    |     psql_8.2 psql_8.3 psql_8.4 psql_9.0 sybase_15 sybase_15.5 oracle_10 oracle_11 oracle_11_r2 db2_9.7 
+    |     mysql_5.0 mysql_5.1 mssql_2005 mssql_2008 oracle_rac oracle_rac_lb oracle_rac_r2 oracle_rac_r2_lb
+    | Data-sources related to these DBs can be found in src/resources/jbossts/resources/.
     -->
    <target name="tests-ts-crash-recovery" depends="init-dependencies"
            description="Runs JBossTS crash recovery tests">
 
-      <available file="${jboss.dist}/server/crashrecovery-jta" property="have.crashrecovery.jta.profile" value="true"/>
-      <available file="${jboss.dist}/server/crashrecovery-jts" property="have.crashrecovery.jts.profile" value="true"/>
-      <condition property="have.crash.recovery.profiles">
-        <and>
-          <istrue value="${have.crashrecovery.jta.profile}"/>
-          <istrue value="${have.crashrecovery.jts.profile}"/>
-        </and>
+      <!--  prepare jta profile  -->
+      <available file="${jboss.dist}/server/crashrecovery-jta" property="have.crash.recovery.jta.profile" value="true"/>
+      <antcall target="prepare-crashrec-profile-jta" />
+
+      <!--  prepare jts profile  -->
+      <condition property="have.crash.recovery.jts.profile">
+         <or>
+            <available file="${jboss.dist}/server/crashrecovery-jts"/>
+            <isset property="jbossts.jtaonly"/>
+         </or>
       </condition>
-
-      <antcall target="prepare-crashrec-profiles" />
+      <antcall target="prepare-crashrec-profile-jts" />
    	
       <property name="jbossts.target" value="crash-tests" />
-      <property name="jbossts.max.time" value="300000" />
+      <property name="jbossts.max.time" value="420000" />
+      <property name="jbossts.credentials" value="cr1" />
    	
       <run-as-test target="${jbossts.target}" />
 
    </target>
 
+   <target name="tests-ts-sweep-crashrec-profiles">
+      <delete dir="${jboss.dist}/server/crashrecovery-jta" />
+      <delete dir="${jboss.dist}/server/crashrecovery-jts" />
+   </target>
 
   <!--
     | Macros and others
@@ -89,6 +123,7 @@
             <sysproperty key="jbossts.tstype" value="${jbossts.tstype}" />
             <sysproperty key="jbossts.tsdemarc" value="${jbossts.tsdemarc}" />
             <sysproperty key="jbossts.testcase" value="${jbossts.testcase}" />
+            <sysproperty key="jbossts.credentials" value="${jbossts.credentials}" />
             <sysproperty key="testTime" value="${jbossts.max.time}" />
             <env key="JBOSS_HOME" value="${jbosstest.dist}" />
             <arg value="-f"/>
@@ -101,7 +136,7 @@
    </macrodef>
    
    
-   <target name="prepare-crashrec-profiles" unless="have.crash.recovery.profiles">
+   <target name="prepare-crashrec-profile-jta" unless="have.crash.recovery.jta.profile">
       <delete dir="${jboss.dist}/server/crashrecovery-jta" />
       <create-config baseconf="default" newconf="crashrecovery-jta">
          <patternset>
@@ -112,6 +147,10 @@
          </patternset>
       </create-config>
 
+      <antcall target="setup-recovery"><param name="conf" value="crashrecovery-jta"/></antcall>
+   </target>
+   
+   <target name="prepare-crashrec-profile-jts" unless="have.crash.recovery.jts.profile">
       <delete dir="${jboss.dist}/server/crashrecovery-jts" />
       <create-config baseconf="all" newconf="crashrecovery-jts">
          <patternset>
@@ -127,38 +166,50 @@
          <property name="target.server.dir" location="${jboss.dist}/server/crashrecovery-jts"/>
       </ant>
 
-      <setup-crash-recovery conf="crashrecovery-jta"/>
-      <setup-crash-recovery conf="crashrecovery-jts"/>
+      <antcall target="setup-recovery"><param name="conf" value="crashrecovery-jts"/></antcall>       
    </target>
   
-	
-   <macrodef name="setup-crash-recovery">
-      <attribute name="conf"/>
-      <sequential>
-      
-         <!-- enable crash recovery and point it to our datasource -->
-         <replaceregexp file="${jboss.dist}/server/@{conf}/deploy/transaction-jboss-beans.xml" flags="s"
-            match="(&lt;bean name=&quot;JTAEnvironmentBean&quot;)(.*?)(&lt;/bean&gt;)"
-            replace="\1\2@@@PUT_RECOVERY_PROPERTY_HERE@@@\3" />
-         <replace file="${jboss.dist}/server/@{conf}/deploy/transaction-jboss-beans.xml">
-            <replacetoken><![CDATA[@@@PUT_RECOVERY_PROPERTY_HERE@@@]]></replacetoken>
-            <replacevalue><![CDATA[
-        <property name="xaResourceRecoveryInstances">
-            <list elementClass="java.lang.String">
-                <value>com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery;jndiname=CrashRecoveryDS</value>
-            </list>
-        </property>
-]]></replacevalue>
-         </replace>
-         
+   <target name="setup-recovery">
+      <antcall target="setup-recovery-jbossts-jpa" />
+      <antcall target="setup-security-domains" />
+   </target>
+
+   <target name="setup-recovery-jbossts-jpa">
+      <echo message="Setting up crash recovery for profile ${conf}.."/>
          <!-- more verbose logging 
          FIXME modify it for new transactions, i.e. for deploy/transaction-jboss-beans.xml file
       	 <replace file="${jboss.dist}/server/@{conf}/conf/jbossts-properties.xml">
       	    <replacetoken><![CDATA[type="System" value="0x00000000"]]></replacetoken>
       	    <replacevalue><![CDATA[type="System" value="0xffffffff"]]></replacevalue>
       	 </replace-->
-          
-      </sequential>
-   </macrodef>
+   </target>
+	
+   <target name="setup-security-domains">
+      <echo message="Setting up security domains for profile ${conf}.."/>
+   	  <replace file="${jboss.dist}/server/${conf}/conf/login-config.xml">
+         <replacetoken><![CDATA[</policy>]]></replacetoken>
+         <replacevalue><![CDATA[
+    <application-policy name="CrashRecoveryDomain">
+        <authentication>
+            <login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
+                <module-option name="username">crashrec</module-option>
+                <module-option name="password">-170d8ac0642414f0207a6df87216de44</module-option>
+                <module-option name="managedConnectionFactoryName">jboss.jca:service=XATxCM,name=CrashRecoveryDS</module-option>
+            </login-module>
+        </authentication>
+    </application-policy>
 
+    <application-policy name="CrashRecoveryDomain0">
+        <authentication>
+            <login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
+                <module-option name="username">crash0</module-option>
+                <module-option name="password">-47043946269bfc76</module-option>
+                <module-option name="managedConnectionFactoryName">jboss.jca:service=XATxCM,name=CrashRecoveryDS</module-option>
+            </login-module>
+        </authentication>
+    </application-policy>
+</policy>]]></replacevalue>
+      </replace>
+   </target>
+
 </project>

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/pom.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/pom.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/pom.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -13,6 +13,10 @@
   <name>JBoss Application Server Testsuite</name>
   <url>http://www.jboss.org/jbossas</url>
   <description>JBoss Application Server Testsuite</description>
+  
+  <build>
+    <sourceDirectory>src/main</sourceDirectory>
+  </build>
     
   <!-- 
     -  This pom lists dependencies used in the testsuite which are not included in the

Deleted: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncBean.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncBean.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncBean.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -1,70 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
-  *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ejb3.async;
-
-import javax.ejb.*;
-import java.util.concurrent.*;
-import java.util.logging.Logger;
-
-/**
- * Stateful implementation of an EJB w/ Asynchronous methods
- *
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- */
- at Stateful
- at Remote(AsyncCommonBusiness.class)
-public class AsyncBean implements AsyncCommonBusiness
-{
-   // --------------------------------------------------------------------------------||
-   // Class Members ------------------------------------------------------------------||
-   // --------------------------------------------------------------------------------||
-
-   /**
-    * Logger
-    */
-   private static final Logger log = Logger.getLogger(AsyncBean.class.getName());
-
-   // --------------------------------------------------------------------------------||
-   // Instance Members ---------------------------------------------------------------||
-   // --------------------------------------------------------------------------------||
-
-   /**
-    * Counter
-    */
-   private int current;
-
-   // --------------------------------------------------------------------------------||
-   // Required Implementations -------------------------------------------------------||
-   // --------------------------------------------------------------------------------||
-
-   /**
-    * {@inheritDoc}
-    * @see org.jboss.jbossas.embedded.testsuite.ejb3.async.AsyncLocalBusiness#getNextCounter()
-    */
-   @Asynchronous
-   public Future<Integer> getNextCounter()
-   {
-      // Return
-      return new AsyncResult<Integer>(++current);
-   }
-
-}
\ No newline at end of file

Copied: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncBean.java (from rev 109526, trunk/testsuite/src/main/org/jboss/test/ejb3/async/AsyncBean.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncBean.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncBean.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,20 @@
+package org.jboss.test.ejb3.async;
+
+import javax.ejb.*;
+import java.util.concurrent.Future;
+
+/**
+ * Implementation of an EJB with @Asynchronous methods
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ */
+ at Stateless
+ at Local(AsyncLocalBusiness.class)
+ at Remote(AsyncRemoteBusiness.class)
+public class AsyncBean implements AsyncCommonBusiness
+{
+    @Asynchronous
+    public Future<String> getExecutingThreadName() {
+        return new AsyncResult<String>(Thread.currentThread().getName());
+    }
+}

Deleted: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncCommonBusiness.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncCommonBusiness.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncCommonBusiness.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
-  *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ejb3.async;
-
-import java.util.concurrent.Future;
-
-/**
- * Business view of a bean with asynchronous methods
- *
- * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
- */
-public interface AsyncCommonBusiness
-{
-   // --------------------------------------------------------------------------------||
-   // Contracts ----------------------------------------------------------------------||
-   // --------------------------------------------------------------------------------||
-
-   /**
-    * Returns the next count in a series, starting with 1 and incrementing
-    * on subsequent invocations
-    */
-   Future<Integer> getNextCounter();
-}
\ No newline at end of file

Copied: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncCommonBusiness.java (from rev 109526, trunk/testsuite/src/main/org/jboss/test/ejb3/async/AsyncCommonBusiness.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncCommonBusiness.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncCommonBusiness.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ejb3.async;
+
+import java.util.concurrent.Future;
+
+/**
+ * Business view of a bean with asynchronous methods
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ */
+public interface AsyncCommonBusiness
+{
+    // --------------------------------------------------------------------------------||
+    // Contracts ----------------------------------------------------------------------||
+    // --------------------------------------------------------------------------------||
+
+    /**
+     * Returns the Thread of execution for this invocation
+     *
+     * @return
+     */
+    Future<String> getExecutingThreadName();
+}
\ No newline at end of file

Copied: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncLocalBusiness.java (from rev 109526, trunk/testsuite/src/main/org/jboss/test/ejb3/async/AsyncLocalBusiness.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncLocalBusiness.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncLocalBusiness.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ejb3.async;
+
+/**
+ * Local business view of a bean with asynchronous methods
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ */
+public interface AsyncLocalBusiness extends AsyncCommonBusiness
+{
+}
\ No newline at end of file

Copied: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncRemoteBusiness.java (from rev 109526, trunk/testsuite/src/main/org/jboss/test/ejb3/async/AsyncRemoteBusiness.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncRemoteBusiness.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncRemoteBusiness.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ejb3.async;
+
+/**
+ * Remote business view of a bean with asynchronous methods
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ */
+public interface AsyncRemoteBusiness extends AsyncCommonBusiness
+{
+}
\ No newline at end of file

Copied: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncTesterBean.java (from rev 109526, trunk/testsuite/src/main/org/jboss/test/ejb3/async/AsyncTesterBean.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncTesterBean.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncTesterBean.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ejb3.async;
+
+import javax.ejb.*;
+import java.util.logging.Logger;
+
+/**
+ * EJB Used to test @Asynchronous support by comparing the name
+ * of the current Thread with the one used to execute the
+ * invocation.
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ */
+ at Stateless
+ at Remote(AsyncTesterCommonBusiness.class)
+public class AsyncTesterBean implements AsyncTesterCommonBusiness
+{
+   // --------------------------------------------------------------------------------||
+   // Class Members ------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * Logger
+    */
+   private static final Logger log = Logger.getLogger(AsyncTesterBean.class.getName());
+
+   // --------------------------------------------------------------------------------||
+   // Instance Members ---------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   @EJB
+   private AsyncLocalBusiness local;
+
+   @EJB
+   private AsyncRemoteBusiness remote;
+
+   // --------------------------------------------------------------------------------||
+   // Required Implementations -------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+    /**
+     *
+     * @return
+     */
+    public boolean isLocalInvocationExecutedInNewThread() {
+        final String current = Thread.currentThread().getName();
+        final String used;
+        try{
+            used = local.getExecutingThreadName().get();
+        }
+        catch(final Exception e){
+            throw new RuntimeException(e);
+        }
+        log.info("Local @Asynchronous Invocation - Current:" + current + ", Used: " + used);
+        return !current.equals(used);
+    }
+
+    /**
+     * 
+     * @return
+     */
+    public boolean isRemoteInvocationExecutedInNewThread() {
+        final String current = Thread.currentThread().getName();
+        final String used;
+        try{
+            used = remote.getExecutingThreadName().get();
+        }
+        catch(final Exception e){
+            throw new RuntimeException(e);
+        }
+        log.info("Remote @Asynchronous Invocation - Current:" + current + ", Used: " + used);
+        return !current.equals(used);
+    }
+}
\ No newline at end of file

Copied: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncTesterCommonBusiness.java (from rev 109526, trunk/testsuite/src/main/org/jboss/test/ejb3/async/AsyncTesterCommonBusiness.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncTesterCommonBusiness.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/AsyncTesterCommonBusiness.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+  *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ejb3.async;
+
+import java.util.concurrent.Future;
+
+/**
+ * Business view of a bean which tests @Asynchronous calls
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ */
+public interface AsyncTesterCommonBusiness
+{
+   // --------------------------------------------------------------------------------||
+   // Contracts ----------------------------------------------------------------------||
+   // --------------------------------------------------------------------------------||
+
+   /**
+    * Returns whether or not a local invocation is executed in a new Thread
+    */
+   boolean isLocalInvocationExecutedInNewThread();
+
+   /**
+    * Returns whether or not a remote invocation is executed in a new Thread
+    */
+   boolean isRemoteInvocationExecutedInNewThread();
+}
\ No newline at end of file

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/test/AsyncSessionBeanUnitTestCase.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/test/AsyncSessionBeanUnitTestCase.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/ejb3/async/test/AsyncSessionBeanUnitTestCase.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -24,8 +24,7 @@
 import junit.framework.Assert;
 import junit.framework.Test;
 import org.jboss.test.JBossTestCase;
-import org.jboss.test.ejb3.async.AsyncCommonBusiness;
-import org.jboss.test.ejb3.basic.SimpleSession;
+import org.jboss.test.ejb3.async.AsyncTesterCommonBusiness;
 
 import javax.naming.InitialContext;
 import java.util.concurrent.Future;
@@ -41,8 +40,7 @@
 {
    public static Test suite() throws Exception
    {
-      Test t1 = getDeploySetup(AsyncSessionBeanUnitTestCase.class, "ejb31-async.jar");
-      return t1;
+      return getDeploySetup(AsyncSessionBeanUnitTestCase.class, "ejb31-async.jar");
    }
 
    public AsyncSessionBeanUnitTestCase(String name)
@@ -53,19 +51,22 @@
    public void testRemoteAsyncInvocation()
       throws Exception
    {
-      InitialContext ctx = getInitialContext();
-      String jndiName = "AsyncBean/remote";
-      Object ref = ctx.lookup(jndiName);
-      AsyncCommonBusiness bean = (AsyncCommonBusiness) ref;
-      final Future<Integer> invocation =bean.getNextCounter();
+      final AsyncTesterCommonBusiness bean = this.getTesterBean();
+      Assert.assertTrue("Remote invocation not executed in new Thread",bean.isRemoteInvocationExecutedInNewThread());
+   }
 
-         // Block and test
-         final int value = invocation.get();
-         Assert.assertEquals("Invocation did not return correct result", 1, value);
-         log.info("Got: " + invocation);
-         log.info("Invocation value: " + value);
-         Assert.assertTrue("First invocation did not report as completed", invocation.isDone());
-         Assert.assertFalse("Invocation should not report as cancelled", invocation.isCancelled());
+   public void testLocalAsyncInvocation()
+      throws Exception
+   {
+      final AsyncTesterCommonBusiness bean = this.getTesterBean();
+      Assert.assertTrue("Local invocation not executed in new Thread",bean.isLocalInvocationExecutedInNewThread());
+   }
 
+   private AsyncTesterCommonBusiness getTesterBean() throws Exception {
+      final InitialContext ctx = getInitialContext();
+      final String jndiName = "AsyncTesterBean/remote";
+      final Object ref = ctx.lookup(jndiName);
+      final AsyncTesterCommonBusiness bean = (AsyncTesterCommonBusiness) ref;
+      return bean;
    }
 }
\ No newline at end of file

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/ASCrashRecovery01/TestWithJPA.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/ASCrashRecovery01/TestWithJPA.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/ASCrashRecovery01/TestWithJPA.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -21,13 +21,13 @@
 package org.jboss.test.jbossts.ASCrashRecovery01;
 
 import org.jboss.test.jbossts.recovery.ASFailureSpec;
+import org.jboss.test.jbossts.recovery.RecoveredXid;
 import org.jboss.test.jbossts.taskdefs.JUnitClientTest;
 import org.jboss.test.jbossts.taskdefs.TransactionLog;
 import org.jboss.test.jbossts.taskdefs.Utils;
 import org.jboss.test.jbossts.crash.CrashHelper;
-import org.jboss.test.jbossts.crash.CrashHelperRem;
+import org.jboss.test.jbossts.crash.JPACrashHelperRem;
 import org.jboss.test.jbossts.crash.CrashRem;
-import org.jboss.test.jbossts.crash.RecoveredXid;
 import org.jboss.test.jbossts.crash.TestEntity;
 import org.jboss.test.jbossts.crash.TestEntityHelper;
 import org.jboss.test.jbossts.crash.TestEntityHelperRem;
@@ -47,7 +47,7 @@
 import javax.transaction.UserTransaction;
 
 /**
- * Crash recovery tests with one crash XA resource and one JPA entity resource.
+ * Crash recovery tests with EJB3 entity.
  * 
  * @author <a href="istudens at redhat.com">Ivo Studensky</a>
  * @version $Revision: 1.1 $
@@ -55,7 +55,7 @@
 public class TestWithJPA extends JUnitClientTest
 {
    // the longest time to wait in millis before declaring a test a failed (overridable)
-   private static final int MAX_TEST_TIME = 300000;     // 5 minutes  - allows two intervals of recovery which is 2 minutes by default
+   private static final int MAX_TEST_TIME = 5 * 60 * 1000;     // 5 minutes  - allows two intervals of recovery which is 2 minutes by default
 
    private boolean isCMT = false;
    private boolean clientTx = false;
@@ -73,6 +73,7 @@
    private TransactionLog store;
    private int existingUids;
    private Set<RecoveredXid> existingXidsInDoubt;
+   private String recoveryDatasource = null;
 
    private String serverName = "default";
 
@@ -122,6 +123,8 @@
             wipeOutTxsInDoubtBeforeTest = val.equalsIgnoreCase("true");
          else if ("wipeOutTxsInDoubtAfterTest".equals(key))
             wipeOutTxsInDoubtAfterTest = val.equalsIgnoreCase("true");
+         else if ("recoveryDatasource".equals(key))
+            recoveryDatasource = val;
       }
 
       sb.insert(0, ":\n").insert(0, getName()).insert(0, "Executing test ");
@@ -137,7 +140,7 @@
             storeDir = serverPath + "data/tx-object-store";
          else
             storeDir = serverPath + storeDir;
-
+         System.out.println("transaction log will be stored in " + storeDir + "(file=" + storeImple+")");
          store = new TransactionLog(storeDir, storeImple);
 
          if (expectFailure)
@@ -160,8 +163,8 @@
          if (wipeOutTxsInDoubtBeforeTest)
             wipeOutTxsInDoubt();
 
-         existingXidsInDoubt = lookupCrashHelper().checkXidsInDoubt();
-         if (isDebug)
+         existingXidsInDoubt = lookupCrashHelper().checkXidsInDoubt(recoveryDatasource);
+         if (existingXidsInDoubt.size() > 0)
             print(existingXidsInDoubt.size() + " txs in doubt in database before test run");
 
          // name of this test will be the primary key for test record in DB
@@ -182,7 +185,7 @@
             print("checkDatabase result: " + dbChanged);
          }
          
-         Set<RecoveredXid> xidsInDoubtAfterTest = lookupCrashHelper().checkXidsInDoubt();
+         Set<RecoveredXid> xidsInDoubtAfterTest = lookupCrashHelper().checkXidsInDoubt(recoveryDatasource);
          if (wipeOutTxsInDoubt || wipeOutTxsInDoubtAfterTest)
             wipeOutTxsInDoubt(existingXidsInDoubt, xidsInDoubtAfterTest);
 
@@ -272,7 +275,7 @@
       print("wiping out txs in doubt");
       try
       {
-         lookupCrashHelper().wipeOutTxsInDoubt(xidsToRecover);
+         lookupCrashHelper().wipeOutTxsInDoubt(recoveryDatasource, xidsToRecover);
       }  
       catch (Exception e)
       {
@@ -319,9 +322,9 @@
       return (CrashRem) config.getNamingContext(serverName).lookup(name);
    }
 
-   private CrashHelperRem lookupCrashHelper() throws Exception
+   private JPACrashHelperRem lookupCrashHelper() throws Exception
    {
-      return (CrashHelperRem) config.getNamingContext(serverName).lookup(CrashHelper.REMOTE_JNDI_NAME);
+      return (JPACrashHelperRem) config.getNamingContext(serverName).lookup(CrashHelper.REMOTE_JNDI_NAME);
    }
 
    private UserTransaction startTx() throws NamingException, SystemException, NotSupportedException
@@ -372,7 +375,7 @@
       }
       catch (RuntimeException re)
       {
-         if (re.getCause() instanceof HeuristicMixedException)  //FIXME unreachable condition?
+         if (re.getCause() instanceof HeuristicMixedException)
          {
             // try to recover, this failure was expected maybe?!
             print("Failure was expected (maybe): " + re.getMessage());
@@ -429,20 +432,25 @@
          pendingUids = getPendingUids();
          try 
          {
-            xidsInDoubtAfterTest = lookupCrashHelper().checkXidsInDoubt();
+            xidsInDoubtAfterTest = lookupCrashHelper().checkXidsInDoubt(recoveryDatasource);
          }
          catch (Exception e)
          {
+            e.printStackTrace();
             return false;
          }
          pendingXidsInDoubt = xidsInDoubtAfterTest.size();
 
          if (pendingUids == -1)
+         {
+            print("recoverUids failed, object store error, pendingUids == -1");
             return false;   // object store error
-
+         }
          if (pendingUids <= existingUids && pendingXidsInDoubt <= totalExistingXidsInDoubt)
+         {
+            print("recoverUids success");
             return true;    // all uids in AS and txs in doubt in DB recovered
-
+         }
          pendingUids -= existingUids;
          pendingXidsInDoubt -= totalExistingXidsInDoubt;
 
@@ -454,6 +462,8 @@
          
       } while (maxWait > 0);
 
+      print("recoverUids failed, took too long to recover");
+
       // the test failed to recover some uids - clear them out ready for the next test
       if (pendingUids > 0)
       {

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/ASCrashRecovery01/WipeOutTxsInDoubt.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/ASCrashRecovery01/WipeOutTxsInDoubt.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/ASCrashRecovery01/WipeOutTxsInDoubt.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -20,9 +20,9 @@
  */
 package org.jboss.test.jbossts.ASCrashRecovery01;
 
+import org.jboss.test.jbossts.recovery.CrashHelperRem;
 import org.jboss.test.jbossts.taskdefs.JUnitClientTest;
 import org.jboss.test.jbossts.crash.CrashHelper;
-import org.jboss.test.jbossts.crash.CrashHelperRem;
 import org.apache.tools.ant.BuildException;
 
 import java.util.Map;

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/JTSContextPropagation01/TestContextPropagation.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/JTSContextPropagation01/TestContextPropagation.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/JTSContextPropagation01/TestContextPropagation.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -22,6 +22,8 @@
 
 import org.jboss.test.jbossts.recovery.ASFailureMode;
 import org.jboss.test.jbossts.recovery.ASFailureSpec;
+import org.jboss.test.jbossts.recovery.CrashHelperRem;
+import org.jboss.test.jbossts.recovery.RecoveredXid;
 import org.jboss.test.jbossts.taskdefs.JUnitClientTest;
 import org.jboss.test.jbossts.taskdefs.TransactionLog;
 import org.jboss.test.jbossts.taskdefs.Utils;
@@ -30,8 +32,6 @@
 import org.jboss.test.jbossts.txpropagation.ejb2.TxPropagationEJB2Rem;
 import org.jboss.test.jbossts.txpropagation.ejb3.TxPropagationRem;
 import org.jboss.test.jbossts.crash.CrashHelper;
-import org.jboss.test.jbossts.crash.CrashHelperRem;
-import org.jboss.test.jbossts.crash.RecoveredXid;
 import org.jboss.test.jbossts.crash.TestEntity;
 import org.jboss.test.jbossts.crash.TestEntityHelper;
 import org.jboss.test.jbossts.crash.TestEntityHelperRem;

Copied: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/AppServerJDBCXARecovery.java (from rev 109526, trunk/testsuite/src/main/org/jboss/test/jbossts/crash/AppServerJDBCXARecovery.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/AppServerJDBCXARecovery.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/AppServerJDBCXARecovery.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,591 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2008,
+ * @author Redhat Middleware LLC.
+ */
+package org.jboss.test.jbossts.crash;
+
+import com.arjuna.ats.jta.recovery.XAResourceRecovery;
+
+
+
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.BadPaddingException;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+import javax.transaction.xa.XAResource;
+import javax.naming.InitialContext;
+import javax.sql.XADataSource;
+import javax.sql.ConnectionEventListener;
+import javax.sql.ConnectionEvent;
+import javax.sql.XAConnection;
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.management.MBeanException;
+import javax.management.InstanceNotFoundException;
+import java.sql.SQLException;
+import java.sql.Connection;
+import java.util.Properties;
+import java.util.Iterator;
+import java.util.StringTokenizer;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.io.InputStream;
+import java.io.ByteArrayInputStream;
+import java.lang.reflect.Method;
+import java.beans.PropertyEditor;
+import java.beans.PropertyEditorManager;
+import java.security.NoSuchAlgorithmException;
+import java.security.InvalidKeyException;
+import java.math.BigInteger;
+
+import org.jboss.security.SecurityAssociation;
+import org.jboss.security.SimplePrincipal;
+import org.jboss.logging.Logger;
+
+/**
+ * Taken from https://svn.jboss.org/repos/labs/labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/internal/jbossatx/jta/AppServerJDBCXARecovery.java ,
+ * some changes applied.
+ * Username/password credentials programmatically set to CrashHelper.DS_USER_NAME and CrashHelper.DS_PASSWORD.
+ * 
+ * 
+ * This provides recovery for compliant JDBC drivers accessed via datasources deployed in JBossAS 5
+ * It is not meant to be db driver specific.
+ *
+ * This code is based on JDBCXARecovery, which expects JNDI to contain an XADataSource implementation.
+ * In JBossAS, the object created in JNDI when a -ds.xml file containing <xa-datasource> element is used,
+ * does not implement the XADataSource interface. We therefore use this modified code to pull the
+ * datasource configuration information from the app server's JMX and instantiate an XADataSource from
+ * which it can then create an XAConnection.
+ *
+ * To use this class, add an entry in the JTAEnvironmentBean's xaResourceRecoveryInstances list
+ * for each database for which you need recovery, ensuring the value ends with ;jndiname=<datasource-name>
+ * i.e. the same value as is in the -ds.xml jndi-name element.
+ *
+ * Note for users with secured JMX invokers, use the extended format:
+ *   ;jndiname=MyExampleDbName,username=foo,password=bar
+ * The username and password refer to the JMX invoker, NOT the datasource.
+ *
+ * It's not possible to override the jdbc username and password given in the -ds.xml file at present.
+ * Since the recovery system sometimes needs greater db user privs than the app code, it may be preferable to
+ * set up a -ds.xml file only for recovery usage. This approach works for databases which allow users to
+ * recover one another's transactions, which is most of them. But consult
+ * your db docs or friendly neighbourhood DBA to be sure, then test it anyhow.
+ *
+ * You also need the XARecoveryModule enabled and appropriate values for nodeIdentifier and xaRecoveryNode set.
+ * See the JBossTS recovery guide if you are unclear on how the recovery system works.
+ *
+ * Note: This implementation expects to run inside the app server JVM. It probably won't work
+ * if you configure the recovery manager to run as a separate process. (JMX can be accessed remotely,
+ * but it would need code changes to the lookup function and some classpath additions).
+ *
+ * <bean name="JTAEnvironmentBean" class="com.arjuna.ats.jta.common.JTAEnvironmentBean">
+ *   ...
+ *   <property name="xaResourceRecoveryClassNames">
+ *     <list elementClass="java.lang.String">
+ *       <value>com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery;jndiname=MyExampleDbName[,username=foo,password=bar]</value>
+ *     </list>
+ *   </property>
+ *
+ * deprecated see JBTM-756
+ */
+public class AppServerJDBCXARecovery implements XAResourceRecovery {
+
+// implementation based on com.arjuna.ats.internal.jdbc.recovery.JDBCXARecovery
+
+    public AppServerJDBCXARecovery()
+        throws SQLException
+    {
+        if (log.isDebugEnabled())
+		{
+            log.debug("AppServerJDBCXARecovery<init>");
+        }
+
+        _hasMoreResources        = false;
+        _connectionEventListener = new LocalConnectionEventListener();
+    }
+
+    /**
+     * The recovery module will have chopped off this class name already. The
+     * parameter should specify a jndi name for the datasource.
+     */
+
+    public boolean initialise(String parameter)
+        throws SQLException
+    {
+        if (log.isDebugEnabled())
+		{
+            log.debug("AppServerJDBCXARecovery.initialise(" + parameter + ")");
+        }
+
+        if (parameter == null)
+            return false;
+
+        retrieveData(parameter, _DELIMITER);
+
+        return true;
+    }
+
+    public synchronized XAResource getXAResource()
+        throws SQLException
+    {
+        createConnection();
+
+        if (_connection == null) {
+            throw new SQLException("The data source named [" + _dataSourceId + "] is not deployed.");
+        }
+
+        return _connection.getXAResource();
+    }
+
+    public boolean hasMoreResources()
+    {
+        if(!_force) {
+            return false;
+        }
+
+        if (_dataSource == null)
+            try
+            {
+                createDataSource();
+            }
+            catch (SQLException sqlException)
+            {
+                return false;
+            }
+
+        if (_dataSource != null)
+        {
+            _hasMoreResources = ! _hasMoreResources;
+
+            return _hasMoreResources;
+        }
+        else
+            return false;
+    }
+
+    /**
+     * Lookup the XADataSource in JNDI.
+     */
+    private final void createDataSource()
+        throws SQLException
+    {
+        // Note: the repeated use of SecurityAssociation.set[Principal|Credential] is a workaround for
+        // JBAS-7171 / JBAS-6449 / JBPAPP-2479. Although now fixed in some AS/EAP releases, we keep the
+        // workaround in place for now so we can work on older, non-fixed releases too.
+
+        try
+        {
+            if (_dataSource == null)
+            {
+                // This is where we do JBossAS specific magic. Use the JMX to fetch the name of the XADataSource class
+                // and its config params so that we don't have to duplicate the information in the -ds.xml file.
+
+                // TODO: can we make this flexible enough to handle remote app server processes, so that
+                // we can run the recovery manager out of process? The server addr would need to be on a per
+                // jndiname basis, as we may be doing recovery for a whole cluster. We would need AS
+                // jmx classes (and the db drivers naturally) on the recovery manager classpath.
+
+                InitialContext context = new InitialContext();
+                MBeanServerConnection server = (MBeanServerConnection)context.lookup("jmx/invoker/RMIAdaptor");
+                ObjectName objectName = new ObjectName("jboss.jca:name="+_dataSourceId+",service=ManagedConnectionFactory");
+
+                if(_username !=null && _password !=null)
+                {
+                	SecurityAssociation.setPrincipal(new SimplePrincipal(_username));
+                	SecurityAssociation.setCredential(_password);
+                }
+
+                String className = (String)server.invoke(objectName, "getManagedConnectionFactoryAttribute", new Object[] {"XADataSourceClass"}, new String[] {"java.lang.String"});
+		        if (log.isDebugEnabled())
+				{
+                	log.debug("AppServerJDBCXARecovery datasource classname = "+className);
+                }
+
+                if(_username !=null && _password !=null)
+                {
+                	SecurityAssociation.setPrincipal(new SimplePrincipal(_username));
+                	SecurityAssociation.setCredential(_password);
+                }
+
+                String properties = (String)server.invoke(objectName, "getManagedConnectionFactoryAttribute", new Object[] {"XADataSourceProperties"}, new String[] {"java.lang.String"});
+                // debug disabled due to security paranoia - it may log datasource password in cleartext.
+                // log.debug("AppServerJDBCXARecovery.result="+properties);
+
+/*                
+                ObjectName txCmObjectName = new ObjectName("jboss.jca:name=" +_dataSourceId + ",service=XATxCM");
+
+                if(_username !=null && _password !=null)
+                {
+                	SecurityAssociation.setPrincipal(new SimplePrincipal(_username));
+                	SecurityAssociation.setCredential(_password);
+                }                
+
+                String securityDomainName = (String) server.getAttribute(txCmObjectName, "SecurityDomainJndiName");
+                
+		        if (log.isDebugEnabled())
+				{
+                	log.debug("Security domain name associated with JCA ConnectionManager jboss.jca:name=" +_dataSourceId + ",service=XATxCM"+" is:"+securityDomainName);
+                }
+
+                if(securityDomainName != null && !securityDomainName.equals(""))
+                {
+                	ObjectName _objectName = new ObjectName("jboss.security:service=XMLLoginConfig");
+
+                    if(_username !=null && _password !=null)
+                    {
+                        SecurityAssociation.setPrincipal(new SimplePrincipal(_username));
+                        SecurityAssociation.setCredential(_password);
+                    }
+
+                	String config = (String)server.invoke(_objectName, "displayAppConfig", new Object[] {securityDomainName}, new String[] {"java.lang.String"});
+                    String loginModuleClass = getValueForLoginModuleClass(config);
+            		_dbUsername = getValueForKey(config, _USERNAME);
+            		String _encryptedPassword = getValueForKey(config, _PASSWORD);
+
+                    if("org.jboss.resource.security.JaasSecurityDomainIdentityLoginModule".equals(loginModuleClass))
+                    {
+                        String jaasSecurityDomain = getValueForKey(config, "jaasSecurityDomain");
+                        if(_username !=null && _password !=null)
+                        {
+                            SecurityAssociation.setPrincipal(new SimplePrincipal(_username));
+                            SecurityAssociation.setCredential(_password);
+                        }
+                        _dbPassword = decodePBE(server, _encryptedPassword, jaasSecurityDomain);
+                    }
+                    else
+                    {
+                        _dbPassword = decode(_encryptedPassword);
+                    }
+
+                    _encrypted = true;
+                }
+*/
+                
+                try {
+                    _dataSource = getXADataSource(className, properties);
+                    _supportsIsValidMethod = true; // assume it does; we'll lazily check the first time we try to connect
+                } catch(Exception e) {
+                    _dataSource = null;
+                    log.error("AppServerJDBCXARecovery.createDataSource got exception during getXADataSource call: "+e.toString(), e);
+                    SQLException sqlException = new SQLException(e.toString());
+                    sqlException.initCause(e);
+                    throw sqlException;
+                }
+            }
+        }
+        catch (MBeanException mbe)
+        {
+            if (mbe.getTargetException() instanceof InstanceNotFoundException)
+            {
+                log.warn("AppServerJDBCXARecovery.createDataSource(name="+_dataSourceId+"): InstanceNotFound. Datasource not deployed, or wrong name?");
+
+                // this is an expected condition when the data source is not yet deployed
+                // just ignore this for now, the next time around, we try again to see if its deployed yet
+                return;
+            } else {
+                log.error("AppServerJDBCXARecovery.createDataSource(name="+_dataSourceId+") got exception " + mbe.toString(), mbe);
+            }
+
+            SQLException sqlException = new SQLException(mbe.toString());
+            sqlException.initCause(mbe);
+            throw sqlException;
+        }
+        catch (SQLException ex)
+        {
+            log.error("AppServerJDBCXARecovery.createDataSource got exception "+ex.toString(), ex);
+            throw ex;
+        }
+        catch (Exception e)
+        {
+            log.error("AppServerJDBCXARecovery.createDataSource got exception "+e.toString(), e);
+
+            SQLException sqlException = new SQLException(e.toString());
+            sqlException.initCause(e);
+            throw sqlException;
+        }
+    }
+
+    /**
+     * Create the XAConnection from the XADataSource.
+     */
+
+    private final void createConnection()
+        throws SQLException
+    {
+        try
+        {
+            if (_dataSource == null)
+            {
+                createDataSource();
+                // if we still don't have it, its because the data source isn't deployed yet
+                if (_dataSource == null) {
+                    return;
+                }
+            }
+
+            Boolean isConnectionValid;
+            try {
+                if (_connection != null && _supportsIsValidMethod) {
+                    Connection connection = _connection.getConnection();
+                    Method method = connection.getClass().getMethod("isValid",  new Class[] {Integer.class});
+                    isConnectionValid = (Boolean) method.invoke(connection, new Object[] {new Integer(5)});
+                } else {
+                    isConnectionValid = Boolean.FALSE;
+                }
+            } catch (NoSuchMethodException nsme) {
+                isConnectionValid = Boolean.FALSE;
+                _supportsIsValidMethod = false;
+		        if (log.isDebugEnabled())
+				{
+	                log.debug("XA datasource does not support isValid method - connection will always be recreated");
+	            }
+            } catch (Throwable t) {
+                isConnectionValid = Boolean.FALSE;
+		        if (log.isDebugEnabled())
+				{
+	                log.debug("XA connection is invalid - will recreate a new one. Cause: " + t);
+	            }
+            }
+
+            if (!isConnectionValid.booleanValue()) {
+                if (_connection != null) {
+                    try {
+                        _connection.close(); // just attempt to clean up anything that we can
+                    } catch (Throwable t) {
+                    } finally {
+                        _connection = null;
+                    }
+                }
+
+                // Check if the password is encrypted, the criteria should be the existence of <security-domain>EncryptDBPassword</security-domain>
+                // in the -ds.xml file.
+                
+                if(!_encrypted) {
+                    _connection = _dataSource.getXAConnection();
+                }
+                else {
+                    _connection = _dataSource.getXAConnection(_dbUsername, _dbPassword);
+                }
+                _connection.addConnectionEventListener(_connectionEventListener);
+		        if (log.isDebugEnabled())
+				{
+	                log.debug("Created new XAConnection");
+	            }
+            }
+        }
+        catch (SQLException ex)
+        {
+            log.error("AppServerJDBCXARecovery.createConnection got exception "+ex.toString(), ex);
+            throw ex;
+        }
+        catch (Exception e)
+        {
+            log.error("AppServerJDBCXARecovery.createConnection got exception "+e.toString(), e);
+
+            SQLException sqlException = new SQLException(e.toString());
+            sqlException.initCause(e);
+            throw sqlException;
+        }
+    }
+
+    private class LocalConnectionEventListener implements ConnectionEventListener
+    {
+        public void connectionErrorOccurred(ConnectionEvent connectionEvent)
+        {
+            _connection.removeConnectionEventListener(_connectionEventListener);
+            _connection = null;
+        }
+
+        public void connectionClosed(ConnectionEvent connectionEvent)
+        {
+            _connection.removeConnectionEventListener(_connectionEventListener);
+            _connection = null;
+        }
+    }
+
+    // borrowed from org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory
+    // in which the equivalent functionality is protected not public :-(
+    private XADataSource getXADataSource(String xaDataSourceClassname, String propertiesString) throws Exception
+    {
+        // Map any \ to \\
+        propertiesString = propertiesString.replaceAll("\\\\", "\\\\\\\\");
+
+        Properties properties = new Properties();
+        InputStream is = new ByteArrayInputStream(propertiesString.getBytes());
+        properties.load(is);
+        
+        // HACK for crash recovery tests
+        // check whether we have User and Password in XA properties
+        if (! properties.containsKey("User"))
+        {
+           properties.setProperty("User", CrashHelper.DS_USER_NAME);
+           properties.setProperty("Password", CrashHelper.DS_PASSWORD);
+        }
+        // end of hack
+
+        Class clazz = Thread.currentThread().getContextClassLoader().loadClass(xaDataSourceClassname);
+        XADataSource xads = (XADataSource) clazz.newInstance();
+        Class[] NOCLASSES = new Class[] {};
+        for (Iterator i = properties.keySet().iterator(); i.hasNext();)
+        {
+            String name = (String) i.next();
+            String value = properties.getProperty(name);
+            //This is a bad solution.  On the other hand the only known example
+            // of a setter with no getter is for Oracle with password.
+            //Anyway, each xadatasource implementation should get its
+            //own subclass of this that explicitly sets the
+            //properties individually.
+            Class type = null;
+            try
+            {
+                Method getter = clazz.getMethod("get" + name, NOCLASSES);
+                type = getter.getReturnType();
+            }
+            catch (NoSuchMethodException e)
+            {
+                type = String.class;
+
+                try
+                {
+                    //HACK for now until we can rethink the XADataSourceProperties variable and pass type information
+                    Method getter = clazz.getMethod("is" + name, NOCLASSES);
+                    type = getter.getReturnType();
+
+                }catch(NoSuchMethodException nsme)
+                {
+                    type = String.class;
+
+                }
+
+            }
+
+            Method setter = clazz.getMethod("set" + name, new Class[] { type });
+            PropertyEditor editor = PropertyEditorManager.findEditor(type);
+            editor.setAsText(value);
+            setter.invoke(xads, new Object[] { editor.getValue() });
+        }
+        return xads;
+    }
+
+    public void retrieveData(String parameter,String delimiter)
+    {
+        StringTokenizer st = new StringTokenizer(parameter,delimiter);
+        while (st.hasMoreTokens())
+        {
+            String data = st.nextToken();
+            if(data.length()>9)
+            {
+                if(_USERNAME.equalsIgnoreCase(data.substring(0,8)))
+                {
+                    _username =data.substring(9);
+                }
+                if(_PASSWORD.equalsIgnoreCase(data.substring(0,8)))
+                {
+                    _password =data.substring(9);
+                }
+                if(_JNDINAME.equalsIgnoreCase(data.substring(0,8)))
+                {
+                    _dataSourceId=data.substring(9);
+                }
+                if(_FORCE.equals(data.substring(0, 10)))
+                {
+                    _force = true;
+                }
+            }
+        }
+
+        if(_dataSourceId == null && parameter != null && parameter.indexOf('=') == -1) {
+            // try to fallback to old parameter format where only the dataSourceId is given, without jndiname= prefix
+            _dataSourceId = parameter;
+        }
+
+        if(!_force) {
+            log.warn("AppServerJDBCXARecovery has been deprecated, see JBTM-756");
+        }
+    }
+
+    private String getValueForKey(String config, String key)
+    {
+		Pattern usernamePattern = Pattern.compile("(name=" + key + ", value=)(.*)(</li>)");
+		Matcher m = usernamePattern.matcher(config);
+		if(m.find())
+		{
+			return m.group(2);
+		}
+		return "";
+	}
+
+    private String getValueForLoginModuleClass(String config)
+    {
+        Pattern usernamePattern = Pattern.compile("(" + _MODULE + ":)(.*)");
+        Matcher m = usernamePattern.matcher(config);
+        if(m.find())
+        {
+            return m.group(2).trim();
+        }
+        return "";
+    }
+    
+    private static String decode(String secret) throws NoSuchPaddingException, NoSuchAlgorithmException,
+            InvalidKeyException, BadPaddingException, IllegalBlockSizeException
+    {
+	    byte[] kbytes = "jaas is the way".getBytes();
+	    SecretKeySpec key = new SecretKeySpec(kbytes, "Blowfish");
+	
+	    BigInteger n = new BigInteger(secret, 16);
+	    byte[] encoding = n.toByteArray();
+	    
+	    Cipher cipher = Cipher.getInstance("Blowfish");
+	    cipher.init(Cipher.DECRYPT_MODE, key);
+	    byte[] decode = cipher.doFinal(encoding);
+	    return new String(decode);
+	 }
+
+    private static String decodePBE(MBeanServerConnection server, String password, String jaasSecurityDomain) throws Exception
+    {
+        byte[] secret = (byte[]) server.invoke(new ObjectName(jaasSecurityDomain), "decode64", new Object[] {password}, new String[] {"java.lang.String"});
+        return new String(secret, "UTF-8");
+    }
+
+
+    private boolean _supportsIsValidMethod;
+    private XAConnection _connection;
+    private XADataSource                 _dataSource;
+    private LocalConnectionEventListener _connectionEventListener;
+    private boolean                      _hasMoreResources;
+    private boolean _encrypted;
+
+    private boolean _force = false;
+
+    private String _dataSourceId;
+    private String _username;
+    private String _password;
+    private String _dbUsername;
+    private String _dbPassword;
+    
+    private final String _JNDINAME = "jndiname";
+    private final String _USERNAME = "username";
+    private final String _PASSWORD = "password";
+    private final String _FORCE = "force=true";
+    private final String _MODULE = "LoginModule Class";
+    private final String _DELIMITER = ",";
+    
+    private Logger log = org.jboss.logging.Logger.getLogger(AppServerJDBCXARecovery.class);
+}

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashBMTBean.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashBMTBean.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashBMTBean.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -28,8 +28,6 @@
 import javax.annotation.Resource;
 import javax.ejb.EJBContext;
 import javax.ejb.Stateless;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
 import javax.ejb.TransactionManagement;
 import javax.ejb.TransactionManagementType;
 import javax.transaction.SystemException;
@@ -45,13 +43,11 @@
    @Resource
    private EJBContext context;
    
-   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public String testXA(String ... args)
    {
       return "Passed";
    }
 
-   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public String testXA(ASFailureSpec... specs)
    {
       TestASRecovery xatest = new TestASRecovery();
@@ -68,17 +64,16 @@
       return xatest.startTest() ? "Passed" : "Failed";
    }
 
-   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public String testXA(String testEntityPK, boolean reverseOrder, ASFailureSpec... specs)
    {
+      log.info("BMT testXA called with " + specs.length + " specs and testEntityPK=" + testEntityPK + " reverseOrder=" + reverseOrder);
+
       TestASRecoveryWithJPA xatest = new TestASRecoveryWithJPA();
       String txStatus = getStatus(context.getUserTransaction());
 
       if (txStatus != null)
-         log.info("BMT method called with tx status: " + txStatus);
+         log.info("BMT testXA called with tx status: " + txStatus);
 
-      log.info("BMT testXA called with " + specs.length + " specs and testEntityPK=" + testEntityPK + " reverseOrder=" + reverseOrder);
-
       xatest.setTestEntityPK(testEntityPK);
       xatest.setReverseOrder(reverseOrder);
       
@@ -87,8 +82,8 @@
 
       return xatest.startTest() ? "Passed" : "Failed";
    }
-
-   public String getStatus(UserTransaction tx)
+   
+   protected String getStatus(UserTransaction tx)
    {
       if (tx == null)
          return null;

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashHelper.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashHelper.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashHelper.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -22,21 +22,17 @@
 package org.jboss.test.jbossts.crash;
 
 import java.sql.SQLException;
-import java.util.HashSet;
 import java.util.Set;
 
 import javax.ejb.Stateless;
 import javax.ejb.TransactionAttribute;
 import javax.ejb.TransactionAttributeType;
-import javax.transaction.xa.XAException;
 import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
 
-import org.jboss.logging.Logger;
+import org.jboss.test.jbossts.recovery.CommonCrashHelper;
+import org.jboss.test.jbossts.recovery.RecoveredXid;
 
-import com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery;
 
-
 /**
  * Helper class for playing with txs in doubt.
  * 
@@ -44,167 +40,72 @@
  * @version $Revision: 1.1 $
  */
 @Stateless
-public class CrashHelper implements CrashHelperRem
+public class CrashHelper extends CommonCrashHelper implements JPACrashHelperRem
 {
-   public static final String REMOTE_JNDI_NAME      = CrashHelper.class.getSimpleName() + "/remote";
-   private static Logger log                        = Logger.getLogger(CrashHelper.class);
+   public static final String REMOTE_JNDI_NAME = CrashHelper.class.getSimpleName() + "/remote";
    
    /**
-    * JNDI name of crash recovery datasource.  
+    * Default JNDI name of recovery datasource.  
     */
    public static final String DS_JNDI_NAME          = "CrashRecoveryDS";
+   public static final String DS_USER_NAME          = "crashrec";
+   public static final String DS_PASSWORD           = "crashrec";
 
+   private String datasourceName = DS_JNDI_NAME;
+
    
-   /**
-    * Wipes out xids in doubt from database ({@link #DS_JNDI_NAME}) according to 
-    * <code>xidToRecover</code> list. If xidToRecover is null, it wipes out all xids in doubt.
-    * 
-    * @param xidToRecover list of Xids to recover
-    */
    @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
-   public boolean wipeOutTxsInDoubt(Set<RecoveredXid> xidsToRecover)
+   public Set<RecoveredXid> checkXidsInDoubt(String datasourceName)
    {
-      log.info("wipe out txs in doubt");
-      try
-      {
-         AppServerJDBCXARecovery appServerRecovery = new AppServerJDBCXARecovery();
+      setDatasourceName(datasourceName);
+      return super.checkXidsInDoubt();
+   }
 
-         if (appServerRecovery.initialise("jndiname=" + DS_JNDI_NAME))
-         {
-            if (appServerRecovery.hasMoreResources())
-            {
-               XAResource xares = appServerRecovery.getXAResource();
-
-               Xid[] txInDoubt = null;
-               try
-               {               
-                  txInDoubt = xares.recover(XAResource.TMSTARTRSCAN);
-               }
-               catch (XAException e)
-               {
-                  log.error("Cannot start recovering on xares", e);
-                  
-                  try
-                  {
-                     xares.recover(XAResource.TMENDRSCAN);
-                  }
-                  catch (Exception e1)
-                  {
-                  }
-
-                  return false;
-               }
-
-               if (txInDoubt == null || txInDoubt.length == 0)
-                  return true;
-               
-               log.info("There are " + txInDoubt.length + " xids in doubt");
-               
-               for (int k=0; k < txInDoubt.length; k++)
-               {
-                  RecoveredXid xid = convertToRecoveredXid(txInDoubt[k]);
-                  if (xidsToRecover == null || xidsToRecover.contains(xid))
-                  {
-                     try
-                     {
-                        log.info("rollbacking of Xid " + xid);
-                        xares.rollback(txInDoubt[k]);
-                     }
-                     catch (Exception e)
-                     {
-                        log.error("Error in rollback of Xid " + txInDoubt[k], e);
-                     }
-                  }
-               }
-
-               try
-               {
-                  if (xares != null)
-                     xares.recover(XAResource.TMENDRSCAN);
-               }
-               catch (XAException e)
-               {
-                  log.error("Cannot finish recovering on xares", e);
-               }
-            }
-         }
-      }
-      catch (SQLException e)
-      {
-         log.error("Cannot get any XAResource by AppServerJDBCXARecovery", e);
-         return false;
-      }
-
-      return true;
+   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
+   public boolean wipeOutTxsInDoubt(String datasourceName, Set<RecoveredXid> xidsToRecover)
+   {
+      setDatasourceName(datasourceName);
+      return super.wipeOutTxsInDoubt(xidsToRecover);
    }
 
+   private void setDatasourceName(String datasourceName)
+   {
+      if (datasourceName != null && datasourceName.length() > 0)
+         this.datasourceName = datasourceName;
+   }
+   
    /**
-    * Checks xids in doubt in datasource with {@link #DS_JNDI_NAME}. 
-    * 
-    * @return number of xids in doubt
+    * Gets XAResource for a datasource with name ({@link #DS_JNDI_NAME}).
     */
-   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
-   public Set<RecoveredXid> checkXidsInDoubt()
+   @Override
+   protected XAResource getNewXAResource() throws Exception
    {
-      Set<RecoveredXid> xids = new HashSet<RecoveredXid>();
+      XAResource xares = null;
       try
       {
          AppServerJDBCXARecovery appServerRecovery = new AppServerJDBCXARecovery();
 
-         if (appServerRecovery.initialise("jndiname=" + DS_JNDI_NAME))
+         if (appServerRecovery.initialise("jndiname=" + datasourceName + ",force=true"))
          {
             if (appServerRecovery.hasMoreResources())
             {
-               XAResource xares = appServerRecovery.getXAResource();
-
-               try
-               {               
-                  Xid[] xidsInDoubt = xares.recover(XAResource.TMSTARTRSCAN);
-                  
-                  if (xidsInDoubt != null)
-                  {
-                     log.info("There are " + xidsInDoubt.length + " xids in doubt");
-
-                     for (int k=0; k < xidsInDoubt.length; k++)
-                        xids.add(convertToRecoveredXid(xidsInDoubt[k]));
-                  }
-               }
-               catch (XAException e)
-               {
-                  log.error("Cannot start recover scan on xares", e);
-               }
-               finally
-               {
-                  try
-                  {
-                     if (xares != null)
-                        xares.recover(XAResource.TMENDRSCAN);
-                  }
-                  catch (XAException e)
-                  {
-                     log.error("Cannot finish recover scan on xares", e);
-                  }
-               }
+               xares = appServerRecovery.getXAResource();
             }
          }
       }
       catch (SQLException e)
       {
          log.error("Cannot get any XAResource by AppServerJDBCXARecovery", e);
+         throw e;
       }
-
-      return xids;
+      
+      return xares;
    }
-   
-   private RecoveredXid convertToRecoveredXid(Xid xid)
+
+   @Override
+   protected void closeXAResource()
    {
-      RecoveredXid recoveredXid = new RecoveredXid();
-      
-      recoveredXid.setBranchQualifier(xid.getBranchQualifier());
-      recoveredXid.setFormatId(xid.getFormatId());
-      recoveredXid.setGlobalTransactionId(xid.getGlobalTransactionId());
-      
-      return recoveredXid;
+      // Nothing to do here. Is it alright?
    }
 
 }

Deleted: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashHelperRem.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashHelperRem.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashHelperRem.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.jbossts.crash;
-
-import java.util.Set;
-
-import javax.ejb.Remote;
-
- at Remote
-public interface CrashHelperRem
-{
-   public boolean wipeOutTxsInDoubt(Set<RecoveredXid> xidsToRecover);
-   public Set<RecoveredXid> checkXidsInDoubt();
-}

Deleted: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashLocalHome.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashLocalHome.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashLocalHome.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -1,28 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- *
- * (C) 2008,
- * @author JBoss Inc.
- */
-package org.jboss.test.jbossts.crash;
-
-import javax.ejb.EJBLocalHome;
-import javax.ejb.CreateException;
-
-public interface CrashLocalHome extends EJBLocalHome {
-    CrashLocal create() throws CreateException;
-}

Deleted: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashRemHome.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashRemHome.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/CrashRemHome.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -1,29 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- *
- * (C) 2008,
- * @author JBoss Inc.
- */
-package org.jboss.test.jbossts.crash;
-
-import javax.ejb.EJBHome;
-import javax.ejb.CreateException;
-import java.rmi.RemoteException;
-
-public interface CrashRemHome extends EJBHome {
-    CrashRem create() throws CreateException, RemoteException;
-}

Copied: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/JPACrashHelperRem.java (from rev 109526, trunk/testsuite/src/main/org/jboss/test/jbossts/crash/JPACrashHelperRem.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/JPACrashHelperRem.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/JPACrashHelperRem.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.jbossts.crash;
+
+import java.util.Set;
+
+import javax.ejb.Remote;
+
+import org.jboss.test.jbossts.recovery.RecoveredXid;
+
+ at Remote
+public interface JPACrashHelperRem
+{
+   public boolean wipeOutTxsInDoubt(String datasourceName, Set<RecoveredXid> xidsToRecover);
+   public Set<RecoveredXid> checkXidsInDoubt(String datasourceName);
+}

Deleted: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/RecoveredXid.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/RecoveredXid.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/RecoveredXid.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -1,107 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.jbossts.crash;
-
-import java.io.Serializable;
-import java.util.Arrays;
-
-public class RecoveredXid implements Serializable
-{
-   private byte[] branchQualifier;
-   private int formatId;
-   private byte[] globalTransactionId;
-   
-   public RecoveredXid()
-   {
-   }
-
-   public byte[] getBranchQualifier()
-   {
-      return branchQualifier;
-   }
-
-   public void setBranchQualifier(byte[] branchQualifier)
-   {
-      this.branchQualifier = branchQualifier;
-   }
-
-   public int getFormatId()
-   {
-      return formatId;
-   }
-
-   public void setFormatId(int formatId)
-   {
-      this.formatId = formatId;
-   }
-
-   public byte[] getGlobalTransactionId()
-   {
-      return globalTransactionId;
-   }
-
-   public void setGlobalTransactionId(byte[] globalTransactionId)
-   {
-      this.globalTransactionId = globalTransactionId;
-   }
-
-   @Override
-   public int hashCode()
-   {
-      final int prime = 31;
-      int result = 1;
-      result = prime * result + Arrays.hashCode(branchQualifier);
-      result = prime * result + formatId;
-      result = prime * result + Arrays.hashCode(globalTransactionId);
-      return result;
-   }
-
-   @Override
-   public boolean equals(Object obj)
-   {
-      if (this == obj)
-         return true;
-      if (obj == null)
-         return false;
-      if (getClass() != obj.getClass())
-         return false;
-      RecoveredXid other = (RecoveredXid) obj;
-      if (!Arrays.equals(branchQualifier, other.branchQualifier))
-         return false;
-      if (formatId != other.formatId)
-         return false;
-      if (!Arrays.equals(globalTransactionId, other.globalTransactionId))
-         return false;
-      return true;
-   }
-
-   @Override
-   /**
-    * Only for debugging purposes.
-    */
-   public String toString()
-   {
-      return "RecoveredXid [branchQualifier=" + Arrays.toString(branchQualifier) + ", formatId=" + formatId
-            + ", globalTransactionId=" + Arrays.toString(globalTransactionId) + "]";
-   }
-   
-}

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/TestEntityHelper.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/TestEntityHelper.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/crash/TestEntityHelper.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -80,7 +80,6 @@
     */
    public TestEntity getTestEntity(String entityPK)
    {
-      log.info("entityPK = " + entityPK);
       TestEntity entity = em.find(TestEntity.class, entityPK);
       log.debug("TestEntityHelper#getTestEntity(" + entityPK + ") = " + entity);
       

Copied: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/recovery/CommonCrashHelper.java (from rev 109526, trunk/testsuite/src/main/org/jboss/test/jbossts/recovery/CommonCrashHelper.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/recovery/CommonCrashHelper.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/recovery/CommonCrashHelper.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,208 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.jbossts.recovery;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.ejb.EJBException;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+
+import org.jboss.logging.Logger;
+import org.jboss.test.jbossts.recovery.RecoveredXid;
+
+
+/**
+ * Helper class for playing with in-doubt txs.
+ * 
+ * @author <a href="istudens at redhat.com">Ivo Studensky</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class CommonCrashHelper implements CrashHelperRem
+{
+   protected static Logger log = Logger.getLogger(CommonCrashHelper.class);
+
+
+   /**
+    * Wipes out in-doubt xids according to <code>xidToRecover</code> list. 
+    * If xidToRecover is null, it wipes out all in-doubt xids. 
+    * The in-doubt xids are taken from {@link #getNewXAResource()}. 
+    * 
+    * @param xidToRecover list of Xids to recover
+    */
+   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
+   public boolean wipeOutTxsInDoubt(Set<RecoveredXid> xidsToRecover)
+   {
+      log.info("wipe out in-doubt txs");
+
+      XAResource xares = null;
+      try
+      {
+         xares = getNewXAResource();
+         
+         if (xares == null)
+            return false;
+
+         Xid[] txInDoubt = null;
+         try
+         {               
+            txInDoubt = xares.recover(XAResource.TMSTARTRSCAN);
+         }
+         catch (XAException e)
+         {
+            log.error("Cannot start recovering on xares", e);
+
+            try
+            {
+               xares.recover(XAResource.TMENDRSCAN);
+            }
+            catch (Exception e1)
+            {
+            }
+
+            return false;
+         }
+
+         if (txInDoubt == null || txInDoubt.length == 0)
+            return true;
+
+         log.info("There are " + txInDoubt.length + " xids in doubt");
+
+         for (int k=0; k < txInDoubt.length; k++)
+         {
+            RecoveredXid xid = convertToRecoveredXid(txInDoubt[k]);
+            if (xidsToRecover == null || xidsToRecover.contains(xid))
+            {
+               try
+               {
+                  log.info("rollbacking of Xid " + xid);
+                  xares.rollback(txInDoubt[k]);
+               }
+               catch (Exception e)
+               {
+                  log.error("Error in rollback of Xid " + txInDoubt[k], e);
+               }
+            }
+         }
+
+         try
+         {
+            if (xares != null)
+               xares.recover(XAResource.TMENDRSCAN);
+         }
+         catch (XAException e)
+         {
+            log.error("Cannot finish recovering on xares", e);
+         }
+      }
+      catch (Exception e)
+      {
+         log.error("Cannot get a new XA resource", e);
+         throw new EJBException("Cannot get a new XA resource: " + e.getMessage());
+      }
+      finally
+      {
+         closeXAResource();
+      }
+      return true;
+   }
+
+   /**
+    * Checks in-doubt xids by XAResource taken from {@link #getNewXAResource()}. 
+    * 
+    * @return in-doubt xids
+    */
+   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
+   public Set<RecoveredXid> checkXidsInDoubt()
+   {
+      Set<RecoveredXid> xids = new HashSet<RecoveredXid>();
+
+      XAResource xares = null;
+      try
+      {               
+         xares = getNewXAResource();
+
+         try
+         {
+            Xid[] xidsInDoubt = xares.recover(XAResource.TMSTARTRSCAN);
+
+            if (xidsInDoubt != null)
+            {
+               log.info("There are " + xidsInDoubt.length + " xids in doubt");
+
+               for (int k=0; k < xidsInDoubt.length; k++)
+                  xids.add(convertToRecoveredXid(xidsInDoubt[k]));
+            }
+         }
+         catch (XAException e)
+         {
+            log.error("Cannot start recover scan on xares", e);
+            throw new EJBException("Cannot start recover scan on xares: " + e.getMessage());
+         }
+         finally
+         {
+            try
+            {
+               if (xares != null)
+                  xares.recover(XAResource.TMENDRSCAN);
+            }
+            catch (XAException e)
+            {
+               log.error("Cannot finish recover scan on xares", e);
+            }
+         }
+      }
+      catch (Exception e)
+      {
+         log.error("Cannot get a new XA resource", e);
+         throw new EJBException("Cannot get a new XA resource: " + e.getMessage());
+      }
+      finally
+      {
+         closeXAResource();
+      }
+
+      return xids;
+   }
+
+   private RecoveredXid convertToRecoveredXid(Xid xid)
+   {
+      RecoveredXid recoveredXid = new RecoveredXid();
+
+      recoveredXid.setBranchQualifier(xid.getBranchQualifier());
+      recoveredXid.setFormatId(xid.getFormatId());
+      recoveredXid.setGlobalTransactionId(xid.getGlobalTransactionId());
+
+      return recoveredXid;
+   }
+
+   
+   protected abstract XAResource getNewXAResource() throws Exception;
+
+   // Should not throw out any exception.
+   protected abstract void closeXAResource();
+
+}

Copied: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/recovery/CrashHelperRem.java (from rev 109526, trunk/testsuite/src/main/org/jboss/test/jbossts/recovery/CrashHelperRem.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/recovery/CrashHelperRem.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/recovery/CrashHelperRem.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.jbossts.recovery;
+
+import java.util.Set;
+
+import javax.ejb.Remote;
+
+import org.jboss.test.jbossts.recovery.RecoveredXid;
+
+ at Remote
+public interface CrashHelperRem
+{
+   public boolean wipeOutTxsInDoubt(Set<RecoveredXid> xidsToRecover);
+   public Set<RecoveredXid> checkXidsInDoubt();
+}

Copied: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/recovery/RecoveredXid.java (from rev 109526, trunk/testsuite/src/main/org/jboss/test/jbossts/recovery/RecoveredXid.java)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/recovery/RecoveredXid.java	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/recovery/RecoveredXid.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.jbossts.recovery;
+
+import java.io.Serializable;
+import java.util.Arrays;
+
+public class RecoveredXid implements Serializable
+{
+   private byte[] branchQualifier;
+   private int formatId;
+   private byte[] globalTransactionId;
+   
+   public RecoveredXid()
+   {
+   }
+
+   public byte[] getBranchQualifier()
+   {
+      return branchQualifier;
+   }
+
+   public void setBranchQualifier(byte[] branchQualifier)
+   {
+      this.branchQualifier = branchQualifier;
+   }
+
+   public int getFormatId()
+   {
+      return formatId;
+   }
+
+   public void setFormatId(int formatId)
+   {
+      this.formatId = formatId;
+   }
+
+   public byte[] getGlobalTransactionId()
+   {
+      return globalTransactionId;
+   }
+
+   public void setGlobalTransactionId(byte[] globalTransactionId)
+   {
+      this.globalTransactionId = globalTransactionId;
+   }
+
+   @Override
+   public int hashCode()
+   {
+      final int prime = 31;
+      int result = 1;
+      result = prime * result + Arrays.hashCode(branchQualifier);
+      result = prime * result + formatId;
+      result = prime * result + Arrays.hashCode(globalTransactionId);
+      return result;
+   }
+
+   @Override
+   public boolean equals(Object obj)
+   {
+      if (this == obj)
+         return true;
+      if (obj == null)
+         return false;
+      if (getClass() != obj.getClass())
+         return false;
+      RecoveredXid other = (RecoveredXid) obj;
+      if (!Arrays.equals(branchQualifier, other.branchQualifier))
+         return false;
+      if (formatId != other.formatId)
+         return false;
+      if (!Arrays.equals(globalTransactionId, other.globalTransactionId))
+         return false;
+      return true;
+   }
+
+   @Override
+   /**
+    * Only for debugging purposes.
+    */
+   public String toString()
+   {
+      return "RecoveredXid [branchQualifier=" + Arrays.toString(branchQualifier) + ", formatId=" + formatId
+            + ", globalTransactionId=" + Arrays.toString(globalTransactionId) + "]";
+   }
+   
+}

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/taskdefs/TransactionLog.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/taskdefs/TransactionLog.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/main/org/jboss/test/jbossts/taskdefs/TransactionLog.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -30,6 +30,7 @@
 import com.arjuna.ats.arjuna.AtomicAction;
 import com.arjuna.ats.internal.arjuna.common.UidHelper;
 
+import java.lang.reflect.Constructor;
 import java.util.ArrayList;
 import java.util.Collection;
 
@@ -60,8 +61,9 @@
             try
             {
                 Class c = Class.forName(impleType);
-
-                store = (RecoveryStore) c.newInstance();
+                Constructor constructor = c.getConstructor(new Class[] {ObjectStoreEnvironmentBean.class});
+                
+                store = (RecoveryStore) constructor.newInstance(new Object[] {objectStoreEnvironmentBean});
             }
             catch (final Throwable ex)
             {

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/db2_97-xa-ds.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/db2_97-xa-ds.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/db2_97-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -14,9 +14,8 @@
      <jndi-name>CrashRecoveryDS</jndi-name>
         <xa-datasource-class>com.ibm.db2.jcc.DB2XADataSource</xa-datasource-class>
         
-        <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
-        <xa-datasource-property name="User">crashrec</xa-datasource-property>
-        <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+        <xa-datasource-property name="DatabaseName">jbossqa</xa-datasource-property>
+        @CREDENTIALS@
         
         <!-- Note, as opposed to the Type2 driver, DB2 Type 4 requires the PortNumber. By default this is 50000-->
         <xa-datasource-property name="PortNumber">50000</xa-datasource-property>

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/mssql2005-xa-ds.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/mssql2005-xa-ds.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/mssql2005-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -29,8 +29,7 @@
     <xa-datasource-property name="ServerName">dev30.qa.atl.jboss.com</xa-datasource-property>
     <xa-datasource-property name="PortNumber">3918</xa-datasource-property>
     <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
-    <xa-datasource-property name="User">crashrec</xa-datasource-property>
-    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+    @CREDENTIALS@
     <xa-datasource-property name="SelectMethod">cursor</xa-datasource-property>
 
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/mssql2008-xa-ds.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/mssql2008-xa-ds.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/mssql2008-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -29,8 +29,7 @@
     <xa-datasource-property name="ServerName">vmg04.mw.lab.eng.bos.redhat.com</xa-datasource-property>
     <xa-datasource-property name="PortNumber">1433</xa-datasource-property>
     <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
-    <xa-datasource-property name="User">crashrec</xa-datasource-property>
-    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+    @CREDENTIALS@
     <xa-datasource-property name="SelectMethod">cursor</xa-datasource-property>
 
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/mysql50-xa-ds.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/mysql50-xa-ds.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/mysql50-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -13,8 +13,7 @@
     <xa-datasource-property name="ServerName">vmg08.mw.lab.eng.bos.redhat.com</xa-datasource-property>
     <xa-datasource-property name="PortNumber">3306</xa-datasource-property>
     <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
-    <xa-datasource-property name="User">crashrec</xa-datasource-property>
-    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+    @CREDENTIALS@
     <exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter</exception-sorter-class-name>
     <!-- sql to call when connection is created
     <new-connection-sql>some arbitrary sql</new-connection-sql>

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/mysql51-xa-ds.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/mysql51-xa-ds.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/mysql51-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -13,8 +13,7 @@
     <xa-datasource-property name="ServerName">vmg02.mw.lab.eng.bos.redhat.com</xa-datasource-property>
     <xa-datasource-property name="PortNumber">3306</xa-datasource-property>
     <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
-    <xa-datasource-property name="User">crashrec</xa-datasource-property>
-    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+    @CREDENTIALS@
     <exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter</exception-sorter-class-name>
     <!-- sql to call when connection is created
     <new-connection-sql>some arbitrary sql</new-connection-sql>

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-lb-xa-ds.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-lb-xa-ds.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-lb-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -20,10 +20,9 @@
     <isSameRM-override-value>false</isSameRM-override-value>
     <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
     <xa-datasource-property name="URL">jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=vmg24-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=vmg25-vip.mw.lab.eng.bos.redhat.com)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</xa-datasource-property>
-    <xa-datasource-property name="User">crashrec</xa-datasource-property>
-    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+    @CREDENTIALS@
     <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
-    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
+    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
     <!-- Checks the Oracle error codes and messages for fatal errors -->
     <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
     <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->

Deleted: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-r2-1-xa-ds.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-r2-1-xa-ds.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-r2-1-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  JBoss Server Configuration                                           -->
-<!--                                                                       -->
-<!-- ===================================================================== -->
-
-<!-- $Id: oracle-xa-ds.xml 71535 2008-04-01 07:05:03Z adrian at jboss.org $ -->
-
-<!-- ===================================================================== -->
-<!-- ATTENTION:  DO NOT FORGET TO SET Pad=true IN transaction-service.xml  -->
-<!-- ===================================================================== -->
-
-<datasources>
-
-  <xa-datasource>
-    <jndi-name>CrashRecoveryDS</jndi-name>
-    <track-connection-by-tx>true</track-connection-by-tx> 
-    <isSameRM-override-value>false</isSameRM-override-value>
-    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
-    <xa-datasource-property name="URL">jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmg27-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</xa-datasource-property>
-    <xa-datasource-property name="User">crashrec</xa-datasource-property>
-    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
-    <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
-    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
-    <!-- Checks the Oracle error codes and messages for fatal errors -->
-    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
-    <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
-    <no-tx-separate-pools/>
-
-      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
-      <metadata>
-         <type-mapping>Oracle9i</type-mapping>
-      </metadata>
-  </xa-datasource>
-
-</datasources>

Deleted: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-r2-2-xa-ds.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-r2-2-xa-ds.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-r2-2-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  JBoss Server Configuration                                           -->
-<!--                                                                       -->
-<!-- ===================================================================== -->
-
-<!-- $Id: oracle-xa-ds.xml 71535 2008-04-01 07:05:03Z adrian at jboss.org $ -->
-
-<!-- ===================================================================== -->
-<!-- ATTENTION:  DO NOT FORGET TO SET Pad=true IN transaction-service.xml  -->
-<!-- ===================================================================== -->
-
-<datasources>
-
-  <xa-datasource>
-    <jndi-name>RecoveryDS</jndi-name>
-    <track-connection-by-tx>true</track-connection-by-tx> 
-    <isSameRM-override-value>false</isSameRM-override-value>
-    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
-    <xa-datasource-property name="URL">jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmg28-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</xa-datasource-property>
-    <xa-datasource-property name="User">crashrec</xa-datasource-property>
-    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
-    <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
-    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
-    <!-- Checks the Oracle error codes and messages for fatal errors -->
-    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
-    <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
-    <no-tx-separate-pools/>
-
-      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
-      <metadata>
-         <type-mapping>Oracle9i</type-mapping>
-      </metadata>
-  </xa-datasource>
-
-</datasources>

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-r2-lb-xa-ds.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-r2-lb-xa-ds.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-r2-lb-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -20,8 +20,7 @@
     <isSameRM-override-value>false</isSameRM-override-value>
     <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
     <xa-datasource-property name="URL">jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=vmg27-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=vmg28-vip.mw.lab.eng.bos.redhat.com)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</xa-datasource-property>
-    <xa-datasource-property name="User">crashrec</xa-datasource-property>
-    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+    @CREDENTIALS@
     <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
     <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
     <!-- Checks the Oracle error codes and messages for fatal errors -->

Copied: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-r2-xa-ds.xml (from rev 109526, trunk/testsuite/src/resources/jbossts/resources/oracle-rac-r2-xa-ds.xml)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-r2-xa-ds.xml	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-r2-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  JBoss Server Configuration                                           -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: oracle-xa-ds.xml 71535 2008-04-01 07:05:03Z adrian at jboss.org $ -->
+
+<!-- ===================================================================== -->
+<!-- ATTENTION:  DO NOT FORGET TO SET Pad=true IN transaction-service.xml  -->
+<!-- ===================================================================== -->
+
+<datasources>
+
+  <xa-datasource>
+    <jndi-name>CrashRecoveryDS</jndi-name>
+    <track-connection-by-tx>true</track-connection-by-tx> 
+    <isSameRM-override-value>false</isSameRM-override-value>
+    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
+    <xa-datasource-property name="URL">jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmg27-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</xa-datasource-property>
+    <xa-datasource-property name="User">crash0</xa-datasource-property>
+    <xa-datasource-property name="Password">crash0</xa-datasource-property>
+    <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
+    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
+    <!-- Checks the Oracle error codes and messages for fatal errors -->
+    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
+    <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
+    <no-tx-separate-pools/>
+
+      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
+      <metadata>
+         <type-mapping>Oracle9i</type-mapping>
+      </metadata>
+  </xa-datasource>
+
+  <xa-datasource>
+    <jndi-name>RecoveryDS</jndi-name>
+    <track-connection-by-tx>true</track-connection-by-tx> 
+    <isSameRM-override-value>false</isSameRM-override-value>
+    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
+    <xa-datasource-property name="URL">jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmg28-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</xa-datasource-property>
+    <xa-datasource-property name="User">crashrec</xa-datasource-property>
+    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+    <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
+    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
+    <!-- Checks the Oracle error codes and messages for fatal errors -->
+    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
+    <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
+    <no-tx-separate-pools/>
+
+      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
+      <metadata>
+         <type-mapping>Oracle9i</type-mapping>
+      </metadata>
+  </xa-datasource>
+
+</datasources>

Copied: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-xa-ds.xml (from rev 109526, trunk/testsuite/src/resources/jbossts/resources/oracle-rac-xa-ds.xml)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-xa-ds.xml	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  JBoss Server Configuration                                           -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: oracle-xa-ds.xml 71535 2008-04-01 07:05:03Z adrian at jboss.org $ -->
+
+<!-- ===================================================================== -->
+<!-- ATTENTION:  DO NOT FORGET TO SET Pad=true IN transaction-service.xml  -->
+<!-- ===================================================================== -->
+
+<datasources>
+
+  <xa-datasource>
+    <jndi-name>CrashRecoveryDS</jndi-name>
+    <track-connection-by-tx>true</track-connection-by-tx> 
+    <isSameRM-override-value>false</isSameRM-override-value>
+    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
+    <xa-datasource-property name="URL">jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmg24-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</xa-datasource-property>
+    <xa-datasource-property name="User">crash0</xa-datasource-property>
+    <xa-datasource-property name="Password">crash0</xa-datasource-property>
+    <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
+    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
+    <!-- Checks the Oracle error codes and messages for fatal errors -->
+    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
+    <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
+    <no-tx-separate-pools/>
+
+      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
+      <metadata>
+         <type-mapping>Oracle9i</type-mapping>
+      </metadata>
+  </xa-datasource>
+
+  <xa-datasource>
+    <jndi-name>RecoveryDS</jndi-name>
+    <track-connection-by-tx>true</track-connection-by-tx> 
+    <isSameRM-override-value>false</isSameRM-override-value>
+    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
+    <xa-datasource-property name="URL">jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmg25-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</xa-datasource-property>
+    <xa-datasource-property name="User">crashrec</xa-datasource-property>
+    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+    <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
+    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
+    <!-- Checks the Oracle error codes and messages for fatal errors -->
+    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
+    <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
+    <no-tx-separate-pools/>
+
+      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
+      <metadata>
+         <type-mapping>Oracle9i</type-mapping>
+      </metadata>
+  </xa-datasource>
+
+</datasources>

Deleted: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac1-xa-ds.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac1-xa-ds.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac1-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  JBoss Server Configuration                                           -->
-<!--                                                                       -->
-<!-- ===================================================================== -->
-
-<!-- $Id: oracle-xa-ds.xml 71535 2008-04-01 07:05:03Z adrian at jboss.org $ -->
-
-<!-- ===================================================================== -->
-<!-- ATTENTION:  DO NOT FORGET TO SET Pad=true IN transaction-service.xml  -->
-<!-- ===================================================================== -->
-
-<datasources>
-
-  <xa-datasource>
-    <jndi-name>CrashRecoveryDS</jndi-name>
-    <track-connection-by-tx>true</track-connection-by-tx> 
-    <isSameRM-override-value>false</isSameRM-override-value>
-    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
-    <xa-datasource-property name="URL">jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmg24-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</xa-datasource-property>
-    <xa-datasource-property name="User">crashrec</xa-datasource-property>
-    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
-    <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
-    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
-    <!-- Checks the Oracle error codes and messages for fatal errors -->
-    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
-    <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
-    <no-tx-separate-pools/>
-
-      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
-      <metadata>
-         <type-mapping>Oracle9i</type-mapping>
-      </metadata>
-  </xa-datasource>
-
-</datasources>

Deleted: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac2-xa-ds.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac2-xa-ds.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle-rac2-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  JBoss Server Configuration                                           -->
-<!--                                                                       -->
-<!-- ===================================================================== -->
-
-<!-- $Id: oracle-xa-ds.xml 71535 2008-04-01 07:05:03Z adrian at jboss.org $ -->
-
-<!-- ===================================================================== -->
-<!-- ATTENTION:  DO NOT FORGET TO SET Pad=true IN transaction-service.xml  -->
-<!-- ===================================================================== -->
-
-<datasources>
-
-  <xa-datasource>
-    <jndi-name>RecoveryDS</jndi-name>
-    <track-connection-by-tx>true</track-connection-by-tx> 
-    <isSameRM-override-value>false</isSameRM-override-value>
-    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
-    <xa-datasource-property name="URL">jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmg25-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</xa-datasource-property>
-    <xa-datasource-property name="User">crashrec</xa-datasource-property>
-    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
-    <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
-    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
-    <!-- Checks the Oracle error codes and messages for fatal errors -->
-    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
-    <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
-    <no-tx-separate-pools/>
-
-      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
-      <metadata>
-         <type-mapping>Oracle9i</type-mapping>
-      </metadata>
-  </xa-datasource>
-
-</datasources>

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle10-xa-ds.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle10-xa-ds.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle10-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -20,10 +20,9 @@
     <isSameRM-override-value>false</isSameRM-override-value>
     <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
     <xa-datasource-property name="URL">jdbc:oracle:thin:@vmg05.mw.lab.eng.bos.redhat.com:1521:qaora10</xa-datasource-property>
-    <xa-datasource-property name="User">crashrec</xa-datasource-property>
-    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+    @CREDENTIALS@
     <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
-    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
+    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
     <!-- Checks the Oracle error codes and messages for fatal errors -->
     <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
     <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle11-r2-xa-ds.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle11-r2-xa-ds.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle11-r2-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -19,11 +19,10 @@
     <track-connection-by-tx>true</track-connection-by-tx> 
     <isSameRM-override-value>false</isSameRM-override-value>
     <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
-    <xa-datasource-property name="URL">jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmg27-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</xa-datasource-property>
-    <xa-datasource-property name="User">crashrec</xa-datasource-property>
-    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+    <xa-datasource-property name="URL">jdbc:oracle:thin:@vmg27.mw.lab.eng.bos.redhat.com:1521:qaora11</xa-datasource-property>
+    @CREDENTIALS@
     <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
-    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
+    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
     <!-- Checks the Oracle error codes and messages for fatal errors -->
     <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
     <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle11-xa-ds.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle11-xa-ds.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/oracle11-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -20,19 +20,18 @@
     <isSameRM-override-value>false</isSameRM-override-value>
     <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
     <xa-datasource-property name="URL">jdbc:oracle:thin:@dev04.qa.atl2.redhat.com:1521:qaora11</xa-datasource-property>
-    <xa-datasource-property name="User">crashrec</xa-datasource-property>
-    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+    @CREDENTIALS@
     <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
-    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
+    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
     <!-- Checks the Oracle error codes and messages for fatal errors -->
     <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
     <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
     <no-tx-separate-pools/>
 
-      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
-      <metadata>
-         <type-mapping>Oracle9i</type-mapping>
-      </metadata>
+    <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
+    <metadata>
+       <type-mapping>Oracle9i</type-mapping>
+    </metadata>
   </xa-datasource>
 
 </datasources>

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/postgres82-xa-ds.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/postgres82-xa-ds.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/postgres82-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -7,7 +7,6 @@
     <xa-datasource-property name="ServerName">vmg01.mw.lab.eng.bos.redhat.com</xa-datasource-property>
     <xa-datasource-property name="PortNumber">5432</xa-datasource-property>
     <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
-    <xa-datasource-property name="User">crashrec</xa-datasource-property>
-    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+    @CREDENTIALS@
   </xa-datasource>
 </datasources>

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/postgres83-xa-ds.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/postgres83-xa-ds.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/postgres83-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -7,7 +7,6 @@
     <xa-datasource-property name="ServerName">vmg03.mw.lab.eng.bos.redhat.com</xa-datasource-property>
     <xa-datasource-property name="PortNumber">5432</xa-datasource-property>
     <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
-    <xa-datasource-property name="User">crashrec</xa-datasource-property>
-    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+    @CREDENTIALS@
   </xa-datasource>
 </datasources>

Copied: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/postgres84-xa-ds.xml (from rev 109526, trunk/testsuite/src/resources/jbossts/resources/postgres84-xa-ds.xml)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/postgres84-xa-ds.xml	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/postgres84-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<datasources>
+  <xa-datasource>
+    <jndi-name>CrashRecoveryDS</jndi-name>
+    <track-connection-by-tx>true</track-connection-by-tx> 
+    <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
+    <xa-datasource-property name="ServerName">postgresql02.mw.lab.eng.bos.redhat.com</xa-datasource-property>
+    <xa-datasource-property name="PortNumber">5432</xa-datasource-property>
+    <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
+    @CREDENTIALS@
+  </xa-datasource>
+</datasources>

Copied: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/postgres90-xa-ds.xml (from rev 109526, trunk/testsuite/src/resources/jbossts/resources/postgres90-xa-ds.xml)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/postgres90-xa-ds.xml	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/postgres90-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<datasources>
+  <xa-datasource>
+    <jndi-name>CrashRecoveryDS</jndi-name>
+    <track-connection-by-tx>true</track-connection-by-tx> 
+    <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
+    <xa-datasource-property name="ServerName">vmg03.mw.lab.eng.bos.redhat.com</xa-datasource-property>
+    <xa-datasource-property name="PortNumber">5432</xa-datasource-property>
+    <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
+    @CREDENTIALS@
+  </xa-datasource>
+</datasources>

Deleted: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/sybase12-xa-ds.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/sybase12-xa-ds.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/sybase12-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  JBoss Server Configuration                                           -->
-<!-- Thanks to kosulin in the forumns                                      -->
-<!-- ===================================================================== -->
-
-<!-- $Id: sybase-xa-ds.xml 85945 2009-03-16 19:45:12Z dimitris at jboss.org $ -->
-
-<datasources>
-
-   <xa-datasource>
-     <jndi-name>CrashRecoveryDS</jndi-name>
-     <!-- uncomment to enable interleaving <interleaving/> -->
-     <xa-datasource-class>com.sybase.jdbc3.jdbc.SybXADataSource</xa-datasource-class>
-     <xa-datasource-property name="NetworkProtocol">Tds</xa-datasource-property>
-     <xa-datasource-property name="ServerName">dev01.qa.atl.jboss.com</xa-datasource-property>
-     <xa-datasource-property name="PortNumber">4100</xa-datasource-property>
-     <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
-     <xa-datasource-property name="User">crashrec</xa-datasource-property>
-     <xa-datasource-property name="Password">crashrec</xa-datasource-property>
-     <min-pool-size>1</min-pool-size>
-     <max-pool-size>20</max-pool-size>
-     <idle-timeout-minutes>15</idle-timeout-minutes>
-     <!--check-valid-connection-sql>select 1 from mytable</check-valid-connection-sql-->
-     <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>
-     <type-mapping>Sybase</type-mapping>
-
-   </xa-datasource>
-
-</datasources>

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/sybase15-xa-ds.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/sybase15-xa-ds.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/sybase15-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -13,20 +13,16 @@
    <xa-datasource>
      <jndi-name>CrashRecoveryDS</jndi-name>
      <!-- uncomment to enable interleaving <interleaving/> -->
-     <xa-datasource-class>com.sybase.jdbc3.jdbc.SybXADataSource</xa-datasource-class>
+     <xa-datasource-class>com.sybase.jdbc4.jdbc.SybXADataSource</xa-datasource-class>
      <xa-datasource-property name="NetworkProtocol">Tds</xa-datasource-property>
-     <xa-datasource-property name="ServerName">dev77.qa.atl2.redhat.com</xa-datasource-property>
-     <xa-datasource-property name="PortNumber">4100</xa-datasource-property>
+     <xa-datasource-property name="ServerName">vmg07.mw.lab.eng.bos.redhat.com</xa-datasource-property>
+     <xa-datasource-property name="PortNumber">5000</xa-datasource-property>
      <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
-     <xa-datasource-property name="User">crashrec</xa-datasource-property>
-     <xa-datasource-property name="Password">crashrec</xa-datasource-property>
-     <min-pool-size>1</min-pool-size>
-     <max-pool-size>20</max-pool-size>
-     <idle-timeout-minutes>15</idle-timeout-minutes>
+     @CREDENTIALS@
      <!--check-valid-connection-sql>select 1 from mytable</check-valid-connection-sql-->
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>
      <type-mapping>Sybase</type-mapping>
-
+     <track-connection-by-tx/>
    </xa-datasource>
 
 </datasources>

Copied: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/sybase15.5-xa-ds.xml (from rev 109526, trunk/testsuite/src/resources/jbossts/resources/sybase15.5-xa-ds.xml)
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/sybase15.5-xa-ds.xml	                        (rev 0)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/resources/sybase15.5-xa-ds.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  JBoss Server Configuration                                           -->
+<!-- Thanks to kosulin in the forumns                                      -->
+<!-- ===================================================================== -->
+
+<!-- $Id: sybase-xa-ds.xml 85945 2009-03-16 19:45:12Z dimitris at jboss.org $ -->
+
+<datasources>
+
+   <xa-datasource>
+     <jndi-name>CrashRecoveryDS</jndi-name>
+     <!-- uncomment to enable interleaving <interleaving/> -->
+     <xa-datasource-class>com.sybase.jdbc4.jdbc.SybXADataSource</xa-datasource-class>
+     <xa-datasource-property name="NetworkProtocol">Tds</xa-datasource-property>
+     <xa-datasource-property name="ServerName">vmg09.mw.lab.eng.bos.redhat.com</xa-datasource-property>
+     <xa-datasource-property name="PortNumber">5000</xa-datasource-property>
+     <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
+     @CREDENTIALS@
+     <!--check-valid-connection-sql>select 1 from mytable</check-valid-connection-sql-->
+     <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>
+     <type-mapping>Sybase</type-mapping>
+     <track-connection-by-tx/>
+   </xa-datasource>
+
+</datasources>

Modified: branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/scripts/as-tests.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/scripts/as-tests.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/testsuite/src/resources/jbossts/scripts/as-tests.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -54,9 +54,18 @@
     <condition property="want.psql_8.3">
        <equals arg1="${jbossts.db}" arg2="psql_8.3"/>
     </condition>
+    <condition property="want.psql_8.4">
+       <equals arg1="${jbossts.db}" arg2="psql_8.4"/>
+    </condition>
+    <condition property="want.psql_9.0">
+       <equals arg1="${jbossts.db}" arg2="psql_9.0"/>
+    </condition>
     <condition property="want.sybase_15">
        <equals arg1="${jbossts.db}" arg2="sybase_15"/>
     </condition>
+    <condition property="want.sybase_15.5">
+       <equals arg1="${jbossts.db}" arg2="sybase_15.5"/>
+    </condition>
     <condition property="want.oracle_10">
        <equals arg1="${jbossts.db}" arg2="oracle_10"/>
     </condition>
@@ -98,7 +107,10 @@
   <target name="want-all-dbs">
   	<property name="want.psql_8.2" value="true" />
   	<property name="want.psql_8.3" value="true" />
+  	<property name="want.psql_8.4" value="true" />
+  	<property name="want.psql_9.0" value="true" />
   	<property name="want.sybase_15" value="true" />
+  	<property name="want.sybase_15.5" value="true" />
   	<property name="want.oracle_10" value="true" />
   	<property name="want.oracle_11" value="true" />
   	<property name="want.oracle_11_r2" value="true" />
@@ -188,6 +200,8 @@
   <target name="call-tests-for-all-dbs">
   	<antcall target="call-tests-for-psql_8.2"/>
   	<antcall target="call-tests-for-psql_8.3"/>
+  	<antcall target="call-tests-for-psql_8.4"/>
+  	<!--antcall target="call-tests-for-psql_9.0"/-->
   	<antcall target="call-tests-for-oracle_10"/>
   	<antcall target="call-tests-for-oracle_11"/>
   	<antcall target="call-tests-for-oracle_11_r2"/>
@@ -197,6 +211,7 @@
   	<antcall target="call-tests-for-mysql_5.1"/>
   	<antcall target="call-tests-for-db2_9.7"/>
   	<antcall target="call-tests-for-sybase_15"/>
+  	<antcall target="call-tests-for-sybase_15.5"/>
   	<antcall target="call-tests-for-oracle_rac"/>
   	<antcall target="call-tests-for-oracle_rac_lb"/>
   	<antcall target="call-tests-for-oracle_rac_r2"/>
@@ -219,6 +234,22 @@
     </antcall>
   </target>
 
+  <target name="call-tests-for-psql_8.4" if="want.psql_8.4">
+    <antcall target="${call.target}">
+      <param name="dbdriver" value="${driver.name.psql_8.4}"/>
+      <param name="datasource" value="postgres84-xa-ds.xml" /> 
+   	  <param name="dbname" value="psql84" /> 
+    </antcall>
+  </target>
+
+  <target name="call-tests-for-psql_9.0" if="want.psql_9.0">
+    <antcall target="${call.target}">
+      <param name="dbdriver" value="${driver.name.psql_9.0}"/>
+      <param name="datasource" value="postgres90-xa-ds.xml" /> 
+   	  <param name="dbname" value="psql90" /> 
+    </antcall>
+  </target>
+
   <target name="call-tests-for-oracle_10" if="want.oracle_10">
   	<antcall target="${call.target}">
   	  <param name="dbdriver" value="${driver.name.oracle_10}"/>
@@ -245,15 +276,16 @@
 
   <target name="call-tests-for-oracle_rac" if="want.oracle_rac">
     <antcall target="${call.target}">
-      <param name="dbdriver" value="${driver.name.oracle_11}"/>
-      <param name="datasource" value="oracle-rac1-xa-ds.xml" /> 
+      <param name="dbdriver" value="${driver.name.oracle_11_rac}"/>
+      <param name="datasource" value="oracle-rac-xa-ds.xml" /> 
       <param name="dbname" value="oracle_rac" /> 
+      <param name="recovery.datasource" value="RecoveryDS" />
     </antcall>
   </target>
 
   <target name="call-tests-for-oracle_rac_lb" if="want.oracle_rac_lb">
     <antcall target="${call.target}">
-      <param name="dbdriver" value="${driver.name.oracle_11}"/>
+      <param name="dbdriver" value="${driver.name.oracle_11_rac}"/>
       <param name="datasource" value="oracle-rac-lb-xa-ds.xml" /> 
       <param name="dbname" value="oracle_rac_lb" /> 
     </antcall>
@@ -261,15 +293,16 @@
 
   <target name="call-tests-for-oracle_rac_r2" if="want.oracle_rac_r2">
     <antcall target="${call.target}">
-      <param name="dbdriver" value="${driver.name.oracle_11}"/>
-      <param name="datasource" value="oracle-rac-r2-1-xa-ds.xml" /> 
+      <param name="dbdriver" value="${driver.name.oracle_11_rac}"/>
+      <param name="datasource" value="oracle-rac-r2-xa-ds.xml" /> 
       <param name="dbname" value="oracle_rac_r2" /> 
+      <param name="recovery.datasource" value="RecoveryDS" />
     </antcall>
   </target>
 
   <target name="call-tests-for-oracle_rac_r2_lb" if="want.oracle_rac_r2_lb">
     <antcall target="${call.target}">
-      <param name="dbdriver" value="${driver.name.oracle_11}"/>
+      <param name="dbdriver" value="${driver.name.oracle_11_rac}"/>
       <param name="datasource" value="oracle-rac-r2-lb-xa-ds.xml" /> 
       <param name="dbname" value="oracle_rac_r2_lb" /> 
     </antcall>
@@ -323,6 +356,13 @@
     </antcall>
   </target>
 
+  <target name="call-tests-for-sybase_15.5" if="want.sybase_15.5">
+  	<antcall target="${call.target}">
+  	  <param name="dbdriver" value="${driver.name.sybase_15}"/>
+  	  <param name="datasource" value="sybase15.5-xa-ds.xml" /> 
+   	  <param name="dbname" value="sybase15.5" /> 
+    </antcall>
+  </target>
 
 
   <target name="crash-tests-for-database" depends="crash-tests-for-database-cmt, crash-tests-for-database-bmt" />
@@ -416,7 +456,7 @@
       <condition property="test.name.reverseOrder" value="-reverse" else="">
         <istrue value="${reverseOrder}"/>
       </condition>
-      <property name="testname" value="${tstype}-${specs}-${test.name.cmt}${test.name.reverseOrder}"/>
+      <property name="testname" value="${tstype}-${specs}-${test.name.cmt}${test.name.reverseOrder}-${jbossts.credentials}"/>
 
       <condition property="astest.app.jar.name" value="${astest.alternative.jar.name}">
         <isset property="astest.alternative.jar.name"/>
@@ -428,9 +468,11 @@
       </condition>
       <property name="storeType" value="StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction" />
      
+      <property name="recovery.datasource" value="CrashRecoveryDS" />
+  	
+      <deploy-datasource-and-set-credentials from="${product.dir}/resources/${datasource}" to="${jboss.home}/server/crashrecovery-${tstype}/deploy/${datasource}" />
       <astest:server method="start" serverName="crashrecovery-${tstype}" >
         <deploy from="dbdrivers/${dbdriver}" to="lib/${dbdriver}" />
-        <deploy from="resources/${datasource}" to="deploy/${datasource}" />
         <deploy from="${astest.jar.deploy.dir}/${astest.app.jar.name}" to="deploy/${astest.app.jar.name}" />
       </astest:server>
       <astest:action abortOnFail="false" waitFor="10000" impl="org.jboss.test.jbossts.taskdefs.JUnitClientAction">
@@ -447,24 +489,27 @@
         <param key="debug" value="true" />
         <param key="reportFile" value="${build.reports}/TEST-org.jboss.test.jbossts.ASCrashRecovery01.TestWithJPA-${dbname}-${testname}.xml" />
         <param key="testTime" value="${testTime}" />
+        <param key="recoveryDatasource" value="${recovery.datasource}" />
       </astest:action>
       <astest:server method="stop" serverName="crashrecovery-${tstype}" >
         <undeploy from="deploy/${astest.app.jar.name}" />
-        <undeploy from="deploy/${datasource}" />
-        <undeploy from="lib/${dbdriver}" />    	
+        <undeploy from="lib/${dbdriver}" />
       </astest:server>
-      
-      <!-- archive the server log -->
-      <zip destfile="${jboss.home}/server/crashrecovery-${tstype}/log/server-${dbname}-${testname}.log.zip">
-        <fileset file="${jboss.home}/server/crashrecovery-${tstype}/log/server.log"/>
-        <fileset file="${jboss.home}/server/crashrecovery-${tstype}/log/boot.log"/>
+
+      <!-- archive artifacts -->
+      <zip destfile="${jboss.home}/server/crashrecovery-${tstype}/server-${dbname}-${testname}.artifacts.zip">
+        <fileset dir="${jboss.home}/server/crashrecovery-${tstype}">
+          <include name="log/boot.log"/>
+          <include name="log/server.log"/>
+          <include name="data/tx-object-store/**"/>
+          <include name="deploy/*-ds.xml"/>
+          <exclude name="deploy/hsqldb-ds.xml"/>
+        </fileset>
       </zip>
+      <delete file="${jboss.home}/server/crashrecovery-${tstype}/deploy/${datasource}"/>
       <delete file="${jboss.home}/server/crashrecovery-${tstype}/log/server.log"/>
-      <delete file="${jboss.home}/server/crashrecovery-${tstype}/log/boot.log"/>
-      <copy todir="${jboss.home}/server/crashrecovery-${tstype}/data/tx-object-store-${dbname}-${testname}"> 
-        <fileset dir="${jboss.home}/server/crashrecovery-${tstype}/data/tx-object-store" />
-      </copy>
       <delete dir="${jboss.home}/server/crashrecovery-${tstype}/data/tx-object-store"/>
+    	
       <!-- delete work and tmp dirs otherwise tests failed due to permgen space - FIXME is this the right way how to ensure that? -->
       <delete dir="${jboss.home}/server/crashrecovery-${tstype}/work"/>
       <delete dir="${jboss.home}/server/crashrecovery-${tstype}/tmp"/>
@@ -472,13 +517,40 @@
     </sequential>
   </target>
 
-  <target name="hack-before-astest-run" depends="hack-before-astest-run-for-db2_9.7, hack-before-astest-run-for-oracle_rac, hack-before-astest-run-for-oracle_rac_r2" />
+  <macrodef name="deploy-datasource-and-set-credentials">
+    <attribute name="from"/>
+    <attribute name="to"/>
+    <sequential>
+    	
+      <condition property="recover.credentials" value="&lt;xa-datasource-property name=&quot;User&quot;&gt;crashrec&lt;/xa-datasource-property&gt;&lt;xa-datasource-property name=&quot;Password&quot;&gt;crashrec&lt;/xa-datasource-property&gt;">
+         <equals arg1="${jbossts.credentials}" arg2="cr1"/>
+      </condition>
+      <condition property="recover.credentials" value="&lt;user-name&gt;crash0&lt;/user-name&gt;&lt;password&gt;crash0&lt;/password&gt;&lt;recover-user-name&gt;crashrec&lt;/recover-user-name&gt;&lt;recover-password&gt;crashrec&lt;/recover-password&gt;">
+         <equals arg1="${jbossts.credentials}" arg2="cr2"/>
+      </condition>
+      <condition property="recover.credentials" value="&lt;security-domain&gt;CrashRecoveryDomain0&lt;/security-domain&gt;&lt;recover-user-name&gt;crashrec&lt;/recover-user-name&gt;&lt;recover-password&gt;crashrec&lt;/recover-password&gt;">
+         <equals arg1="${jbossts.credentials}" arg2="cr3"/>
+      </condition>
+      <condition property="recover.credentials" value="&lt;security-domain&gt;CrashRecoveryDomain0&lt;/security-domain&gt;&lt;recover-security-domain&gt;CrashRecoveryDomain&lt;/recover-security-domain&gt;">
+         <equals arg1="${jbossts.credentials}" arg2="cr4"/>
+      </condition>
+    	
+      <echo message="Datasource: @{to}"/>
+      <echo message="Setting DS credentials to: ${recover.credentials}"/>
+    	
+      <copy file="@{from}" tofile="@{to}">
+        <filterset>
+          <filter token="CREDENTIALS" value="${recover.credentials}"/>
+        </filterset>	
+	  </copy>
+    </sequential>
+  </macrodef>
+
+  <target name="hack-before-astest-run" depends="hack-before-astest-run-for-db2_9.7" />
   
-  <target name="hack-after-astest-run" depends="hack-after-astest-run-for-db2_9.7, hack-after-astest-run-for-oracle_rac, hack-after-astest-run-for-oracle_rac_r2" />
+  <target name="hack-after-astest-run" depends="hack-after-astest-run-for-db2_9.7" />
   
   <target name="hack-before-astest-run-for-db2_9.7" if="want.db2_9.7">
-  	<!-- deploy license .jar file  -->
-  	<copy file="${product.dir}/dbdrivers/db2jcc_license_cu.jar" todir="${jboss.home}/server/crashrecovery-${tstype}/lib" />
   	<!-- prepare hacked astest jar -->
   	<property name="astest.alternative.jar.name" value="db2-${astest.jar.name}" />
   	
@@ -507,49 +579,10 @@
   </target>
   
   <target name="hack-after-astest-run-for-db2_9.7" if="want.db2_9.7">
-  	<!-- undeploy license .jar file  -->
-  	<delete file="${jboss.home}/server/crashrecovery-${tstype}/lib/db2jcc_license_cu.jar" />
+  	<!-- nothing to do here -->
   </target>
   
-  <target name="hack-before-astest-run-for-oracle_rac" if="want.oracle_rac">
-    <antcall target="hack-before-astest-run-for-oracle_racs"><param name="oracle_rac_second_ds" value="oracle-rac2-xa-ds.xml"/></antcall>
-  </target>
   
-  <target name="hack-after-astest-run-for-oracle_rac" if="want.oracle_rac">
-    <antcall target="hack-after-astest-run-for-oracle_racs"><param name="oracle_rac_second_ds" value="oracle-rac2-xa-ds.xml"/></antcall>
-  </target>
-
-  <target name="hack-before-astest-run-for-oracle_rac_r2" if="want.oracle_rac_r2">
-    <antcall target="hack-before-astest-run-for-oracle_racs"><param name="oracle_rac_second_ds" value="oracle-rac-r2-2-xa-ds.xml"/></antcall>
-  </target>
-  
-  <target name="hack-after-astest-run-for-oracle_rac_r2" if="want.oracle_rac_r2">
-    <antcall target="hack-after-astest-run-for-oracle_racs"><param name="oracle_rac_second_ds" value="oracle-rac-r2-2-xa-ds.xml"/></antcall>
-  </target>
-
-  <target name="hack-before-astest-run-for-oracle_racs">
-    <!-- deploy the second DS configuration  -->
-    <copy file="${product.dir}/resources/${oracle_rac_second_ds}" todir="${jboss.home}/server/crashrecovery-${tstype}/deploy" />
-
-    <!-- hack the configuration of JBossTS in order to use the second datasource for crash recovery -->
-    <replace file="${jboss.home}/server/crashrecovery-${tstype}/deploy/transaction-jboss-beans.xml">
-      <replacetoken><![CDATA[com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery;jndiname=CrashRecoveryDS]]></replacetoken>
-      <replacevalue><![CDATA[com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery;jndiname=RecoveryDS]]></replacevalue>
-    </replace>
-  </target>
-
-  <target name="hack-after-astest-run-for-oracle_racs">
-    <!-- undeploy the second DS configuration -->
-    <delete file="${jboss.home}/server/crashrecovery-${tstype}/deploy/${oracle_rac_second_ds}" />
-  	
-    <!-- unhack the configuration of JBossTS -->
-    <replace file="${jboss.home}/server/crashrecovery-${tstype}/deploy/transaction-jboss-beans.xml">
-      <replacetoken><![CDATA[com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery;jndiname=RecoveryDS]]></replacetoken>
-      <replacevalue><![CDATA[com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery;jndiname=CrashRecoveryDS]]></replacevalue>
-    </replace>
-  </target>
-  
-  
   <!-- 
     Do use this target if you want to wipe out txs in doubt in all databases. 
     -->
@@ -595,39 +628,55 @@
 	<!-- =====  get db drivers - borrowed from  https://svn.jboss.org/repos/labs/labs/jbosstm/trunk/qa/build.xml  ==== -->
     <!-- set these to the location(s) of the database drivers -->
 	
-	<property name="driver.url" value="http://reports.qa.atl.jboss.com/jdbc-drivers/"/>
+    <property name="driver.url" value="http://www.qa.jboss.com/jdbc-drivers-products/EAP/5.1.0"/>
     <property name="driver.name.psql_8.2" value="postgresql-8.2.jar"/>
     <property name="driver.name.psql_8.3" value="postgresql-8.3.jar"/>
-    <property name="driver.name.sybase_15" value="jconn3.jar"/>
+    <property name="driver.name.psql_8.4" value="postgresql-8.4.jar"/>
+    <property name="driver.name.psql_9.0" value="postgresql-9.0.jar"/>
+    <property name="driver.name.sybase_15" value="jconn4.jar"/>
     <property name="driver.name.oracle_10" value="ojdbc14.jar"/>
     <property name="driver.name.oracle_11" value="ojdbc6.jar"/>
+    <property name="driver.name.oracle_11_rac" value="ojdbc6_rac.jar"/>
     <property name="driver.name.db2_9.7" value="db2jcc.jar"/>
     <property name="driver.name.mysql_5.0" value="mysql-connector-java-5.0.jar"/>
     <property name="driver.name.mysql_5.1" value="mysql-connector-java-5.1.jar"/>
-    <property name="driver.name.mssql_2005" value="sqljdbc4.jar"/>
-    <property name="driver.name.mssql_2008" value="sqljdbc4.jar"/>
+    <property name="driver.name.mssql_2005" value="sqljdbc4_2005.jar"/>
+    <property name="driver.name.mssql_2008" value="sqljdbc4_2008.jar"/>
 	
     <target name="prepare-drivers">
        <available file="${driver.home}/${driver.name.psql_8.2}" property="have.dbdriver.psql_8.2" value="true"/>      
        <available file="${driver.home}/${driver.name.psql_8.3}" property="have.dbdriver.psql_8.3" value="true"/>      
+       <available file="${driver.home}/${driver.name.psql_8.4}" property="have.dbdriver.psql_8.4" value="true"/>      
+       <available file="${driver.home}/${driver.name.psql_9.0}" property="have.dbdriver.psql_9.0" value="true"/>      
        <available file="${driver.home}/${driver.name.sybase_15}" property="have.dbdriver.sybase_15" value="true"/>
        <available file="${driver.home}/${driver.name.oracle_10}" property="have.dbdriver.oracle_10" value="true"/>   	
        <available file="${driver.home}/${driver.name.oracle_11}" property="have.dbdriver.oracle_11" value="true"/>      
+       <available file="${driver.home}/${driver.name.oracle_11_rac}" property="have.dbdriver.oracle_11_rac" value="true"/>      
        <available file="${driver.home}/${driver.name.db2_9.7}" property="have.dbdriver.db2_9.7" value="true"/>      
        <available file="${driver.home}/${driver.name.mysql_5.0}" property="have.dbdriver.mysql_5.0" value="true"/>      
        <available file="${driver.home}/${driver.name.mysql_5.1}" property="have.dbdriver.mysql_5.1" value="true"/>      
        <available file="${driver.home}/${driver.name.mssql_2005}" property="have.dbdriver.mssql_2005" value="true"/>      
        <available file="${driver.home}/${driver.name.mssql_2008}" property="have.dbdriver.mssql_2008" value="true"/>
+       <condition property="want.dbdriver.sybase_15">
+          <or>
+             <istrue value="${want.sybase_15}"/>
+             <istrue value="${want.sybase_15.5}"/>
+          </or>
+       </condition>
        <condition property="want.dbdriver.oracle_11">
           <or>
              <istrue value="${want.oracle_11}"/>
              <istrue value="${want.oracle_11_r2}"/>
-             <istrue value="${want.oracle_rac}"/>
-             <istrue value="${want.oracle_rac_lb}"/>
-             <istrue value="${want.oracle_rac_r2}"/>
-             <istrue value="${want.oracle_rac_r2_lb}"/>
           </or>
        </condition>
+        <condition property="want.dbdriver.oracle_11_rac">
+           <or>
+              <istrue value="${want.oracle_rac}"/>
+              <istrue value="${want.oracle_rac_lb}"/>
+              <istrue value="${want.oracle_rac_r2}"/>
+              <istrue value="${want.oracle_rac_r2_lb}"/>
+           </or>
+        </condition>
        
        <mkdir dir="${driver.home}" />
        <antcall target="get.drivers" />
@@ -635,56 +684,69 @@
 
     <target name="get.drivers" 
     	depends="get.driver.oracle_10, 
-    	         get.driver.oracle_11,
+                 get.driver.oracle_11,
+                 get.driver.oracle_11_rac,
                  get.driver.mssql_2005,
-    	         get.driver.mssql_2008,
-    	         get.driver.psql_8.3,
-    	         get.driver.psql_8.2,
-    	         get.driver.mysql_5.1,
+                 get.driver.mssql_2008,
+                 get.driver.psql_9.0,
+                 get.driver.psql_8.4,
+                 get.driver.psql_8.3,
+                 get.driver.psql_8.2,
+                 get.driver.mysql_5.1,
                  get.driver.mysql_5.0,
-    	         get.driver.db2_9.7,
-    	         get.driver.sybase_15" />
+                 get.driver.db2_9.7,
+                 get.driver.sybase_15" />
     	
     <target name="get.driver.oracle_10" unless="have.dbdriver.oracle_10" if="want.oracle_10">
-        <get src="${driver.url}/maven2/com/oracle/ojdbc14/10.2.0.4/ojdbc14-10.2.0.4.jar"
+        <get src="${driver.url}/oracle10g/jdbc4/ojdbc14.jar"
              dest="${driver.home}/${driver.name.oracle_10}"/>
     </target>
     <target name="get.driver.oracle_11" unless="have.dbdriver.oracle_11" if="want.dbdriver.oracle_11">
-        <get src="${driver.url}/maven2/com/oracle/ojdbc6/11.2.0.1.0/ojdbc6-11.2.0.1.0.jar"
+        <get src="${driver.url}/oracle11gR1/jdbc4/ojdbc6.jar"
              dest="${driver.home}/${driver.name.oracle_11}"/>
     </target>
+    <target name="get.driver.oracle_11_rac" unless="have.dbdriver.oracle_11_rac" if="want.dbdriver.oracle_11_rac">
+        <get src="${driver.url}/oracle11gR1RAC/jdbc4/ojdbc6.jar"
+             dest="${driver.home}/${driver.name.oracle_11_rac}"/>
+    </target>
     <target name="get.driver.mssql_2005" unless="have.dbdriver.mssql_2005" if="want.mssql_2005">
-        <get src="${driver.url}/maven2/com/microsoft/sqlserver/msjdbc/2.0.1008.2/msjdbc-2.0.1008.2-4.jar"
+        <get src="${driver.url}/mssql2005/jdbc4/sqljdbc4.jar"
              dest="${driver.home}/${driver.name.mssql_2005}"/>
     </target>
     <target name="get.driver.mssql_2008" unless="have.dbdriver.mssql_2008" if="want.mssql_2008">
-        <get src="${driver.url}/maven2/com/microsoft/sqlserver/msjdbc/2.0.1008.2/msjdbc-2.0.1008.2-4.jar"
+        <get src="${driver.url}/mssql2008/jdbc4/sqljdbc4.jar"
              dest="${driver.home}/${driver.name.mssql_2008}"/>
     </target>
+    <target name="get.driver.psql_8.4" unless="have.dbdriver.psql_8.4" if="want.psql_8.4">
+        <get src="${driver.url}/postgresql84/jdbc4/postgresql-8.4-702.jdbc4.jar"
+             dest="${driver.home}/${driver.name.psql_8.4}"/>
+    </target>
+    <target name="get.driver.psql_9.0" unless="have.dbdriver.psql_9.0" if="want.psql_9.0">
+        <get src="${driver.url}/postgresql83/jdbc4/postgresql-8.3-605.jdbc4.jar"
+             dest="${driver.home}/${driver.name.psql_9.0}"/>
+    </target>
     <target name="get.driver.psql_8.3" unless="have.dbdriver.psql_8.3" if="want.psql_8.3">
-        <get src="${driver.url}/postgresql-8.3-605.jdbc4.jar"
+        <get src="${driver.url}/postgresql83/jdbc4/postgresql-8.3-605.jdbc4.jar"
              dest="${driver.home}/${driver.name.psql_8.3}"/>
     </target>
     <target name="get.driver.psql_8.2" unless="have.dbdriver.psql_8.2" if="want.psql_8.2">
-        <get src="${driver.url}/postgresql-8.2-510.jdbc4.jar"
+        <get src="${driver.url}/postgresql82/jdbc4/postgresql-8.2-510.jdbc4.jar"
              dest="${driver.home}/${driver.name.psql_8.2}"/>
     </target>
     <target name="get.driver.mysql_5.1" unless="have.dbdriver.mysql_5.1" if="want.mysql_5.1">
-        <get src="${driver.url}/maven2/mysql/mysql-connector-java/5.1.12/mysql-connector-java-5.1.12.jar"
+        <get src="${driver.url}/mysql51/jdbc4/mysql-connector-java-5.1.13-bin.jar"
              dest="${driver.home}/${driver.name.mysql_5.1}"/>
     </target>
     <target name="get.driver.mysql_5.0" unless="have.dbdriver.mysql_5.0" if="want.mysql_5.0">
-        <get src="${driver.url}/maven2/mysql/mysql-connector-java/5.0.8/mysql-connector-java-5.0.8.jar"
+        <get src="${driver.url}/mysql50/jdbc4/mysql-connector-java-5.0.8-bin.jar"
              dest="${driver.home}/${driver.name.mysql_5.0}"/>
     </target>
     <target name="get.driver.db2_9.7" unless="have.dbdriver.db2_9.7" if="want.db2_9.7">
-        <get src="${driver.url}/maven2/com/ibm/db2jcc/3.57.86/db2jcc-3.57.86.jar"
+        <get src="${driver.url}/db2-97/jdbc4/db2jcc4.jar"
              dest="${driver.home}/${driver.name.db2_9.7}"/>
-        <get src="${driver.url}/maven2/com/ibm/db2jcc_license_cu/3.57.86/db2jcc_license_cu-3.57.86.jar"
-             dest="${driver.home}/db2jcc_license_cu.jar"/>
     </target>
-    <target name="get.driver.sybase_15" unless="have.dbdriver.sybase_15" if="want.sybase_15">
-        <get src="${driver.url}/maven2/com/sybase/jconnect/6.0.5_26564/jconnect-6.0.5_26564.jar"
+    <target name="get.driver.sybase_15" unless="have.dbdriver.sybase_15" if="want.dbdriver.sybase_15">
+        <get src="${driver.url}/sybase15/jdbc4/jconn4-26502.jar"
              dest="${driver.home}/${driver.name.sybase_15}"/>
     </target>
 
@@ -805,15 +867,15 @@
     </condition>
     <property name="astest.app.jar.name" value="${astest.jar.name}" />
   	
+    <deploy-datasource-and-set-credentials from="${product.dir}/resources/${datasource}" to="${jboss.home}/server/jts-propagation-node0/deploy/${datasource}" />
     <astest:server method="start" serverName="jts-propagation-node0" >
       <deploy from="dbdrivers/${dbdriver}" to="lib/${dbdriver}" />
-      <deploy from="resources/${datasource}" to="deploy/${datasource}" />
       <deploy from="${astest.jar.deploy.dir}/${astest.app.jar.name}" to="deploy/${astest.jar.name}" />
       <deploy from="${astest.jar.deploy.dir}/${astest.ejb2.jar.name}" to="deploy/${astest.ejb2.jar.name}" />
     </astest:server>
+    <deploy-datasource-and-set-credentials from="${product.dir}/resources/${datasource}" to="${jboss.home}/server/jts-propagation-node1/deploy/${datasource}" />
     <astest:server method="start" serverName="jts-propagation-node1" >
       <deploy from="dbdrivers/${dbdriver}" to="lib/${dbdriver}" />
-      <deploy from="resources/${datasource}" to="deploy/${datasource}" />
       <deploy from="${astest.jar.deploy.dir}/${astest.app.jar.name}" to="deploy/${astest.jar.name}" />
       <deploy from="${astest.jar.deploy.dir}/${astest.ejb2.jar.name}" to="deploy/${astest.ejb2.jar.name}" />
     </astest:server>

Modified: branches/JBoss-AS-6.0.x_ipv6/tomcat/src/main/java/org/jboss/web/tomcat/service/deployers/TomcatDeployment.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/tomcat/src/main/java/org/jboss/web/tomcat/service/deployers/TomcatDeployment.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/tomcat/src/main/java/org/jboss/web/tomcat/service/deployers/TomcatDeployment.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -21,6 +21,23 @@
  */
 package org.jboss.web.tomcat.service.deployers;
 
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLDecoder;
+import java.security.CodeSource;
+import java.security.cert.Certificate;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.naming.Context;
+
 import org.apache.catalina.Container;
 import org.apache.catalina.Engine;
 import org.apache.catalina.LifecycleEvent;
@@ -37,7 +54,6 @@
 import org.jboss.metadata.web.jboss.JBossWebMetaData;
 import org.jboss.metadata.web.spec.TldMetaData;
 import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.naming.NonSerializableFactory;
 import org.jboss.reloaded.naming.CurrentComponent;
 import org.jboss.reloaded.naming.deployers.javaee.JavaEEComponentInformer;
 import org.jboss.reloaded.naming.spi.JavaEEComponent;
@@ -57,23 +73,6 @@
 import org.jboss.web.tomcat.service.WebCtxLoader;
 import org.omg.CORBA.ORB;
 
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.naming.Context;
-import javax.naming.LinkRef;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLDecoder;
-import java.security.CodeSource;
-import java.security.cert.Certificate;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 /**
  * A tomcat web application deployment.
  * 
@@ -397,28 +396,28 @@
                metaData.setENCLoader(webLoader.getClassLoader());
                Context javaCompCtx = component.getContext();
 //               // Add ORB/UserTransaction
-               ORB orb = null;
-               try
-               {
-                  ObjectName ORB_NAME = new ObjectName("jboss:service=CorbaORB");
-                  orb = (ORB)server.getAttribute(ORB_NAME, "ORB");
-                  // Bind the orb
-                  if (orb != null)
-                  {
-                     NonSerializableFactory.rebind(javaCompCtx, "ORB", orb);
-                     log.debug("Bound java:comp/ORB");
-                  }
-               }
-               catch (Throwable t)
-               {
-                  log.debug("Unable to retrieve orb: " + t.toString());
-               }
-
-               // JTA links
-               javaCompCtx.bind("TransactionSynchronizationRegistry", new LinkRef("java:TransactionSynchronizationRegistry"));
-               log.debug("Linked java:comp/TransactionSynchronizationRegistry to JNDI name: java:TransactionSynchronizationRegistry");
-               javaCompCtx.bind("UserTransaction", new LinkRef("UserTransaction"));
-               log.debug("Linked java:comp/UserTransaction to JNDI name: UserTransaction");
+//               ORB orb = null;
+//               try
+//               {
+//                  ObjectName ORB_NAME = new ObjectName("jboss:service=CorbaORB");
+//                  orb = (ORB)server.getAttribute(ORB_NAME, "ORB");
+//                  // Bind the orb
+//                  if (orb != null)
+//                  {
+//                     NonSerializableFactory.rebind(javaCompCtx, "ORB", orb);
+//                     log.debug("Bound java:comp/ORB");
+//                  }
+//               }
+//               catch (Throwable t)
+//               {
+//                  log.debug("Unable to retrieve orb: " + t.toString());
+//               }
+//
+//               // JTA links
+//               javaCompCtx.bind("TransactionSynchronizationRegistry", new LinkRef("java:TransactionSynchronizationRegistry"));
+//               log.debug("Linked java:comp/TransactionSynchronizationRegistry to JNDI name: java:TransactionSynchronizationRegistry");
+//               javaCompCtx.bind("UserTransaction", new LinkRef("UserTransaction"));
+//               log.debug("Linked java:comp/UserTransaction to JNDI name: UserTransaction");
                //envCtx = envCtx.createSubcontext("env");
                injectionContainer.populateEnc(webLoader.getClassLoader());
 

Modified: branches/JBoss-AS-6.0.x_ipv6/tomcat/src/main/java/org/jboss/web/tomcat/service/session/JBossCacheManager.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/tomcat/src/main/java/org/jboss/web/tomcat/service/session/JBossCacheManager.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/tomcat/src/main/java/org/jboss/web/tomcat/service/session/JBossCacheManager.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -188,14 +188,10 @@
    
    //  ----------------------------------------------------------  Constructors
 
-   public JBossCacheManager() throws ClusteringNotSupportedException
+   public JBossCacheManager()
    {
-      if (defaultFactory == null)
-      {
-         throw new ClusteringNotSupportedException("No DistributedCacheManagerFactory service provider found.");
-      }
-      
-      this.distributedCacheManagerFactory = defaultFactory;
+      // JBAS-8661 Defer throwing ClusteringNotSupportedException until init(...)
+      this(defaultFactory);
    }
    
    public JBossCacheManager(DistributedCacheManagerFactory factory)
@@ -216,6 +212,11 @@
    public void init(String name, JBossWebMetaData webMetaData)
       throws ClusteringNotSupportedException
    {
+      if (this.distributedCacheManagerFactory == null)
+      {
+         throw new ClusteringNotSupportedException("No DistributedCacheManagerFactory service provider found.");
+      }
+      
       super.init(name, webMetaData);
       
       this.replicationConfig_ = webMetaData.getReplicationConfig();

Modified: branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/pom.xml
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/pom.xml	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/pom.xml	2010-11-29 02:39:42 UTC (rev 109527)
@@ -13,14 +13,15 @@
    <description>Weld deployers for JBoss AS</description>
    
    <build>
-     <plugins>
-        <plugin>
-          <artifactId>maven-surefire-plugin</artifactId>
-          <configuration>
-            <skipTests>false</skipTests>
-          </configuration>
-        </plugin>
-   
+       <plugins>
+           <plugin>
+               <artifactId>maven-surefire-plugin</artifactId>
+               <configuration>
+                   <skipTests>false</skipTests>
+                   <!-- use the endorsed directory for tests, we need to use javax.annotations 1.1 -->
+                   <argLine>-Djava.endorsed.dirs="${project.build.directory}/endorsed"</argLine>
+               </configuration>
+           </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
@@ -33,6 +34,32 @@
            </execution>
          </executions>
        </plugin>
+
+        <plugin>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>process-resources</phase>
+            <goals>
+              <goal>copy</goal>
+            </goals>
+            <configuration>
+              <artifactItems>
+                <!-- org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec needs to be
+                in endorsed because Java SE too ships javax.annotation.Resource which doesn't have the
+                lookup() method -->
+                <artifactItem>
+                  <groupId>org.jboss.spec.javax.annotation</groupId>
+                  <artifactId>jboss-annotations-api_1.1_spec</artifactId>
+                  <type>jar</type>
+                  <overWrite>true</overWrite>
+                  <outputDirectory>${project.build.directory}/endorsed</outputDirectory>
+                </artifactItem>
+              </artifactItems>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
      </plugins>
    </build>
    
@@ -486,6 +513,31 @@
         <groupId>org.jboss.ejb3.instantiator</groupId>
         <artifactId>jboss-ejb3-instantiator-impl</artifactId>
     </dependency>
+
+    <dependency>
+        <groupId>org.jboss.metadata</groupId>
+        <artifactId>jboss-metadata-ejb</artifactId>
+        <scope>provided</scope>
+        <exclusions>
+            <exclusion>
+                <groupId>org.jboss.javaee</groupId>
+                <artifactId>jboss-jms-api</artifactId>
+            </exclusion>
+            <exclusion>
+                <groupId>org.jboss.javaee</groupId>
+                <artifactId>jboss-transaction-api</artifactId>
+            </exclusion>
+            <exclusion>
+                <groupId>org.jboss.javaee</groupId>
+                <artifactId>jboss-ejb-api</artifactId>
+            </exclusion>
+        </exclusions>
+    </dependency>
+
+    <dependency>
+        <groupId>org.jboss.spec.javax.annotation</groupId>
+        <artifactId>jboss-annotations-api_1.1_spec</artifactId>
+    </dependency>
     
    </dependencies>
 

Modified: branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/WeldBootstrapDeployer.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/WeldBootstrapDeployer.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/env/WeldBootstrapDeployer.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -151,9 +151,9 @@
       install.addParameterMetaData(Object.class.getName(), bootstrapName);
       install.addParameterMetaData(Iterable.class.getName(), bootstrap.createInject(ejbServicesValue.getUnderlyingValue(), "ejbContainerNames"));
       install.addParameterMetaData(String.class.getName(), "Start");
-      install.addParameterMetaData(String.class.getName(), "Create");
+      install.addParameterMetaData(String.class.getName(), ControllerState.PRE_INSTALL.getStateString());
 
-      ParameterMetaDataBuilder jndiInstall = bootstrap.addInstallWithParameters("bind", "JndiBinder");
+      ParameterMetaDataBuilder jndiInstall = bootstrap.addInstallWithParameters("bind", "JndiBinder", ControllerState.INSTALLED, ControllerState.START);
       jndiInstall.addParameterMetaData(DeploymentUnit.class.getName(), unit);
 
       ParameterMetaDataBuilder jndiUninstall = bootstrap.addUninstallWithParameters("unbind", "JndiBinder");

Modified: branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/jndi/JBossBeanManagerObjectFactory.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/jndi/JBossBeanManagerObjectFactory.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/jndi/JBossBeanManagerObjectFactory.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -40,10 +40,11 @@
    {
       Reference reference = (Reference) o;
       StringRefAddr refAddr = (StringRefAddr) reference.get(JndiBinder.REFADDR_ID);
+      String beanManagerId = (String)refAddr.getContent();
       if (Container.available())
       {
          Container container = Container.instance();
-         String beanManagerId = (String)refAddr.getContent();
+
          for (Map.Entry<BeanDeploymentArchive, BeanManagerImpl> mapElement : container.beanDeploymentArchives().entrySet())
          {
             if (mapElement.getKey().getId().equals(beanManagerId))
@@ -52,6 +53,10 @@
             }
          }
       }
-      throw new NamingException("Cannot resolve BeanManager");
+      else
+      {
+         throw new NamingException("Cannot resolve BeanManager: container not available");
+      }
+      throw new NamingException("Cannot resolve BeanManager for id " + beanManagerId);
    }
 }

Modified: branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/jndi/JavaEEComponentJndiBinderDeployer.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/jndi/JavaEEComponentJndiBinderDeployer.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/jndi/JavaEEComponentJndiBinderDeployer.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -59,60 +59,6 @@
    @Override
    public void deploy(DeploymentUnit deploymentUnit, JBossEnterpriseBeanMetaData jBossEnterpriseBeanMetaData) throws DeploymentException
    {
-      BeanMetaData bbBMD = getBootstrapBeanAttachment(deploymentUnit.getTopLevel());
-      if (bbBMD == null)
-      {
-         return;
-      }
-
-      if (informer.getModuleType(deploymentUnit).equals(org.jboss.reloaded.naming.deployers.javaee.JavaEEModuleInformer.ModuleType.EJB))
-      {
-         if (jBossEnterpriseBeanMetaData instanceof JBossSessionBean31MetaData &&
-               ((JBossSessionBean31MetaData)jBossEnterpriseBeanMetaData).isSingleton())
-         {
-            String containerName = jBossEnterpriseBeanMetaData.getContainerName() == null ?
-                  jBossEnterpriseBeanMetaData.getGeneratedContainerName() :
-                  jBossEnterpriseBeanMetaData.getContainerName();
-
-            BeanMetaData containerBeanMetadata = deploymentUnit.getParent().getAttachment(BeanMetaData.class + ":" + containerName, BeanMetaData.class);
-            BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(containerBeanMetadata);
-            builder.addDependency(getJndiBinderName(deploymentUnit));
-            builder.addDependency(DeployersUtils.getBootstrapBeanName(deploymentUnit));
-         }
-
-         String jndiBinderName = getJndiBinderName(deploymentUnit);
-         BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(jndiBinderName, JavaEEComponentJndiBinder.class.getName());
-         AbstractInjectionValueMetaData javaComponent = new AbstractInjectionValueMetaData(getComponentBeanName(deploymentUnit));
-         builder.addConstructorParameter(JavaEEComponent.class.getName(), javaComponent);
-         builder.addInstall("bindToJavaComp");
-         deploymentUnit.getParent().addAttachment(jndiBinderName, builder.getBeanMetaData());
-      }
    }
 
-   private String getJndiBinderName(DeploymentUnit deploymentUnit)
-   {
-      return getComponentBeanName(deploymentUnit) + "_CompJndiBinder";
-   }
-
-   private BeanMetaData getBootstrapBeanAttachment(DeploymentUnit deploymentUnit)
-   {
-      String bootstrapName = DeployersUtils.getBootstrapBeanName(deploymentUnit.getTopLevel());
-      String bbAttachmentName = bootstrapName + "_" + BeanMetaData.class.getSimpleName();
-
-      BeanMetaData bbBMD = deploymentUnit.getTopLevel().getAttachment(bbAttachmentName, BeanMetaData.class);
-      return bbBMD;
-   }
-
-   private String getComponentBeanName(DeploymentUnit deploymentUnit)
-   {
-      String appName = informer.getApplicationName(deploymentUnit);
-      String moduleName = informer.getModuleName(deploymentUnit);
-      String componentName = informer.getComponentName(deploymentUnit);
-      String name = "jboss.naming:";
-      if(appName != null)
-         name += "application=" + appName + ",";
-      name += "module=" + moduleName + ",component=" + componentName;
-      return name;
-   }
-
 }

Modified: branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/jndi/JndiBinder.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/jndi/JndiBinder.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/jndi/JndiBinder.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -145,7 +145,7 @@
          {
             if (hasJndiBoundBeanManager(unit))
             {
-               String path = JndiUtils.getJndiSubcontexPathtForBeanManager(moduleInformer, unit);
+               String path = JndiUtils.getJndiSubcontexPathForBeanManager(moduleInformer, unit);
                Context subcontext = Util.createSubcontext(rootContext, path);
                Reference reference = new Reference(BeanManager.class.getName(), "org.jboss.weld.integration.deployer.jndi.JBossBeanManagerObjectFactory", null);
                reference.add(new StringRefAddr(REFADDR_ID, IdFactory.getIdFromClassLoader(unit.getClassLoader())));
@@ -179,7 +179,7 @@
          {
             if (hasJndiBoundBeanManager(unit))
             {
-               String path = JndiUtils.getJndiSubcontexPathtForBeanManager(moduleInformer, unit);
+               String path = JndiUtils.getJndiSubcontexPathForBeanManager(moduleInformer, unit);
                Context subcontext = (Context) rootContext.lookup(path);
                subcontext.unbind("BeanManager");
                rootContext.destroySubcontext(path);

Modified: branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/metadata/WeldEjbInterceptorMetadataDeployer.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/metadata/WeldEjbInterceptorMetadataDeployer.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/deployer/metadata/WeldEjbInterceptorMetadataDeployer.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -21,12 +21,16 @@
  */
 package org.jboss.weld.integration.deployer.metadata;
 
+import java.lang.reflect.AnnotatedElement;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Iterator;
 
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.deployer.DeploymentStages;
 import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.metadata.annotation.creator.ejb.InterceptorMetaDataCreator;
+import org.jboss.metadata.annotation.finder.DefaultAnnotationFinder;
 import org.jboss.metadata.ejb.jboss.JBossAssemblyDescriptorMetaData;
 import org.jboss.metadata.ejb.jboss.JBossMetaData;
 import org.jboss.metadata.ejb.spec.AroundInvokeMetaData;
@@ -39,8 +43,10 @@
 import org.jboss.metadata.ejb.spec.InterceptorMetaData;
 import org.jboss.metadata.ejb.spec.InterceptorsMetaData;
 import org.jboss.vfs.VirtualFile;
-import org.jboss.weld.integration.deployer.DeployersUtils;
 
+import org.jboss.weld.integration.ejb.SessionBeanInterceptor;
+import org.jboss.weld.integration.ejb.interceptor.Jsr299BindingsInterceptor;
+
 /**
  * Adds wb custom interceptor to ejb deployments.
  *
@@ -49,10 +55,14 @@
 @SuppressWarnings("deprecation")
 public class WeldEjbInterceptorMetadataDeployer extends WeldAwareMetadataDeployer<JBossMetaData>
 {
-   public static final String INJECTION_INTERCEPTOR_CLASS_NAME = "org.jboss.weld.integration.ejb.SessionBeanInterceptor";
-   public static final String CONTEXT_INTERCEPTOR_CLASS_NAME = "org.jboss.weld.ejb.SessionBeanInterceptor";
-   public static final String BINDINGS_INTERCEPTOR_CLASS_NAME = "org.jboss.weld.integration.ejb.interceptor.Jsr299BindingsInterceptor";
+   private static final Class<SessionBeanInterceptor> INJECTION_INTERCEPTOR_CLASS = SessionBeanInterceptor.class;
+   private static final Class<org.jboss.weld.ejb.SessionBeanInterceptor> CONTEXT_INTERCEPTOR_CLASS = org.jboss.weld.ejb.SessionBeanInterceptor.class;
+   private static final Class<Jsr299BindingsInterceptor> BINDINGS_INTERCEPTOR_CLASS = Jsr299BindingsInterceptor.class;
 
+   public static final String INJECTION_INTERCEPTOR_CLASS_NAME = INJECTION_INTERCEPTOR_CLASS.getName();
+   public static final String CONTEXT_INTERCEPTOR_CLASS_NAME = CONTEXT_INTERCEPTOR_CLASS.getName();
+   public static final String BINDINGS_INTERCEPTOR_CLASS_NAME = BINDINGS_INTERCEPTOR_CLASS.getName();
+
    private InterceptorMetaData injectionIMD;
    private InterceptorMetaData bindingsIMD;
    private InterceptorMetaData contextIMD;
@@ -60,19 +70,25 @@
    private InterceptorBindingMetaData bindingsIBMD;
    private InterceptorBindingMetaData contextIBMD;
 
+   private InterceptorMetaDataCreator interceptorMetaDataCreator;
+
    public WeldEjbInterceptorMetadataDeployer()
    {
       super(JBossMetaData.class, true);
 
+      interceptorMetaDataCreator = new InterceptorMetaDataCreator(new DefaultAnnotationFinder<AnnotatedElement>());
+
+
       addInput("merged." + JBossMetaData.class.getName());
       setStage(DeploymentStages.POST_CLASSLOADER);
 
+      //create and process metadata for JSR299 interceptors
+      InterceptorsMetaData interceptorsMetaData = interceptorMetaDataCreator.create(Arrays.<Class<?>>asList(INJECTION_INTERCEPTOR_CLASS, CONTEXT_INTERCEPTOR_CLASS, BINDINGS_INTERCEPTOR_CLASS));
+
       // create interceptor metadata instance for session beans
-      injectionIMD = new InterceptorMetaData();
-      injectionIMD.setInterceptorClass(INJECTION_INTERCEPTOR_CLASS_NAME);
+      injectionIMD = interceptorsMetaData.get(INJECTION_INTERCEPTOR_CLASS_NAME);
 
-      contextIMD = new InterceptorMetaData();
-      contextIMD.setInterceptorClass(CONTEXT_INTERCEPTOR_CLASS_NAME);
+      contextIMD = interceptorsMetaData.get(CONTEXT_INTERCEPTOR_CLASS_NAME);
 
       if (contextIMD.getAroundInvokes() == null)
       {
@@ -84,8 +100,7 @@
       contextIMD.getAroundInvokes().add(aroundInvokeMetaData);
 
       // create interceptor metadata instance for JSR-299 specific bindings
-      bindingsIMD = new InterceptorMetaData();
-      bindingsIMD.setInterceptorClass(BINDINGS_INTERCEPTOR_CLASS_NAME);
+      bindingsIMD = interceptorsMetaData.get(BINDINGS_INTERCEPTOR_CLASS_NAME);
 
       // create interceptor binding metadata instance
       injectionIBMD = createInterceptorBindingMetadata(INJECTION_INTERCEPTOR_CLASS_NAME);

Modified: branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/injection/Jsr299InjectorDeployer.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/injection/Jsr299InjectorDeployer.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/injection/Jsr299InjectorDeployer.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -46,7 +46,7 @@
    public Jsr299InjectorDeployer()
    {
       super(InjectionManager.class);
-      setStage(DeploymentStages.POST_CLASSLOADER);
+      setStage(DeploymentStages.REAL);
       setOutput(InjectionManager.class);
    }
 
@@ -65,7 +65,6 @@
             Jsr299Injector injector = new Jsr299Injector(IdFactory.getIdFromClassLoader(unit.getClassLoader()));
             BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(getJsr299InjectorMcBeanName(unit), Jsr299Injector.class.getName());
             AbstractInjectionValueMetaData injectionValueMetaData = new AbstractInjectionValueMetaData(DeployersUtils.getBootstrapBeanName(unit));
-            injectionValueMetaData.setInjectionOption(InjectOption.CALLBACK);
             builder.addPropertyMetaData("bootstrapBean", injectionValueMetaData);
             builder.addUninstall("release");
             kernelController.install(builder.getBeanMetaData(), injector);

Modified: branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/instantiator/Jsr299BeanInstantiatorDeployer.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/instantiator/Jsr299BeanInstantiatorDeployer.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/instantiator/Jsr299BeanInstantiatorDeployer.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -55,21 +55,6 @@
       beanMetaDataBuilder.setBean(Jsr299BeanInstantiator.class.getName());
       beanMetaDataBuilder.addPropertyMetaData("bdaId", IdFactory.getIdFromClassLoader(unit.getClassLoader()));
       AbstractInjectionValueMetaData bootstrapBean = new AbstractInjectionValueMetaData(DeployersUtils.getBootstrapBeanName(unit));
-      bootstrapBean.setInjectionOption(InjectOption.CALLBACK);
       beanMetaDataBuilder.addPropertyMetaData("bootstrapBean", bootstrapBean);
-
-      //
-      if (ejb instanceof JBossSessionBean31MetaData &&
-            ((JBossSessionBean31MetaData) ejb).isSingleton())
-      {
-         String containerName = ejb.getContainerName() == null ?
-               ejb.getGeneratedContainerName() :
-               ejb.getContainerName();
-
-         BeanMetaData containerBeanMetadata = unit.getAttachment(BeanMetaData.class + ":" + containerName, BeanMetaData.class);
-         BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(containerBeanMetadata);
-         builder.addDependency(DeployersUtils.getBootstrapBeanName(unit));
-         builder.addDependency(beanMetaDataBuilder.getBeanMetaData().getName());
-      }
    }
 }

Modified: branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/util/JndiUtils.java
===================================================================
--- branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/util/JndiUtils.java	2010-11-28 16:37:14 UTC (rev 109526)
+++ branches/JBoss-AS-6.0.x_ipv6/weld-int/deployer/src/main/java/org/jboss/weld/integration/util/JndiUtils.java	2010-11-29 02:39:42 UTC (rev 109527)
@@ -35,7 +35,7 @@
     */
    public static final String BEAN_MANAGER_GLOBAL_SUBCONTEXT = "cdi";
 
-   public static String getJndiSubcontexPathtForBeanManager(JavaEEModuleInformer moduleInformer, DeploymentUnit unit)
+   public static String getJndiSubcontexPathForBeanManager(JavaEEModuleInformer moduleInformer, DeploymentUnit unit)
    {
       String applicationName = moduleInformer.getApplicationName(unit);
       String path = (applicationName == null) ? "" : (applicationName + "/");
@@ -45,6 +45,8 @@
 
    public static String getGlobalBeanManagerPath(JavaEEModuleInformer moduleInformer, DeploymentUnit unit)
    {
-      return "java:global/" + BEAN_MANAGER_GLOBAL_SUBCONTEXT + "/" + getJndiSubcontexPathtForBeanManager(moduleInformer, unit) + "/BeanManager";
+      DeploymentUnit deploymentUnit = unit.isComponent() ? unit.getParent() : unit;
+      String subcontexPathForBeanManager = getJndiSubcontexPathForBeanManager(moduleInformer, deploymentUnit);
+      return "java:global/" + BEAN_MANAGER_GLOBAL_SUBCONTEXT + "/" + subcontexPathForBeanManager + "/BeanManager";
    }
 }



More information about the jboss-cvs-commits mailing list