[jboss-svn-commits] JBL Code SVN: r19625 - in labs/jbossesb/trunk: product/etc/schemas/xml and 74 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Apr 18 10:22:43 EDT 2008


Author: kevin.conner at jboss.com
Date: 2008-04-18 10:22:42 -0400 (Fri, 18 Apr 2008)
New Revision: 19625

Added:
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/JDBCEprDBResourceFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRConnectionFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierMarshalUnmarshalException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierServiceBindException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierTransportException.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/config-03.1.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/FileUtilUnitTest.java
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/build.xml
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/deployment.xml
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbm-queue-service.xml
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbmq-queue-service.xml
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jboss-esb.xml.first
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jboss-esb.xml.second
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbossesb-properties.xml
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jndi.properties
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/juddi.properties
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/lib/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/listener.log
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/log4j.xml
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/readme.txt
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/resources/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/resources/jboss-service.xml
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/server.properties
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/MyJMSListenerAction.java
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/StringAppender.java
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/SendEsbMessage.java
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/SendJMSMessage.java
   labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/test-out-expected-http-rewrite.wsdl
   labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/OrderProcessingSchema_JBESB-1329.xsd
   labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/OrderProcessing_JBESB-1329.wsdl
   labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/expected_01_JBESB-1329.xml
   labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/expected_02_JBESB-1329.xml
   labs/jbossesb/trunk/qa/base-cp.xml
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/epr/jbm-service.xml
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/epr/jbmq-service.xml
   labs/jbossesb/trunk/qa/lib/ext/test-util.jar
Removed:
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/build.xml
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/deployment.xml
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbm-queue-service.xml
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbmq-queue-service.xml
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jboss-esb.xml.first
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jboss-esb.xml.second
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbossesb-properties.xml
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jndi.properties
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/juddi.properties
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/lib/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/listener.log
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/log4j.xml
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/readme.txt
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/resources/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/resources/jboss-service.xml
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/server.properties
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/MyJMSListenerAction.java
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/StringAppender.java
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/SendEsbMessage.java
   labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/SendJMSMessage.java
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/epr/jms-service.xml
   labs/jbossesb/trunk/qa/lib/ext/javassist.jar
   labs/jbossesb/trunk/qa/lib/ext/jboss-aop-jdk50.jar
   labs/jbossesb/trunk/qa/lib/ext/jboss-messaging-client.jar
   labs/jbossesb/trunk/qa/lib/ext/trove.jar
Modified:
   labs/jbossesb/trunk/product/docs/MessageActionGuide.odt
   labs/jbossesb/trunk/product/docs/ProgrammersGuide.odt
   labs/jbossesb/trunk/product/docs/ReleaseNotes.odt
   labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd
   labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.xsd
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/FileCourier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/HibernateCourier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/JmsComposer.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/lifecycle/LifecycleResourceManager.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JcaMessageAwareListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFiles.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/schedule/ScheduleProvider.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FileUtil.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessorUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultJdbcReplyToEprUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListenerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyQueuesUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyTopicsUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/MockScheduledEventListener.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/SchedulingUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/FileUtil.java
   labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/processDefinition/processdefinition.xml
   labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/readme.txt
   labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_db_registration/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/readme.txt
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/resources/application.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/create.sql
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/readme.txt
   labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/spring_aop/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/spring_helloworld/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/spring_jpetstore/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2POJO2/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_date_manipulation/jboss-esb.xml
   labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_simple/jboss-esb.xml
   labs/jbossesb/trunk/product/services/jbossesb/src/main/java/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStoreImpl.java
   labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouter.java
   labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java
   labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPProcessor.java
   labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WebserviceContractPublisher.java
   labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/JBossWSAdapterContractPublisherUnitTest.java
   labs/jbossesb/trunk/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java
   labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/SoapUIClientServiceMBeanUnitTest.java
   labs/jbossesb/trunk/product/tools/console/management/build.xml
   labs/jbossesb/trunk/qa/build.xml
   labs/jbossesb/trunk/qa/junit/build.xml
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/epr/LogicalEPRUnitTest.java
   labs/jbossesb/trunk/qa/quickstarts/build.xml
   labs/jbossesb/trunk/qa/test.properties
Log:
Merging CP2_2 changes over to trunk: JBESB-1671

Modified: labs/jbossesb/trunk/product/docs/MessageActionGuide.odt
===================================================================
(Binary files differ)

Modified: labs/jbossesb/trunk/product/docs/ProgrammersGuide.odt
===================================================================
(Binary files differ)

Modified: labs/jbossesb/trunk/product/docs/ReleaseNotes.odt
===================================================================
(Binary files differ)

Modified: labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd
===================================================================
--- labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd	2008-04-18 14:22:42 UTC (rev 19625)
@@ -808,7 +808,7 @@
 				</xsd:annotation>
 			</xsd:attribute>
 			<xsd:attribute name="input-suffix" type="xsd:string"
-				use="required">
+				use="optional">
 				<xsd:annotation>
 					<xsd:documentation xml:lang="en">
 						The file suffix used to filter files targeted

Modified: labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.xsd
===================================================================
--- labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.xsd	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.xsd	2008-04-18 14:22:42 UTC (rev 19625)
@@ -282,7 +282,7 @@
 			<xsd:attribute name="directory" use="required" type="xsd:string">
 				<xsd:annotation><xsd:documentation xml:lang="en">The file share that is monitored for incoming new files.</xsd:documentation></xsd:annotation>
 			</xsd:attribute>
-			<xsd:attribute name="input-suffix" use="required" type="xsd:string">
+			<xsd:attribute name="input-suffix" use="optional" type="xsd:string">
 				<xsd:annotation><xsd:documentation xml:lang="en">The file suffix used to filter files targeted for comsumption by the ESB (note: add the dot, so something like '.esbIn').</xsd:documentation></xsd:annotation>
 			</xsd:attribute>
 			<xsd:attribute name="work-suffix" use="optional" type="xsd:string" default=".esbInProcess">

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/FileCourier.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/FileCourier.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/FileCourier.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -23,6 +23,7 @@
 package org.jboss.internal.soa.esb.couriers;
 
 import java.io.File;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.lang.reflect.Method;
 import java.net.MalformedURLException;
@@ -43,6 +44,9 @@
 import org.jboss.soa.esb.common.Environment;
 import org.jboss.soa.esb.common.ModulePropertyManager;
 import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierTransportException;
+import org.jboss.soa.esb.couriers.CourierServiceBindException;
+import org.jboss.soa.esb.couriers.CourierMarshalUnmarshalException;
 import org.jboss.soa.esb.couriers.CourierTimeoutException;
 import org.jboss.soa.esb.couriers.CourierUtil;
 import org.jboss.soa.esb.listeners.message.errors.Factory;
@@ -176,7 +180,7 @@
 		FileHandler handler = (null != _localFhandler) ? _localFhandler
 				: FileHandlerFactory.getInstance().getFileHandler(_epr);
 		if (null == handler)
-			throw new CourierException(
+			throw new CourierServiceBindException(
 					"Can't find appropriate file handler for "
 							+ _url.toString());
 
@@ -210,16 +214,22 @@
 
 				return true;
 			}
-			catch (IOException e)
+			catch (final CourierException e)
 			{
-				throw new CourierException(e);
+			    throw new CourierTransportException(e);
 			}
-			catch (ParserConfigurationException e)
+			catch (final IOException e)
 			{
+				throw new CourierMarshalUnmarshalException(e);
+			}
+			catch (final ParserConfigurationException e)  // it's no longer thrown so we can ignore it!
+			{
 				throw new CourierException(e);
 			}
 		}
 
+		tmpFile = null;
+		
 		try
 		{
 			Method upload = handler.getClass().getMethod("uploadFile",
@@ -244,10 +254,15 @@
 			{ messageFile });
 			return true;
 		}
-		catch (Exception e)
+		catch (final IOException ex)
 		{
-			e.printStackTrace();
-			
+		    if (tmpFile == null)
+			throw new CourierMarshalUnmarshalException(ex);
+		    else
+			throw new CourierTransportException(ex);
+		}
+		catch (final Exception e)
+		{
 			throw new CourierException(e);
 		}
 		finally
@@ -280,8 +295,10 @@
 				{
 					result = readOneMessage(handler, work);
 				}
-				catch (Exception e)
+				catch (CourierException e)
 				{
+				    _logger.debug("FileCourier.pickup caught exception during readOneMessage: "+e);
+				    
 					if (null == errorFile(input))
 						handler.deleteFile(work);
 					else
@@ -328,8 +345,20 @@
 			{
 				return CourierUtil.messageFromLocalFile(work);
 			}
-			catch (Exception ex)
+			catch (final FileNotFoundException ex)
 			{
+			    throw new CourierTransportException(ex);
+			}
+			catch (final IOException ex)
+			{
+			    throw new CourierMarshalUnmarshalException(ex);
+			}
+			catch (final CourierException ex)
+			{
+			    throw ex;
+			}
+			catch (final Exception ex)
+			{
 				throw new CourierException(ex);
 			}
 		}
@@ -344,9 +373,21 @@
 			{ work });
 			return CourierUtil.messageFromLocalFile(tmpFile);
 		}
+		catch (FileNotFoundException ex)
+		{
+		    throw new CourierTransportException(ex);
+		}
+		catch (IOException ex)
+		{
+		    throw new CourierTransportException(ex);
+		}
+		catch (final CourierException ex)
+		{
+		    throw ex;
+		}
 		catch (Exception e)
 		{
-			throw new CourierException(e);
+			throw new CourierTransportException(e);
 		}
 		finally
 		{

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/HibernateCourier.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/HibernateCourier.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/HibernateCourier.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -28,6 +28,7 @@
 import org.apache.log4j.Logger;
 import org.hibernate.Query;
 import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
 import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
 import org.jboss.soa.esb.couriers.CourierException;
 import org.jboss.soa.esb.couriers.CourierTimeoutException;
@@ -85,13 +86,18 @@
 	 * @throws CourierException -
 	 *             if problems were encountered
 	 */
-	public boolean deliver(Message message) throws CourierException {
+	public boolean deliver(Message message) throws CourierException, MalformedEPRException {
 		if (m_isReceiver)
 			throw new CourierException("This is a read-only Courier");
 
 		if (null == message)
 			return false;
 
+		/*
+		 * This method doesn't really do anything about delivering
+		 * the message. And pickup doesn't return a message either.
+		 */
+		
 		Call call = message.getHeader().getCall();
 		if (null==call)
 			message.getHeader().setCall(call=new Call());
@@ -99,7 +105,7 @@
 			if (null == call.getMessageID())
 				call.setMessageID(new URI(UUID.randomUUID().toString()));
 		} catch (URISyntaxException e) {
-			throw new CourierException("Problems with message header ",e);
+			throw new MalformedEPRException("Problems with message header ",e);
 		}
 
 		return false;

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -47,7 +47,10 @@
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.addressing.MalformedEPRException;
 import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.couriers.CourierTransportException;
 import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierServiceBindException;
+import org.jboss.soa.esb.couriers.CourierMarshalUnmarshalException;
 import org.jboss.soa.esb.couriers.CourierTimeoutException;
 import org.jboss.soa.esb.helpers.KeyValuePair;
 import org.jboss.soa.esb.helpers.NamingContextException;
@@ -152,11 +155,11 @@
             try {
                 jmsSession = getConnectionPool().getSession(acknowledgeMode);
             } catch (NamingException e) {
-                throw new CourierException("Failed to get JMS Session from pool.", e);
+                throw new CourierServiceBindException("Failed to get JMS Session from pool.", e);
             } catch (JMSException e) {
-                throw new CourierException("Failed to get JMS Session from pool.", e);
+                throw new CourierServiceBindException("Failed to get JMS Session from pool.", e);
             } catch (ConnectionException e) {
-                throw new CourierException("Failed to get JMS Session from pool.", e);
+                throw new CourierServiceBindException("Failed to get JMS Session from pool.", e);
             }
         }
         return jmsSession;
@@ -182,7 +185,7 @@
                 try {
                     createMessageProducer();
                 } catch (final NamingContextException nce) {
-                    throw new CourierException("Unexpected exception attempting to access naming context pool", nce) ;
+                    throw new CourierServiceBindException("Unexpected exception attempting to access naming context pool", nce) ;
                 }
             }
         }
@@ -191,18 +194,18 @@
         try {
             msg = getJmsSession(_epr.getAcknowledgeMode()).createObjectMessage(Util.serialize(message));
         } catch (JMSException e) {
-            throw new CourierException("Failed to serialize ESB Message.", e);
+            throw new CourierMarshalUnmarshalException("Failed to serialize ESB Message.", e);
         } catch (ParserConfigurationException e) {
-            throw new CourierException("Failed to serialize ESB Message.", e);
+            throw new CourierMarshalUnmarshalException("Failed to serialize ESB Message.", e);
         } catch (IOException e) {
-            throw new CourierException("Failed to serialize ESB Message.", e);
+            throw new CourierMarshalUnmarshalException("Failed to serialize ESB Message.", e);
         }
 
         // Set the JMS message from the ESB message...
         try {
             setJMSProperties(message, msg);
         } catch (JMSException e) {
-            throw new CourierException("Failed to set JMS Message properties from ESB Message properties.", e);
+            throw new CourierMarshalUnmarshalException("Failed to set JMS Message properties from ESB Message properties.", e);
         }
 
         return deliver(msg);
@@ -229,7 +232,7 @@
                 try {
                     createMessageProducer();
                 } catch (final NamingContextException nce) {
-                    throw new CourierException("Unexpected exception attempting to access naming context pool", nce) ;
+                    throw new CourierServiceBindException("Unexpected exception attempting to access naming context pool", nce) ;
                 }
             }
         }
@@ -250,7 +253,7 @@
                 }
                 catch (JMSException e) {
                     if (!jmsConnectRetry(e))
-                        throw new CourierException("Caught exception during delivery and could not reconnect! ",e);
+                        throw new CourierTransportException("Caught exception during delivery and could not reconnect! ",e);
                 }
                 catch (Exception e) {
                     throw new CourierException(e);
@@ -298,13 +301,13 @@
                     } else {
                         _logger.debug("Failed to reconnect to JMS", e);
                         
-                        return false ;
+                        return false;
                     }
                 }
             }
         }
         
-        return true ;
+        return true;
     } // ________________________________
 
     private void createMessageProducer() throws CourierException, NamingContextException {
@@ -429,10 +432,10 @@
                 }
                 catch (JMSException e) {
                     if (!jmsConnectRetry(e))
-                        throw new CourierException("Caught exception during receive and could not reconnect! ",e);
+                        throw new CourierTransportException("Caught exception during receive and could not reconnect! ",e);
                 }
                 catch (Exception e) {
-                    throw new CourierException(e);
+                    throw new CourierTransportException(e);
                 }
             }
         }

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -22,36 +22,40 @@
 
 package org.jboss.internal.soa.esb.couriers;
 
-import java.io.Serializable;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.UUID;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.sql.DataSource;
-
 import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.couriers.helpers.JDBCEprDBResourceFactory;
 import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
 import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
 import org.jboss.soa.esb.common.TransactionStrategy;
 import org.jboss.soa.esb.common.TransactionStrategyException;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierTimeoutException;
-import org.jboss.soa.esb.helpers.persist.JdbcCleanConn;
-import org.jboss.soa.esb.helpers.persist.SimpleDataSource;
+import org.jboss.soa.esb.couriers.*;
 import org.jboss.soa.esb.listeners.message.errors.Factory;
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.message.util.Type;
 import org.jboss.soa.esb.util.Util;
-import org.xml.sax.SAXParseException;
 
+import java.io.Serializable;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.UUID;
+
 public class SqlTableCourier implements PickUpOnlyCourier, DeliverOnlyCourier
 {
+    protected long _pollLatency = 200;
+
+    protected long _sleepForRetries = 3000; // milliseconds
+
+    protected boolean deleteOnSuccess, deleteOnError;
+	protected boolean _isReceiver;
+
+    private JDBCEprDBResourceFactory jdbcFactory;
+
+	protected static Logger _logger = Logger.getLogger(SqlTableCourier.class);
+
 	/**
 	 * package protected constructor - Objects of Courier should only be
 	 * instantiated by the Factory
@@ -61,7 +65,7 @@
 	SqlTableCourier(JDBCEpr epr) throws CourierException
 	{
 		this(epr, false);
-	}
+    }
 
 	/**
 	 * package protected constructor - Objects of Courier should only be
@@ -72,13 +76,12 @@
 	SqlTableCourier(JDBCEpr epr, boolean isReceiver) throws CourierException
 	{
 		_isReceiver = isReceiver;
-		_epr = epr;
 		_sleepForRetries = 3000;  // TODO magic number - configurable?
 		try
 		{
-			_postDelete = Boolean.TRUE.equals(Boolean.valueOf(epr
+			deleteOnSuccess = Boolean.TRUE.equals(Boolean.valueOf(epr
 					.getPostDelete()));
-			_errorDelete = Boolean.TRUE.equals(Boolean.valueOf(epr
+			deleteOnError = Boolean.TRUE.equals(Boolean.valueOf(epr
 					.getErrorDelete()));
 		}
 		catch (URISyntaxException e)
@@ -86,25 +89,12 @@
 			throw new CourierException(e);
 		}
 
-	} // ________________________________
+        jdbcFactory = new JDBCEprDBResourceFactory(epr);
+	}
 
-	public void cleanup()
-	{
-		if (null != _conn)
-		{
-			try
-			{
-				_conn.release();
-			}
-			catch (Exception e)
-			{
-				e.printStackTrace();
-				_logger.info("Unable to release connection", e);
-			}
-		}
+	public void cleanup() {
+	}
 
-	} // ________________________________
-
 	/**
 	 * package the ESB message in a java.io.Serializable, and write it.
 	 * Delivery occurs within its own transaction if there is no
@@ -125,7 +115,7 @@
 		if (null == message)
 			return false;
 
-		String msgId = null;
+		String msgId;
 		Call call = message.getHeader().getCall();
 		if (null==call)
 			message.getHeader().setCall(call=new Call());
@@ -140,559 +130,277 @@
 			throw new CourierException("Problems with message header ",e);
 		}
 
-		try
-		{
-        		TransactionStrategy txStrategy = TransactionStrategy.getTransactionStrategy(true);
-        		Object txHandle = ((txStrategy == null) ? null : txStrategy.getTransaction());
-        		boolean isActive = ((txStrategy == null) ? false : txStrategy.isActive());
-        		
-        		transactional = (txHandle != null);
-        		
-        		/*
-        		 * Make sure the current transaction is still active! If we
-        		 * have previously slept, then the timeout may be longer than that
-        		 * associated with the transaction.
-        		 */
-        		
-        		if (transactional && !isActive)
-        		{
-        			throw new CourierException("Associated transaction is no longer active!");
-        		}
-		}
-		catch (TransactionStrategyException ex)
-		{
-		    throw new CourierException(ex);
-		}
-		
-		if (null == _conn)
-		{
-			try
-			{
-				_conn = getConn();
-			}
-			catch (Exception e)
-			{
-				throw new CourierException(e);
-			}
-		}
+        boolean transactional = isTransactional();
 
-		while (_conn != null)
-		{
-			try
-			{
-				int iCol = 1;
-				PreparedStatement PS = insertStatement();
-				PS.setString(iCol++, msgId);
-				PS.setObject(iCol++, Util.serialize(message));
-				PS.setString(iCol++, State.Pending.getColumnValue());
-				PS.setLong(iCol++, System.currentTimeMillis());
+        Serializable serilaizedMessage;
+        try {
+            serilaizedMessage = Util.serialize(message);
+        } catch (Exception e) {
+            throw new CourierTransportException("Unable to serialize ESB Message.", e);
+        }
 
-				_conn.execUpdWait(PS, 3);
-				
-				if (!transactional)
-				    _conn.commit();
-				
-				return true;
-			}
-			catch (SQLException e)
-			{
-				if (null != _conn)
-				{
-					try
-					{
-					    if (!transactional)
-						_conn.rollback();
-					}
-					catch (Exception roll)
-					{
-						_logger.debug(roll);
-					}
-				}
-				
-				_logger.debug("SQL exception during deliver", e);
-				throw new CourierException(e);
-			}
-			catch (Exception e)
-			{
-				jdbcConnectRetry(e);
-			}
-		}
-		return false;
-	} // ________________________________
+        Connection connection = jdbcFactory.createConnection(transactional);
+        try
+        {
+            PreparedStatement insertStatement = jdbcFactory.createInsertStatement(connection);
+            try {
+                insertStatement.setString(1, msgId);
+                insertStatement.setObject(2, serilaizedMessage);
+                insertStatement.setString(3, State.Pending.getColumnValue());
+                insertStatement.setLong(4, System.currentTimeMillis());
 
-	public Message pickup(long millis) throws CourierException, CourierTimeoutException
-	{
-		Message result = null;
-		long limit = System.currentTimeMillis()
-				+ ((millis < 100) ? 100 : millis);
-		
-		do
-		{
-			try
-			{
-				TransactionStrategy txStrategy = TransactionStrategy.getTransactionStrategy(true);
-				Object txHandle = ((txStrategy == null) ? null : txStrategy.getTransaction());
-				boolean isActive = ((txStrategy == null) ? false : txStrategy.isActive());
-				
-				transactional = (txHandle != null);
-				
-				/*
-				 * Make sure the current transaction is still active! If we
-				 * have previously slept, then the timeout may be longer than that
-				 * associated with the transaction.
-				 */
-				
-				/*
-				 * MessageAwareListener will catch exceptions and roll back the transaction.
-				 */
-				
-				if (transactional && !isActive)
-				{
-					throw new CourierException("Associated transaction is no longer active!");
-				}
-			}
-			catch (TransactionStrategyException ex)
-			{
-				_logger.error("Could not determine transaction association!", ex);
-				
-				throw new CourierException("Could not determine transaction association!");
-			}
-			
-			ResultSet RS = null;
-			
-			try
-			{
-			    RS = getRowList();
+                insertStatement.executeUpdate();
+            } finally {
+                insertStatement.close();
+            }
 
-			    while (null != RS && RS.next())
-			    {
-				String messageId = RS.getString(1);
+            if (!transactional) {
+                connection.commit();
+            }
 
-				if (null == (result = tryToPickup(messageId)))
-				    continue;
+            return true;
+        }
+        catch (SQLException e)
+        {
+            try
+            {
+                if (!transactional) {
+                    connection.rollback();
+                }
+            }
+            catch (Exception roll)
+            {
+                _logger.debug(roll);
+            }
 
-				/*
-				 * If this is fault message, then throw an exception with the contents. With the
-				 * exception of user-defined exceptions, faults will have nothing in the body, properties etc.
-				 */
-
-				if (Type.isFaultMessage(result))
-				    Factory.createExceptionFromFault(result);
-
-				return result;
-			    }
-			}
-			catch (SQLException e)
-			{
-			    _logger.debug("SQL Exception during pickup", e);
-			    return null;
-			}
-			finally
-			{
-			    try
-			    {
-        			    if (RS != null)
-        				RS.close();
-			    }
-			    catch (final SQLException ex)
-			    {
-				_logger.warn("SQLException during close of ResultSet.", ex);
-			    }
-			    
-			    // Added to make sure we release transactions from all paths
-			    if (_conn != null)
-			    {
-				try
-				{
-				    if (!transactional)
-					_conn.rollback() ;
-				}
-				catch (final SQLException sqle) {} //ignore
-			    }
-			}
-			
-			try
-			{
-			    long lSleep = limit - System.currentTimeMillis();
-			    if (_pollLatency < lSleep)
-				lSleep = _pollLatency;
-			    if (lSleep > 0)
-				Thread.sleep(lSleep);
-			}
-			catch (InterruptedException e)
-			{
-			    return null;
-			}
-		} while (System.currentTimeMillis() <= limit);
-		return null;
-	} // ________________________________
-
-	private Message tryToPickup(String messageId) throws CourierException,
-			SQLException
-	{
-		int iParm = 1;
-
-		select4UpdateStatement().setString(iParm++, messageId);
-		select4UpdateStatement().setString(iParm++,
-				State.Pending.getColumnValue());
-
-		while (_conn != null)
-		{
-		    ResultSet RS = null;
-		    
-			try
-			{
-				RS = _conn.execQueryWait(select4UpdateStatement(), 3);
-				
-				while (RS.next())
-				{
-					Exception eBad = null;
-					try
-					{
-						Message result = Util.deserialize((Serializable) RS
-								.getObject(1));
-						if (_postDelete)
-							deleteMsg(messageId);
-						else
-							changeStatus(messageId, State.Done);
-						return result;
-					}
-					catch (ClassCastException e)
-					{
-						eBad = e;
-					}
-					catch (SAXParseException e)
-					{
-						eBad = e;
-					}
-					catch (Exception e)
-					{
-						throw new CourierException(e);
-					}
-					if (null != eBad)
-					{
-						if (_errorDelete)
-							deleteMsg(messageId);
-						else
-							changeStatus(messageId, State.Error);
-						continue;
-					}
-				}
-				return null;
-			}
-			catch (SQLException e)
-			{
-				throw new CourierException(e);
-			}
-			catch (Exception ex)
-			{
-				jdbcConnectRetry(ex);
-			}
-			finally
-			{
-			    try
-			    {
-				if (RS != null)
-				    RS.close();
-			    }
-			    catch (final Exception ex)
-			    {
-				_logger.warn("Could not close ResultSet.", ex);
-			    }
-			}
-		}
-		return null;
-	} // ________________________________
-
-	private void deleteMsg(String messageId) throws SQLException
-	{
-		int iParm = 1;
-		deleteStatement().setString(iParm++, messageId);
-		_conn.execUpdWait(deleteStatement(), 3);
-		
-		if (!transactional)
-			_conn.commit();
+            _logger.debug("SQL exception during deliver", e);
+            throw new CourierTransportException(e);
+        } finally {
+            try {
+                if (!transactional) {
+                    connection.close();
+                }
+            } catch (SQLException e) {
+                _logger.error("Exception while closing DataSource connection.", e);
+            }
+        }
 	}
 
-	private void changeStatus(String messageId, State to) throws SQLException
+    public Message pickup(long millis) throws CourierException, CourierTimeoutException
 	{
-		int iParm = 1;
-		updateStatusStatement().setString(iParm++, to.getColumnValue());
-		updateStatusStatement().setString(iParm++, messageId);
-		_conn.execUpdWait(updateStatusStatement(), 3);
-		
-		if (!transactional)
-			_conn.commit();
-	}
+		Message result = null;
+		long limit = System.currentTimeMillis()
+				+ ((millis < 100) ? 100 : millis);
 
-	private ResultSet getRowList() throws CourierException
-	{
-		if (null == _conn)
+		do
 		{
-			try
-			{
-				_conn = getConn();
-			}
-			catch (Exception e)
-			{
-				throw new CourierException(e);
-			}
-		}
-		while (_conn != null)
-		{
-			try
-			{
-				return _conn.execQueryWait(listStatement(), 3);
-			}
-			catch (Exception e)
-			{
-				_logger.debug("Problem encountered while executing query.", e);
-				e.printStackTrace();
-				
-				jdbcConnectRetry(e);
-			}
-		}
-		return null;
+            boolean transactional = isTransactional();
+            Connection connection = jdbcFactory.createConnection(transactional);
+            try {
+                PreparedStatement listStatement = jdbcFactory.createListStatement(connection);
+                try {
+                    ResultSet resultSet = listStatement.executeQuery();
+                    try {
+                        while (resultSet.next()) {
+                            String messageId = resultSet.getString(1);
 
-	} // _______________________________
+                            result = tryToPickup(messageId, connection);
 
-	private void jdbcConnectRetry(Exception exc)
-	{
-		_logger.debug("DB problem, will try to reconnect", exc);
-		
-		cleanup();
-		_conn = null;
+                            // We've successfully picked up a message, so we can commit on a
+                            // non-transacted connection...
+                            if (!transactional) {
+                                connection.commit();
+                            }
 
-		_prepDelete = _prepGetList = _prepInsert = _prepSel4Upd = _prepUpdateStatus = null;
-		for (int i1 = 0; i1 < 3; i1++)
-		{
-			try
-			{
-				_conn = getConn();
-			}
-			catch (Exception e)
-			{
-				try
-				{
-					Thread.sleep(_sleepForRetries);
-				}
-				catch (InterruptedException eInt)
-				{
-					return;
-				}
-			}
-		}
-	} // ________________________________
+                            if (result != null) {
+                                /*
+                                 * If this is fault message, then throw an exception with the contents. With the
+                                 * exception of user-defined exceptions, faults will have nothing in the body, properties etc.
+                                 */
+                                if (Type.isFaultMessage(result)) {
+                                    Factory.createExceptionFromFault(result);
+                                } else {
+                                    return result;
+                                }
+                            }
+                        }
+                    } finally {
+                        try {
+                            resultSet.close();
+                        } catch (Exception e) {
+                            _logger.warn("SQL Exception closing ResultSet", e);
+                        }
+                    }
+                } finally {
+                    try {
+                        listStatement.close();
+                    } catch (Exception e) {
+                        _logger.warn("SQL Exception closing PreparedStatement", e);
+                    }
+                }
+            } catch (FaultMessageException e) {
+                // The picked up message was a fault, generating this exception
+                // in Factory.createExceptionFromFault.  Just rethrow...
+                throw e;
+            } catch (Exception e) {
+                _logger.warn("Exception during pickup", e);
+                if (!transactional) {
+                    try {
+                        connection.rollback();
+                    } catch (SQLException e1) {
+                        _logger.warn("SQL Exception during rollback", e);
+                    }
+                }
+                throw new CourierTransportException(e);
+            } finally {
+                try {
+                    connection.close();
+                } catch (SQLException e) {
+                    _logger.warn("Error closing DataSource Connection.", e);
+                }
+            }
 
-	private JdbcCleanConn getConn() throws SQLException, MalformedEPRException, NamingException
-	{
-		if (null == _conn)
-		{
-			try
-			{
-				DataSource DS = null;
-				if (_epr.getDatasource() == null) {
-					DS = new SimpleDataSource(_epr.getDriver(), 
-						_epr.getURL(), _epr.getUserName(), _epr.getPassword());
-				} else {
-					InitialContext initContext;
-					try {
-						initContext = new InitialContext();
-						DS = (DataSource) initContext.lookup(_epr.getDatasource());
-					} catch (NamingException e) {
-						_logger.error("Problem resolving DataSource through JNDI", e);
-						
-						throw e; // it'll get wrapped later anyway!
-					}
-				}
-				_conn = new JdbcCleanConn(DS, transactional);
-			}
-			catch (URISyntaxException ex)
-			{
-				throw new MalformedEPRException(ex);
-			}
-		}
-		return _conn;
-	} // ________________________________
+            try {
+                long lSleep = limit - System.currentTimeMillis();
+                if (_pollLatency < lSleep)
+                    lSleep = _pollLatency;
+                if (lSleep > 0)
+                    Thread.sleep(lSleep);
+            }
+            catch (InterruptedException e) {
+                return null;
+            }
+        } while (System.currentTimeMillis() <= limit);
 
-	protected PreparedStatement listStatement() throws SQLException
-	{
-		if (null == _prepGetList)
-		{
-			try
-			{
-				String[] columns =
-				{ _epr.getMessageIdColumn(), _epr.getTimestampColumn() };
+        return null;
+    }
 
-				StringBuilder sb = new StringBuilder("select");
-				int i1 = 0;
-				for (String col : columns)
-					sb.append((i1++ < 1) ? " " : ",").append(col);
-				sb.append(" from ").append(_epr.getTableName());
-				sb.append(" where ").append(_epr.getStatusColumn())
-						.append("='").append(State.Pending.getColumnValue())
-						.append("'").append(" order by 2");
-				_prepGetList = getConn().prepareStatement(sb.toString());
-			}
-			catch (SQLException ex)
-			{
-				throw ex;
-			}
-			catch (Exception e)
-			{
-				e.printStackTrace();
-				_logger.debug("Unable to prepare SQL statement", e);
-				throw new SQLException("Problem encountered when trying to created PreparedStatement: "+e);
-			}
-		}
-		
-		return _prepGetList;
-	} // ________________________________
-
-	protected PreparedStatement select4UpdateStatement()
+    private Message tryToPickup(String messageId, Connection connection) throws CourierException, SQLException
 	{
-		if (_prepSel4Upd == null)
-		{
-			try
-			{
-				/*
-				 * TODO make this dynamic using a factory pattern.
-				 */
+        PreparedStatement selectUpdateStatement = jdbcFactory.createSelect4UpdateStatement(connection);
 
-				StringBuilder sb = null;
+        try {
+            selectUpdateStatement.setString(1, messageId);
+            selectUpdateStatement.setString(2, State.Pending.getColumnValue());
 
-				if (!_epr.getURL().contains("hsqldb"))
-				{
-					sb = new StringBuilder("select ").append(
-							_epr.getDataColumn()).append(" from ").append(
-							_epr.getTableName()).append(" where ").append(
-							_epr.getMessageIdColumn()).append("=?").append(
-							" and ").append(_epr.getStatusColumn())
-							.append("=?").append(" for update");
-				}
-				else
-				{
-					/*
-					 * HSQL does not support FOR UPDATE! All tables appear to
-					 * be inherently updatable!
-					 */
-					
-					sb = new StringBuilder("select ").append(
-							_epr.getDataColumn()).append(" from ").append(
-							_epr.getTableName()).append(" where ").append(
-							_epr.getMessageIdColumn()).append("=?").append(
-							" and ").append(_epr.getStatusColumn())
-							.append("=?");
-				}
+            ResultSet resultSet = selectUpdateStatement.executeQuery();
+            try
+            {
+                if (resultSet.next())
+                {
+                    Message result = null;
 
-				_prepSel4Upd = getConn().prepareStatement(sb.toString());
-			}
-			catch (Exception e)
-			{
-				_logger.debug(e);
-				return null;
-			}
-		}
+                    try
+                    {
+                        Serializable blob = (Serializable) resultSet.getObject(1);
+                        result = Util.deserialize(blob);
+                    }
+                    catch (Exception e)
+                    {
+                        // If there's an error deserializing the message blob, we either
+                        // delete the message (deleteOnError), or change it's state
+                        // to "State.Error" i.e. no exceptions/rollbacks...
+                        result = null;
+                    } finally {
+                        if (result == null && deleteOnError) {
+                            deleteMsg(messageId, connection);
+                        } else if (result != null && deleteOnSuccess) {
+                            deleteMsg(messageId, connection);
+                        } else if(result == null) {
+                            changeStatus(messageId, State.Error, connection);
+                        } else {
+                            changeStatus(messageId, State.Done, connection);
+                        }
+                    }
 
-		return _prepSel4Upd;
-	} // ________________________________
+                    return result;
+                }
+            }
+            finally
+            {
+                try
+                {
+                    resultSet.close();
+                } catch (final Exception ex) {
+                    _logger.warn("Could not close ResultSet.", ex);
+                }
+            }
+        } finally {
+            selectUpdateStatement.close();
+        }
 
-	protected PreparedStatement updateStatusStatement()
-	{
-		if (null == _prepUpdateStatus)
-			try
-			{
-				StringBuilder sb = new StringBuilder("update ").append(
-						_epr.getTableName()).append(" set ").append(
-						_epr.getStatusColumn()).append("= ?").append(" where ")
-						.append(_epr.getMessageIdColumn()).append("=?");
-				_prepUpdateStatus = getConn().prepareStatement(sb.toString());
-			}
-			catch (Exception e)
-			{
-				_logger.debug(e);
-				return null;
-			}
-		return _prepUpdateStatus;
-	} // ________________________________
+        return null;
+	}
 
-	protected PreparedStatement insertStatement()
+    private void deleteMsg(String messageId, Connection connection) throws SQLException
 	{
-		if (null == _prepInsert)
-			try
-			{
-				String[] columns =
-				{ _epr.getMessageIdColumn(), _epr.getDataColumn(),
-						_epr.getStatusColumn(), _epr.getTimestampColumn() };
+        PreparedStatement statement = jdbcFactory.createDeleteStatement(connection);
 
-				StringBuilder sb = new StringBuilder("insert into ").append(
-						_epr.getTableName()).append("(");
-				int i1 = 0;
-				for (String col : columns)
-					sb.append((i1++ < 1) ? " " : ",").append(col);
-				sb.append(") values (?,?,?,?)");
-				_prepInsert = getConn().prepareStatement(sb.toString());
-			}
-			catch (Exception e)
-			{
-				_logger.debug(e);
-				return null;
-			}
-		return _prepInsert;
-	} // ________________________________
+        try {
+            statement.setString(1, messageId);
+            statement.executeUpdate();
+        }   finally {
+            statement.close();
+        }
+    }
 
-	protected PreparedStatement deleteStatement()
+    private void changeStatus(String messageId, State to, Connection connection) throws SQLException
 	{
-		if (null == _prepDelete)
-			try
-			{
-				StringBuilder sb = new StringBuilder("delete from ").append(
-						_epr.getTableName()).append(" where ").append(
-						_epr.getMessageIdColumn()).append(" =?");
-				_prepDelete = getConn().prepareStatement(sb.toString());
-			}
-			catch (Exception e)
-			{
-				_logger.debug(e);
-				return null;
-			}
-		return _prepDelete;
-	} // ________________________________
+        PreparedStatement statement = jdbcFactory.createUpdateStatusStatement(connection);
 
-	protected enum State
+        try {
+            statement.setString(1, to.getColumnValue());
+            statement.setString(2, messageId);
+            statement.executeUpdate();
+        } finally {
+            statement.close();
+        }
+    }
+
+    public static enum State
 	{
 		Pending, WorkInProgress, Done, Error;
-		String getColumnValue()
+
+        public String getColumnValue()
 		{
 			return toString().substring(0, 1);
 		}
-	}
 
-	public void setPollLatency(Long millis)
+    }
+
+    public void setPollLatency(Long millis)
 	{
 		if (millis <= 200)
 			_logger.warn("Poll latency must be >= 200 milliseconds - Keeping old value of "+_pollLatency);
 		else
 			_pollLatency = millis;
-	} // ________________________________
-	
-	protected long _pollLatency = 200;
-	protected long _sleepForRetries = 3000; // milliseconds
+	}
 
-	protected boolean _postDelete, _errorDelete;
-	protected boolean _isReceiver;
+    private boolean isTransactional() throws CourierException {
+        boolean transactional;
+        try
+        {
+            TransactionStrategy txStrategy = TransactionStrategy.getTransactionStrategy(true);
+            Object txHandle = ((txStrategy == null) ? null : txStrategy.getTransaction());
+            boolean isActive = ((txStrategy == null) ? false : txStrategy.isActive());
 
-	protected JDBCEpr _epr;
+            transactional = (txHandle != null);
 
-	protected JdbcCleanConn _conn;
+            /*
+            * Make sure the current transaction is still active! If we
+            * have previously slept, then the timeout may be longer than that
+            * associated with the transaction.
+            */
 
-	protected PreparedStatement _prepGetList;
-	protected PreparedStatement _prepSel4Upd;
-	protected PreparedStatement _prepUpdateStatus;
-	protected PreparedStatement _prepInsert;
-	protected PreparedStatement _prepDelete;
-	
-	private boolean transactional = false;
-
-	protected static Logger _logger = Logger.getLogger(SqlTableCourier.class);
+            if (transactional && !isActive)
+            {
+                throw new CourierException("Associated transaction is no longer active!");
+            }
+        }
+        catch (TransactionStrategyException ex)
+        {
+            throw new CourierException(ex);
+        }
+        return transactional;
+    }
 }
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/JDBCEprDBResourceFactory.java (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/JDBCEprDBResourceFactory.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/JDBCEprDBResourceFactory.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/JDBCEprDBResourceFactory.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,253 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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) 2005-2006, JBoss Inc.
+ */
+package org.jboss.internal.soa.esb.couriers.helpers;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.couriers.SqlTableCourier;
+import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+import org.jboss.soa.esb.couriers.CourierServiceBindException;
+import org.jboss.soa.esb.couriers.CourierTransportException;
+import org.jboss.soa.esb.util.ClassUtil;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.sql.DataSource;
+import java.net.URISyntaxException;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.sql.DriverManager;
+
+/**
+ * Factory for creating JDBCEpr based database resources for the SQLTableCourier..
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class JDBCEprDBResourceFactory {
+
+    private static Logger logger = Logger.getLogger(JDBCEprDBResourceFactory.class);
+
+    private JDBCEpr epr;
+
+    private DataSource dataSource;
+    private String insertStatementSQL;
+    private String listStatementSQL;
+    private String select4UpdateStatementSQL;
+    private String updateStatusStatementSQL;
+    private String deleteStatementSQL;
+
+    public JDBCEprDBResourceFactory(JDBCEpr epr) throws CourierServiceBindException {
+        this.epr = epr;
+
+        if (epr.getDatasource() != null) {
+            lookupDataSource(epr);
+        } else {
+            try {
+                try {
+                    ClassUtil.forName(epr.getDriver(), getClass());
+                } catch (ClassNotFoundException e) {
+                    throw new CourierServiceBindException("Database driver '" + epr.getDriver() + "' not available on classpath.");
+                }
+            } catch (URISyntaxException e) {
+                throw new RuntimeException("Unexpected URISyntaxException from EPR getter method.", e);
+            }
+        }
+    }
+
+
+    public Connection createConnection(boolean transactional) throws CourierTransportException, CourierServiceBindException {
+        Connection connection;
+
+        try {
+            if(dataSource != null) {
+                connection = dataSource.getConnection();
+            } else {
+                try {
+                    connection = DriverManager.getConnection(epr.getURL(), epr.getUserName(), epr.getPassword());
+                } catch (URISyntaxException e) {
+                    throw new RuntimeException("Unexpected URISyntaxException from EPR getter method.", e);
+                }
+            }
+        } catch (SQLException e) {
+            throw new CourierTransportException("Failed to connect to DataSource.", e);
+        }
+
+        if (!transactional) {
+            try {
+                connection.setAutoCommit(false);
+            } catch (SQLException e) {
+                try {
+                    connection.close();
+                } catch (SQLException e1) {
+                    logger.error("Failed to close connection.", e1);
+                }
+                throw new CourierTransportException("Failed to turn off autoCommit on connection..", e);
+            }
+        }
+
+        return connection;
+    }
+
+    public PreparedStatement createListStatement(Connection connection) throws SQLException {
+        if (listStatementSQL == null) {
+            listStatementSQL = buildListStatementSQL();
+        }
+        return connection.prepareStatement(listStatementSQL);
+    }
+
+    public PreparedStatement createSelect4UpdateStatement(Connection connection) throws SQLException {
+        if (select4UpdateStatementSQL == null) {
+            select4UpdateStatementSQL = buildSelect4UpdateStatementSQL();
+        }
+        return connection.prepareStatement(select4UpdateStatementSQL);
+    }
+
+    public PreparedStatement createUpdateStatusStatement(Connection connection) throws SQLException {
+        if (updateStatusStatementSQL == null) {
+            updateStatusStatementSQL = buildUpdateStatusStatementSQL();
+        }
+        return connection.prepareStatement(updateStatusStatementSQL);
+    }
+
+    public PreparedStatement createInsertStatement(Connection connection) throws SQLException {
+        if (insertStatementSQL == null) {
+            insertStatementSQL = buildInsertStatementSQL();
+        }
+        return connection.prepareStatement(insertStatementSQL);
+    }
+
+    public PreparedStatement createDeleteStatement(Connection connection) throws SQLException {
+        if (deleteStatementSQL == null) {
+            deleteStatementSQL = buildDeleteStatementSQL();
+        }
+        return connection.prepareStatement(deleteStatementSQL);
+    }
+
+    private String buildSelect4UpdateStatementSQL() {
+        StringBuilder sb = new StringBuilder("select ");
+
+        try {
+            if (!epr.getURL().contains("hsqldb")) {
+                sb = sb.append(
+                        epr.getDataColumn()).append(" from ").append(
+                        epr.getTableName()).append(" where ").append(
+                        epr.getMessageIdColumn()).append("=?").append(
+                        " and ").append(epr.getStatusColumn())
+                        .append("=?").append(" for update");
+            } else {
+                /*
+                 * HSQL does not support FOR UPDATE! All tables appear to
+                 * be inherently updatable!
+                 */
+                sb = sb.append(
+                        epr.getDataColumn()).append(" from ").append(
+                        epr.getTableName()).append(" where ").append(
+                        epr.getMessageIdColumn()).append("=?").append(
+                        " and ").append(epr.getStatusColumn())
+                        .append("=?");
+            }
+        } catch (URISyntaxException e) {
+            throw new RuntimeException("Unexpected URISyntaxException from EPR getter method.", e);
+        }
+
+        return sb.toString();
+    }
+
+    private String buildUpdateStatusStatementSQL() {
+        try {
+            StringBuilder sb = new StringBuilder("update ").append(
+                    epr.getTableName()).append(" set ").append(
+                    epr.getStatusColumn()).append("= ?").append(" where ")
+                    .append(epr.getMessageIdColumn()).append("=?");
+
+            return sb.toString();
+        } catch (URISyntaxException e) {
+            throw new RuntimeException("Unexpected URISyntaxException from EPR getter method.", e);
+        }
+    }
+
+    private String buildInsertStatementSQL() {
+        try {
+            StringBuilder sb = new StringBuilder();
+
+            sb.append("insert into ").append(epr.getTableName());
+            sb.append(" (");
+            sb.append(epr.getMessageIdColumn()).append(", ");
+            sb.append(epr.getDataColumn()).append(", ");
+            sb.append(epr.getStatusColumn()).append(", ");
+            sb.append(epr.getTimestampColumn());
+            sb.append(") values (?,?,?,?)");
+
+            return sb.toString();
+        } catch (URISyntaxException e) {
+            throw new RuntimeException("Unexpected URISyntaxException from EPR getter method.", e);
+        }
+    }
+
+    private String buildListStatementSQL() {
+        StringBuilder sb = new StringBuilder();
+
+        try {
+            sb.append("select ");
+            sb.append(epr.getMessageIdColumn()).append(", ");
+            sb.append(epr.getTimestampColumn());
+            sb.append(" from ").append(epr.getTableName());
+            sb.append(" where ").append(epr.getStatusColumn());
+            sb.append(" = '").append(SqlTableCourier.State.Pending.getColumnValue()).append("'");
+            sb.append(" order by 2");
+        } catch (URISyntaxException e) {
+            throw new RuntimeException("Unexpected URISyntaxException from EPR getter method.", e);
+        }
+
+        return sb.toString();
+    }
+
+    private String buildDeleteStatementSQL() {
+        try {
+            StringBuilder sb = new StringBuilder("delete from ").append(
+                    epr.getTableName()).append(" where ").append(
+                    epr.getMessageIdColumn()).append(" =?");
+
+            return sb.toString();
+        } catch (URISyntaxException e) {
+            throw new RuntimeException("Unexpected URISyntaxException from EPR getter method.", e);
+        }
+    }
+
+    private void lookupDataSource(JDBCEpr epr) throws CourierServiceBindException {
+        try
+        {
+            if (epr.getDatasource() != null) {
+                InitialContext initContext;
+                try {
+                    initContext = new InitialContext();
+                    dataSource = (DataSource) initContext.lookup(epr.getDatasource());
+                } catch (NamingException e) {
+                    logger.error("Problem resolving DataSource through JNDI", e);
+                    throw e; // it'll get wrapped later anyway!
+                }
+            }
+        }
+        catch (final Exception e)
+        {
+            throw new CourierServiceBindException("Failed to lookup DataSource.", e);
+        }
+    }
+}

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/JmsComposer.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/JmsComposer.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/JmsComposer.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -62,16 +62,15 @@
 
         if (!(incomingMessage instanceof ObjectMessage))
         {
-            LOGGER.error("Unsupported JMS message type: " + incomingMessage.getClass().getName()) ;
+            LOGGER.error("Unsupported JMS message type: " + incomingMessage.getClass().getName()+" for incoming ESB-aware message.");
             return null ;
         }
         try
         {
-            final ObjectMessage jmsMessage = (ObjectMessage)incomingMessage ;
-            
+            final ObjectMessage jmsMessage = (ObjectMessage)incomingMessage ;          
             final Serializable obj = (Serializable)jmsMessage.getObject() ;
-
             final Message composedMessage = Util.deserialize(obj) ;
+            
             propertiesSetter.setPropertiesFromJMSMessage(jmsMessage, composedMessage) ;
 
             /*

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRConnectionFactory.java (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRConnectionFactory.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRConnectionFactory.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRConnectionFactory.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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) 2005-2006, JBoss Inc.
+ */
+package org.jboss.internal.soa.esb.services.registry;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.common.Configuration;
+
+import javax.xml.registry.Connection;
+import javax.xml.registry.ConnectionFactory;
+import javax.xml.registry.JAXRException;
+import java.net.PasswordAuthentication;
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+
+/**
+ * JAXR Connection Factory.
+ * <p/>
+ * Extracted from the {@link JAXRRegistryImpl}.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class JAXRConnectionFactory {
+
+    private static Logger logger = Logger.getLogger(JAXRConnectionFactory.class);
+
+    private Set<PasswordAuthentication> creds = new HashSet<PasswordAuthentication>();
+    private Properties props = new Properties();
+
+    public JAXRConnectionFactory() {
+        props = new Properties();
+        props.setProperty("javax.xml.registry.queryManagerURL", Configuration.getRegistryQueryManageURI());
+        props.setProperty("javax.xml.registry.lifeCycleManagerURL", Configuration.getRegistryLifecycleManagerURI());
+        props.setProperty("javax.xml.registry.factoryClass", Configuration.getRegistryFactoryClass());
+        if (Configuration.getRegistrySemanticEquivalences()!=null) {
+            props.setProperty("javax.xml.registry.semanticEquivalences", Configuration.getRegistrySemanticEquivalences());
+        }
+        if (Configuration.getRegistryPostalAddressScheme()!=null) {
+            props.setProperty("javax.xml.registry.postalAddressScheme", Configuration.getRegistryPostalAddressScheme());
+        }
+        if (Configuration.getRegistrySecurityAuthenticationMethod()!=null) {
+            props.setProperty("javax.xml.registry.security.authenticationMethod", Configuration.getRegistrySecurityAuthenticationMethod());
+        }
+        if (Configuration.getRegistryUDDIMaxRows()!=null) {
+            props.setProperty("javax.xml.registry.uddi.maxRows", Configuration.getRegistryUDDIMaxRows());
+        }
+        if (Configuration.getRegistryScoutTransportClass()!=null) {
+            props.setProperty("scout.proxy.transportClass", Configuration.getRegistryScoutTransportClass());
+        }
+        String user = Configuration.getRegistryUser();
+        String password = Configuration.getRegistryPassword();
+        PasswordAuthentication passwdAuth = new PasswordAuthentication(user, password.toCharArray());
+        creds.add(passwdAuth);
+    }
+
+
+    /**
+     * Creates a connecton to a JAXR capable registy.
+     *
+     * @return Connection to a Registry using JAXR.
+     */
+    protected Connection getConnection()
+    {
+        Connection connection = null;
+        try
+        {   // Create the connection, passing it the configuration properties
+            ConnectionFactory factory = ConnectionFactory.newInstance();
+            factory.setProperties(props);
+            connection = factory.createConnection();
+            connection.setCredentials(creds);
+        } catch (JAXRException e) {
+            logger.log(Level.ERROR, "Could not set up a connection to the Registry. " + e.getMessage(), e);
+        }
+        return connection;
+    }
+
+    /**
+     * Closes the connection to the Registry
+     */
+    protected void closeConnection(Connection connection)
+    {
+        try {
+            if (connection!=null && !connection.isClosed()) {
+                connection.close();
+            }
+        } catch (JAXRException je) {
+            logger.log(Level.ERROR, je.getMessage(), je);
+        }
+    }
+}

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -22,21 +22,16 @@
 package org.jboss.internal.soa.esb.services.registry;
 
 import java.io.UnsupportedEncodingException;
-import java.net.PasswordAuthentication;
 import java.net.URLDecoder;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Properties;
-import java.util.Set;
 
 import javax.xml.registry.BulkResponse;
 import javax.xml.registry.BusinessLifeCycleManager;
 import javax.xml.registry.BusinessQueryManager;
 import javax.xml.registry.Connection;
-import javax.xml.registry.ConnectionFactory;
 import javax.xml.registry.FindQualifier;
 import javax.xml.registry.JAXRException;
 import javax.xml.registry.JAXRResponse;
@@ -60,7 +55,6 @@
 import org.jboss.soa.esb.MarshalException;
 import org.jboss.soa.esb.UnmarshalException;
 import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.common.Configuration;
 import org.jboss.soa.esb.services.registry.Registry;
 import org.jboss.soa.esb.services.registry.RegistryException;
 import org.jboss.soa.esb.services.registry.ServiceNotFoundException;
@@ -74,79 +68,18 @@
 public class JAXRRegistryImpl implements Registry
 {
 	private static Logger logger = Logger.getLogger(JAXRRegistryImpl.class);
-	public static Set<PasswordAuthentication> creds = new HashSet<PasswordAuthentication>();
-	private static Properties props = new Properties();
+    private JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
 	private static Organization jbossESBOrganization;
-	
-	private synchronized static void init() 
-	{
-	    props = new Properties();
-	    props.setProperty("javax.xml.registry.queryManagerURL", Configuration.getRegistryQueryManageURI());
-	    props.setProperty("javax.xml.registry.lifeCycleManagerURL", Configuration.getRegistryLifecycleManagerURI());
-	    props.setProperty("javax.xml.registry.factoryClass", Configuration.getRegistryFactoryClass());
-        if (Configuration.getRegistrySemanticEquivalences()!=null) {
-            props.setProperty("javax.xml.registry.semanticEquivalences", Configuration.getRegistrySemanticEquivalences());
-        }
-        if (Configuration.getRegistryPostalAddressScheme()!=null) {
-            props.setProperty("javax.xml.registry.postalAddressScheme", Configuration.getRegistryPostalAddressScheme());
-        }
-        if (Configuration.getRegistrySecurityAuthenticationMethod()!=null) {
-            props.setProperty("javax.xml.registry.security.authenticationMethod", Configuration.getRegistrySecurityAuthenticationMethod());
-        }
-        if (Configuration.getRegistryUDDIMaxRows()!=null) {
-            props.setProperty("javax.xml.registry.uddi.maxRows", Configuration.getRegistryUDDIMaxRows());
-        }
-        if (Configuration.getRegistryScoutTransportClass()!=null) {
-            props.setProperty("scout.proxy.transportClass", Configuration.getRegistryScoutTransportClass());
-        }
-	    String user = Configuration.getRegistryUser();
-	    String password = Configuration.getRegistryPassword();
-	    PasswordAuthentication passwdAuth = new PasswordAuthentication(user, password.toCharArray());
-        creds.add(passwdAuth);
-	}
 
 	/** 
-	 * Creates a connecton to a JAXR capable registy.
-	 * 
-	 * @return Connection to a Registry using JAXR. 
-	 */
-	protected synchronized static Connection getConnection() 
-	{
-		Connection connection = null;
-		init();
-	    try
-	    {   // Create the connection, passing it the configuration properties
-	        ConnectionFactory factory = ConnectionFactory.newInstance();
-	        factory.setProperties(props);
-	        connection = factory.createConnection();
-	    } catch (JAXRException e) {
-            logger.log(Level.ERROR, "Could not set up a connection to the Registry. " + e.getMessage(), e);
-	    }
-	    return connection;
-	}
-	/**
-	 * Closes the connection to the Registry
-	 */
-	protected synchronized static void closeConnection(Connection connection)
-	{
-		try {
-			if (connection!=null && !connection.isClosed()) {
-				connection.close();
-			}
-		} catch (JAXRException je) {
-			logger.log(Level.ERROR, je.getMessage(), je);
-		}
-	}
-	/** 
 	 * Publish an EPR to the Registry
 	 */
 	protected Service registerService(String category, String serviceName, String serviceDescription) throws JAXRException 
 	{
 		Service service =null;
 		Organization organization = getJBossESBOrganization();
-		Connection connection = JAXRRegistryImpl.getConnection();
+		Connection connection = jaxrConnectionFactory.getConnection();
 		try {
-			connection.setCredentials(JAXRRegistryImpl.creds);
 			RegistryService rs = connection.getRegistryService();
             BusinessQueryManager bqm = rs.getBusinessQueryManager();
 			BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
@@ -160,9 +93,9 @@
             Classification classification = blm.createClassification(cScheme, "category", category);
 			service.addClassification(classification);
 			organization.addService(service);
-			saveRegistryObject(service);
+			saveRegistryObject(service, jaxrConnectionFactory);
 		} finally {
-			closeConnection(connection);
+			jaxrConnectionFactory.closeConnection(connection);
 		}
 		return service;
 	}
@@ -172,7 +105,7 @@
 	@SuppressWarnings("unchecked")
     public void unRegisterService(String category, String serviceName) throws RegistryException, ServiceNotFoundException{
 //    first find the ServiceBindings for this service
-        Connection connection = JAXRRegistryImpl.getConnection();
+        Connection connection = jaxrConnectionFactory.getConnection();
         Service service = null;
         try {
             service = findService(category, serviceName);
@@ -180,7 +113,6 @@
                 throw new ServiceNotFoundException("No such EPR found for service with name = " 
                         + serviceName);
             }
-            connection.setCredentials(JAXRRegistryImpl.creds);
             RegistryService rs = connection.getRegistryService();
             BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
             Collection<Key> serviceKeys = new ArrayList<Key>();
@@ -189,7 +121,7 @@
         } catch (JAXRException je) {
             throw new RegistryException(je.getLocalizedMessage(), je);
         } finally {
-            closeConnection(connection);
+            jaxrConnectionFactory.closeConnection(connection);
         }
 	}
 	/** 
@@ -198,7 +130,7 @@
 	public void registerEPR(String category, String serviceName, String serviceDescription, EPR epr, String eprDescription) 
 		throws RegistryException
 	{
-		Connection connection = JAXRRegistryImpl.getConnection();
+		Connection connection = jaxrConnectionFactory.getConnection();
 		try {
 			//Find the service
 			Service service = findService(category,serviceName);
@@ -207,7 +139,6 @@
 				service = registerService(category, serviceName, serviceDescription);
 			}
 
-			connection.setCredentials(JAXRRegistryImpl.creds);
 			RegistryService rs = connection.getRegistryService();
 			BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
             BusinessQueryManager bqm = rs.getBusinessQueryManager();
@@ -226,13 +157,13 @@
             Classification classification = blm.createClassification(cScheme, "category", category);
             service.addClassification(classification);
            
-			saveRegistryObject(serviceBinding);
+			saveRegistryObject(serviceBinding, jaxrConnectionFactory);
 		} catch (JAXRException je) {
 			throw new RegistryException(je.getLocalizedMessage(), je);
         } catch (MarshalException me) {
             throw new RegistryException(me.getLocalizedMessage(), me);
 		} finally {
-			closeConnection(connection);
+			jaxrConnectionFactory.closeConnection(connection);
 		}
 	}
 	/** 
@@ -240,7 +171,7 @@
 	 */
 	public void unRegisterEPR(String category, String serviceName, EPR toBeDeletedEPR) throws RegistryException, ServiceNotFoundException{
 		//first find the ServiceBindings for this service
-        Connection connection = JAXRRegistryImpl.getConnection();
+        Connection connection = jaxrConnectionFactory.getConnection();
         Service service = null;
 		try {
             service = findService(category, serviceName);
@@ -248,7 +179,6 @@
                 throw new ServiceNotFoundException("No such Service found for service with category= "
                         + category + " and name = " + serviceName);
             }
-            connection.setCredentials(JAXRRegistryImpl.creds);
 			Collection serviceBindings = findServiceBindings(service);
 			service.addServiceBindings(serviceBindings);
 			for (Iterator i=serviceBindings.iterator();i.hasNext();){
@@ -283,7 +213,7 @@
         } catch (MarshalException me) {
             throw new RegistryException(me.getLocalizedMessage(), me);
 		} finally {
-		    closeConnection(connection);
+		    jaxrConnectionFactory.closeConnection(connection);
         }
 	}
 	
@@ -308,7 +238,6 @@
 	/**
 	 * Find Services based on a category ("transformation").
 	 * 
-	 * @param serviceType
 	 * @return collection services
 	 */
 	public List<String> findServices(String category) throws RegistryException
@@ -327,13 +256,12 @@
 	}
 	/**
 	 * 
-	 * @param service
 	 * @return
 	 */
 	public List<EPR> findEPRs(String category, String serviceName) throws RegistryException, ServiceNotFoundException
 	{
 		List<EPR> eprs = new ArrayList<EPR>();
-		Connection connection = JAXRRegistryImpl.getConnection();
+		Connection connection = jaxrConnectionFactory.getConnection();
 		try {
 			Service service = findService(category, serviceName);
 			if (service==null){
@@ -368,19 +296,18 @@
         } catch (UnmarshalException me) {
             throw new RegistryException(me.getLocalizedMessage(), me);
 		} finally {
-			closeConnection(connection);
+			jaxrConnectionFactory.closeConnection(connection);
 		}
 		return eprs;
 	}
 	/**
 	 * 
-	 * @param service
 	 * @return
 	 */
 	public EPR findEPR(String category, String serviceName) throws RegistryException, ServiceNotFoundException
 	{
 		EPR epr = null;
-		Connection connection = JAXRRegistryImpl.getConnection();
+		Connection connection = jaxrConnectionFactory.getConnection();
 		try {
 			Service service = findService(category, serviceName);
 			if (service==null){
@@ -410,22 +337,22 @@
         } catch (UnmarshalException me) {
             throw new RegistryException(me.getLocalizedMessage(), me);
 		} finally {
-			closeConnection(connection);
+			jaxrConnectionFactory.closeConnection(connection);
 		}
 		return epr;
 	}
-	/**
+
+    /**
 	 * Find all Organizations with a name mathing the queryString parameter.
-	 * 
+	 *
 	 * @param organizationName used to match with the name of the organization.
 	 * @return the Organization.
 	 */
-	protected synchronized static Organization findOrganization(String organizationName) throws JAXRException
-	{
+    public static Organization findOrganization(String organizationName, JAXRConnectionFactory jaxrConnectionFactory) throws JAXRException {
 	    if (organizationName==null) {
 	    	organizationName="";
 	    }
-		Connection connection = JAXRRegistryImpl.getConnection();
+		Connection connection = jaxrConnectionFactory.getConnection();
 		try {
 			// Get registry service and business query manager
 			RegistryService rs = connection.getRegistryService();
@@ -440,7 +367,7 @@
 			BulkResponse response = bqm.findOrganizations(findQualifiers,
 					namePatterns, null, null, null, null);
 			if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
-				for (Iterator orgIter = response.getCollection().iterator(); orgIter.hasNext();) 
+				for (Iterator orgIter = response.getCollection().iterator(); orgIter.hasNext();)
 				{
 					Organization org = (Organization) orgIter.next();
 					logger.log(Level.DEBUG, "Organization name: " + org.getName().getValue());
@@ -449,7 +376,7 @@
 					User primaryContact = org.getPrimaryContact();
 					logger.log(Level.DEBUG, "Primary Contact: " + primaryContact.getPersonName().getFullName());
 					if (orgIter.hasNext()) {
-						logger.log(Level.ERROR, "Found " + response.getCollection().size() 
+						logger.log(Level.ERROR, "Found " + response.getCollection().size()
 								+ " Organization, while expecting only one of name " + organizationName);
 					}
 					return org;
@@ -457,16 +384,17 @@
 			}
 			return null;
 		} finally {
-			closeConnection(connection);
+			jaxrConnectionFactory.closeConnection(connection);
 		}
 	}
-	/**
-	 * 
+
+    /**
+	 *
 	 * @param category
 	 * @param serviceName
 	 * @return Service
 	 */
-	protected synchronized static Service findService(String category, String serviceName) throws JAXRException
+	protected Service findService(String category, String serviceName) throws JAXRException
 	{
 		if (category==null) {
 			category="";
@@ -474,7 +402,7 @@
 		if (serviceName==null) {
 			serviceName="";
 		}
-		Connection connection = JAXRRegistryImpl.getConnection();
+		Connection connection = jaxrConnectionFactory.getConnection();
 		try {
 			// Get registry service and business query manager
 			RegistryService rs = connection.getRegistryService();
@@ -487,9 +415,9 @@
             findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
             ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:category");
             Collection<Classification> classifications = new ArrayList<Classification>();
-            Classification classification = 
-                blm.createClassification( 
-                  cScheme, 
+            Classification classification =
+                blm.createClassification(
+                  cScheme,
                   "category", category );
             classifications.add(classification);
 			Collection<String> namePatterns = new ArrayList<String>();
@@ -499,7 +427,7 @@
 			BulkResponse response = bqm.findServices(null, findQualifiers,
 					namePatterns, classifications, null);
 			if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
-				for (Iterator servIter = response.getCollection().iterator(); servIter.hasNext();) 
+				for (Iterator servIter = response.getCollection().iterator(); servIter.hasNext();)
 				{
 					Service service = (Service) servIter.next();
 					logger.log(Level.DEBUG, "Service name: " + service.getName().getValue());
@@ -508,8 +436,8 @@
 					}
 					logger.log(Level.DEBUG, "Key id: " + service.getKey().getId());
 					if (servIter.hasNext()) {
-						logger.log(Level.ERROR, "Found " + response.getCollection().size() 
-								+ " Services, while expecting only one by the name of " 
+						logger.log(Level.ERROR, "Found " + response.getCollection().size()
+								+ " Services, while expecting only one by the name of "
 								+ serviceName + " in category " + category);
 					}
 					return service;
@@ -517,23 +445,23 @@
 			}
 			return null;
 		} finally {
-			closeConnection(connection);
+			jaxrConnectionFactory.closeConnection(connection);
 		}
 	}
-	/**
+
+    /**
 	 * Finds all services for a given category.
 	 * @param category
-	 * @param serviceName
 	 * @return Service
 	 */
 	@SuppressWarnings("unchecked")
-	protected synchronized static Collection<Service> findServicesForCategory(String category) throws JAXRException
+	protected Collection<Service> findServicesForCategory(String category) throws JAXRException
 	{
 		Collection<Service> services = new ArrayList<Service>();
 		if (category==null) {
 			category="";
 		}
-		Connection connection = JAXRRegistryImpl.getConnection();
+		Connection connection = jaxrConnectionFactory.getConnection();
 		try {
 			// Get registry service and business query manager
 			RegistryService rs = connection.getRegistryService();
@@ -542,13 +470,13 @@
             Collection<String> findQualifiers = new ArrayList<String>();
             findQualifiers.add(FindQualifier.AND_ALL_KEYS);
             findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
-            ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:category");  
+            ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:category");
             //Create classification
-            Classification classification = 
-                blm.createClassification( 
-                  cScheme, 
+            Classification classification =
+                blm.createClassification(
+                  cScheme,
                   "category", category );
-            
+
 			// Define find qualifiers and name patterns
 			//Collection<String> findQualifiers = new ArrayList<String>();
 			//findQualifiers.add(FindQualifier.AND_ALL_KEYS);
@@ -564,24 +492,22 @@
 			}
 			return services;
 		} finally {
-			closeConnection(connection);
+			jaxrConnectionFactory.closeConnection(connection);
 		}
 	}
-	/**
+
+    /**
 	 * Create a jbossesb organization under which we will register all our services.
-	 * 
-	 * @param blm
+	 *
 	 * @return
 	 * @throws JAXRException
 	 */
-	protected synchronized static Organization createJBossESBOrganization()
-			throws JAXRException 
+    protected static Organization createJBossESBOrganization(JAXRConnectionFactory jaxrConnectionFactory) throws JAXRException
 	{
 //		Getting the connection to the Registry (reading config)
-		Connection connection = JAXRRegistryImpl.getConnection();
+		Connection connection = jaxrConnectionFactory.getConnection();
 		try {
 			//Logging in
-			connection.setCredentials(JAXRRegistryImpl.creds);
 			RegistryService rs = connection.getRegistryService();
 			//Building organization
 			BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
@@ -603,43 +529,43 @@
 			EmailAddress emailAddress = blm
 					.createEmailAddress("jbossesb at jboss.com");
 			emailAddresses.add(emailAddress);
-	
+
 			Collection<TelephoneNumber> numbers = new ArrayList<TelephoneNumber>();
 			numbers.add(telephoneNumber);
 			user.setPersonName(personName);
 			user.setPostalAddresses(postalAddresses);
 			user.setEmailAddresses(emailAddresses);
 			user.setTelephoneNumbers(numbers);
-	
+
 	//		Scout does not support this (yet), so leaving it out for now.
 	//		ClassificationScheme cScheme = getClassificationScheme(blm,
 	//				blm.createInternationalString("uddi-org:general_keywords"), blm.createInternationalString(""));
 	//		Classification classification = blm.createClassification(cScheme,
 	//				blm.createInternationalString("JBoss ESB"), blm.createInternationalString("JBESB"));
 	//		org.addClassification(classification);
-			
-			saveRegistryObject(organization);
+
+			saveRegistryObject(organization, jaxrConnectionFactory);
 			return organization;
 		} finally {
-			closeConnection(connection);
-		}	
+			jaxrConnectionFactory.closeConnection(connection);
+		}
 	}
-	/**
+
+    /**
 	 * Save Registry Object
 	 */
-	protected synchronized static void saveRegistryObject(RegistryObject registryObject) throws JAXRException
+	private static void saveRegistryObject(RegistryObject registryObject, JAXRConnectionFactory jaxrConnectionFactory) throws JAXRException
 	{
 //		Getting the connection to the Registry (reading config)
-		Connection connection = JAXRRegistryImpl.getConnection();
+		Connection connection = jaxrConnectionFactory.getConnection();
 		try {
-			
+
 			BulkResponse br = null;
 			//Logging in
-			connection.setCredentials(JAXRRegistryImpl.creds);
 			RegistryService rs = connection.getRegistryService();
 			//Building organization
 			BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
-			
+
 			Class[] interfaces = registryObject.getClass().getInterfaces();
 			String interfaceName ="";
 			for (int i=0; i<interfaces.length; i++) {
@@ -696,23 +622,25 @@
 				throw new JAXRException("Errors occurred during save");
 			}
 		} finally {
-			JAXRRegistryImpl.closeConnection(connection);
-		}	
+			jaxrConnectionFactory.closeConnection(connection);
+		}
 	}
-	/**
+
+    /**
 	 * finds the JBossESB Organizationa and creates one if it is not there.
 	 * @return JBossESB Organization
 	 * @throws JAXRException
 	 */
 	private Organization getJBossESBOrganization() throws JAXRException
 	{
-		jbossESBOrganization = findOrganization("Red Hat/JBossESB");
+		jbossESBOrganization = findOrganization("Red Hat/JBossESB", jaxrConnectionFactory);
 		if (jbossESBOrganization==null) {
-			jbossESBOrganization = createJBossESBOrganization();
+			jbossESBOrganization = createJBossESBOrganization(jaxrConnectionFactory);
 		}
 		return jbossESBOrganization;
 	}
-	/**
+
+    /**
 	 * Find the ServiceBindings for a given Service
 	 * @param service
 	 * @return
@@ -722,7 +650,7 @@
 	private Collection<ServiceBinding> findServiceBindings(Service service) throws RegistryException
 	{
 		Collection<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
-		Connection connection = JAXRRegistryImpl.getConnection();
+		Connection connection = jaxrConnectionFactory.getConnection();
 		try {
 			RegistryService rs = connection.getRegistryService();
 			BusinessQueryManager bqm = rs.getBusinessQueryManager();
@@ -736,10 +664,9 @@
 		} catch (Exception je) {
 			throw new RegistryException(je.getLocalizedMessage(), je);
 		} finally {
-			closeConnection(connection);
+			jaxrConnectionFactory.closeConnection(connection);
 		}
 	}
-	
 }
 
 	

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -444,8 +444,17 @@
 							"Can't connect to FTP server");
 				m_oConn.user(m_sUser);
 				m_oConn.password(m_sPasswd);
-				m_oConn
-						.setConnectMode((m_bPassive) ? FTPConnectMode.PASV : FTPConnectMode.ACTIVE);
+				
+				/*
+				 * It's ok to set the passive/active mode here as this is for
+				 * the data connection. The previous call to connect() was for
+				 * the command connection and is not affected by this setting.
+				 * 
+				 * http://www.slacksite.com/other/ftp.html
+				 */
+				
+				m_oConn.setConnectMode((m_bPassive) ? FTPConnectMode.PASV : FTPConnectMode.ACTIVE);
+				
 				m_oConn.setType(m_oXferType);
 				
 				if (_timeout > 0)

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -75,7 +75,7 @@
     
     protected ConfigTree config;
     private Logger logger = Logger.getLogger(Aggregator.class);
-    private Long timeoutInMillies=null;
+    private Long timeoutInMillis=null;
     private Set<String> receivedSplits = new HashSet<String>();
     private String splitId;
 
@@ -86,21 +86,30 @@
         this.config = config;
         String timeoutAttr = config.getAttribute("timeoutInMillies", null);
         
+        /*
+         * http://jira.jboss.com/jira/browse/JBESB-1552
+         */
+        
         if (timeoutAttr != null)
+            logger.warn("Aggregator config: timeoutInMillies is deprecated. Use timeoutInMillis in future.");
+        else
+            timeoutAttr = config.getAttribute("timeoutInMillis", null);
+        
+        if (timeoutAttr != null)
         {
         	try
         	{
-        		timeoutInMillies = Long.valueOf(timeoutAttr);
+        		timeoutInMillis = Long.valueOf(timeoutAttr);
         	}
         	catch (NumberFormatException ex)
         	{
-        		logger.error("Invalid value for timeoutInMillies: "+timeoutAttr);
+        		logger.error("Invalid value for timeoutInMillis: "+timeoutAttr);
         		
         		throw new ConfigurationException(ex);
         	}
         }
         
-        logger.debug("Aggregator config:  timeoutInMillies=" + timeoutInMillies);
+        logger.debug("Aggregator config:  timeoutInMillis=" + timeoutInMillis);
         splitId = config.getAttribute("splitId");
     }
         
@@ -349,9 +358,9 @@
      */
     private boolean isTimedOut(long splitterTimeStamp)
     {
-        if (timeoutInMillies!=null) {
+        if (timeoutInMillis!=null) {
             long now = new Date().getTime();
-            long expiration = splitterTimeStamp + timeoutInMillies;
+            long expiration = splitterTimeStamp + timeoutInMillis;
             if (logger.isDebugEnabled()) {
                 DateFormat dateFormat = DateFormat.getTimeInstance();
                 logger.debug("Current time=" + dateFormat.format(new Date(now)) 
@@ -390,7 +399,7 @@
             boolean running = true ;
             while(running) {
                 //no need to check if no timeout is set
-                if (timeoutInMillies!=null) {
+                if (timeoutInMillis!=null) {
                 	// is a snapshot so no lock needed
                     for (Map<Integer, Message > messageMap : aggregatedMessageMap.values()) {
                         //Check the first message, they all have the same time stamp

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -34,7 +34,6 @@
 import javax.jms.MessageProducer;
 import javax.jms.ObjectMessage;
 import javax.jms.Queue;
-import javax.jms.Session;
 import javax.jms.TextMessage;
 import javax.naming.Context;
 import javax.naming.NamingException;

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessor.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessor.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessor.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -21,25 +21,25 @@
 
 import groovy.lang.Binding;
 import groovy.lang.GroovyShell;
+import groovy.lang.Script;
 import groovy.util.GroovyScriptEngine;
-
-import java.io.IOException;
-import java.io.InputStream;
-
 import org.apache.log4j.Logger;
 import org.jboss.internal.soa.esb.util.StreamUtils;
 import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.listeners.message.MessageDeliverException;
 import org.jboss.soa.esb.actions.ActionLifecycleException;
 import org.jboss.soa.esb.actions.ActionPipelineProcessor;
 import org.jboss.soa.esb.actions.ActionProcessingException;
 import org.jboss.soa.esb.actions.ActionUtils;
 import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.message.MessagePayloadProxy;
 import org.jboss.soa.esb.message.body.content.BytesBody;
 import org.jboss.soa.esb.util.ClassUtil;
 
+import java.io.IOException;
+import java.io.InputStream;
+
 /**
  * <a href="http://groovy.codehaus.org">Groovy</a> Scripting action processor.
  * <p/>
@@ -53,7 +53,10 @@
  * {@link ConfigTree configuration} is bound under the name "config".
  * <p/>
  * The script can also be supplied to this action as the message payload, allowing you to
- * dynamically supply the action with script.
+ * dynamically supply the action script.  For message based scripts to be executable,
+ * the "script" action property must be omitted and the "supportMessageBasedScripting" property must
+ * be set to "true".  There are obvious security issues around executing message based scripts,
+ * so use this feature controlled manner.
  *
  * @author Gregory Pierce.
  * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
@@ -63,7 +66,9 @@
     private static Logger logger = Logger.getLogger(GroovyActionProcessor.class);
     protected ConfigTree configTree;
     protected GroovyScriptEngine scriptEngine;
-    private String script;
+    private String scriptPath;
+    private Script script;
+    private boolean cacheScript;
     private MessagePayloadProxy payloadProxy;
 
     public GroovyActionProcessor(ConfigTree config) throws ConfigurationException {
@@ -74,16 +79,15 @@
     }
 
     public void initialise() throws ActionLifecycleException {
-        String scriptPath = configTree.getAttribute("script");
-
+        scriptPath = configTree.getAttribute("script");
+        cacheScript = configTree.getBooleanAttribute("cacheScript", true);
         if(scriptPath == null) {
-            logger.info("No Groovy script specified on action config " + configTree.getAttribute("name")
-                    + ". Expecting Groovy script to be in message.");
-        } else {
-            try {
-                script = GroovyActionProcessor.getScriptFromClasspath(scriptPath);
-            } catch (IOException e) {
-                throw new ActionLifecycleException("Error reading script '" + scriptPath + "' stream.");
+            boolean supportMessageBasedScripting = configTree.getBooleanAttribute("supportMessageBasedScripting", false);
+            if(supportMessageBasedScripting) {
+                logger.info("No Groovy script specified on action config " + configTree.getAttribute("name")
+                        + ". Expecting Groovy script to be in message.");
+            } else {
+                throw new ActionLifecycleException("'script' not configured on the action and message based scripting is not enabled ('supportMessageBasedScripting=false').");
             }
         }
     }
@@ -137,8 +141,12 @@
             binding.setVariable("config", configTree);
             binding.setVariable("payloadProxy", payloadProxy);
 
-            GroovyShell shell = new GroovyShell(Thread.currentThread().getContextClassLoader(), binding);
-            Object returnVal = shell.evaluate(getScript(message));
+            Script execScript = getScript(message);
+            Object returnVal;
+            synchronized (execScript) {
+                execScript.setBinding(binding);
+                returnVal = execScript.run();
+            }
 
             if(returnVal instanceof Message) {
                 return (Message) returnVal;
@@ -152,8 +160,17 @@
 		}
 	}
 
-    private String getScript(Message message) throws ActionProcessingException {
-        if(script != null) {
+    protected Script getScript(Message message) throws ActionProcessingException {
+        if(scriptPath != null) {
+            if(script == null || !cacheScript) {
+                try {
+                    String scriptText = GroovyActionProcessor.getScriptFromClasspath(scriptPath);
+                    script = constructScriptInstance(scriptText);
+                } catch (IOException e) {
+                    throw new ActionProcessingException("Error reading script '" + scriptPath + "' stream.");
+                }
+            }
+            
             return script;
         } else {
             // So, the script is being passed in in the message... 
@@ -166,15 +183,20 @@
             }
 
             if(messageScript instanceof String) {
-                return (String)messageScript;
+                return constructScriptInstance((String)messageScript);
             } else if(messageScript instanceof byte[]) {
-                return new String((byte[])messageScript);
+                return constructScriptInstance(new String((byte[])messageScript));
             } else {
                 throw new ActionProcessingException("Groovy script not specified in message.");
             }
         }
     }
 
+    private Script constructScriptInstance(String scriptText) {
+        GroovyShell shell = new GroovyShell(Thread.currentThread().getContextClassLoader());
+        return shell.parse(scriptText);
+    }
+
     public void processException(final Message message, final Throwable th) {
     }
 

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -182,6 +182,7 @@
 			 * copying should therefore be safe.
 			 */
 			final PortReference clone = (PortReference)clone() ;
+			// Hmmm, would seem like this is superflous
 			clone._extensions = new LinkedList<Extension>(_extensions) ;
 			return clone;
 		}
@@ -380,7 +381,7 @@
 					^ objectHashCode(_uri, 0x8) ^ objectHashCode(_value, 0x10) ^ objectHashCode(
 					_extensions, 0x20));
 		}
-
+		
 		private String _tag = null;
 
 		private String _prefix = null;

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -184,6 +184,9 @@
 						getAddr().addExtension(Context.URL_PKG_PREFIXES, nl.item(i).getTextContent());
                     } else if (tag.equals(JNDI_URL_TAG)) {
                     	uri = nl.item(i).getTextContent();
+                    	
+                    	// remember to add this extension!
+                	getAddr().addExtension(Context.PROVIDER_URL, uri);
                     } else if (tag.equals(MESSAGE_SELECTOR_TAG)) {
                     	getAddr().addExtension(MESSAGE_SELECTOR_TAG, nl.item(i).getTextContent());
                     } else if (tag.equals(PERSISTENT_TAG)) {
@@ -527,7 +530,6 @@
 					addr.addExtension(JMS_SECURITY_CREDENTIAL_TAG, password);
 				
 				addr.addExtension(TRANSACTED_TAG, String.valueOf(transacted));
-					
 			}
 			else
 				throw new IllegalArgumentException("Invalid destination type! "+destinationType);

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -38,6 +38,9 @@
 import org.jboss.soa.esb.couriers.Courier;
 import org.jboss.soa.esb.couriers.CourierException;
 import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierTransportException;
+import org.jboss.soa.esb.couriers.CourierServiceBindException;
+import org.jboss.soa.esb.couriers.CourierMarshalUnmarshalException;
 import org.jboss.soa.esb.couriers.CourierUtil;
 import org.jboss.soa.esb.couriers.FaultMessageException;
 import org.jboss.soa.esb.couriers.TwoWayCourier;
@@ -75,12 +78,18 @@
     public static final String DEAD_LETTER_SERVICE_NAME = "DeadLetterService";
     public static final String DELIVER_TO = "org.jboss.soa.esb.deliver.to";
     
-    /**
+    /*
      * Remove (suspected) dead EPRs.
      */
     
     private static boolean removeDeadEprs;
     
+    /*
+     * Throw an exception on delivery failure rather than retry?
+     */
+    
+    private static boolean exceptionOnDeliveryFailure;
+    
     /**
      * Class logger.
      */
@@ -282,7 +291,7 @@
             if ((serviceClusterInfo.getEPRs().size() == 0) || (new Date().after(expirationDate))) {
                 loadServiceClusterInfo();
                 
-                if (initialPass && (serviceClusterInfo.getEPRs().size() == 0)) // zero from a previoud send
+                if (initialPass && (serviceClusterInfo.getEPRs().size() == 0)) // zero from a previous send
                 {
                 	/*
                 	 * We need to check to see if this instance used up all of it's attempts to deliver
@@ -320,6 +329,14 @@
 	                    
 	                    if (removeDeadEprs)
 	                    	RegistryUtil.unregister(service.getCategory(), service.getName(), epr);
+	                    
+	                    /*
+	                     * If the message property is set to fail immediately, or the global property is set,
+	                     * then don't do retries even if there are other EPRs in the list.
+	                     */
+	                    
+	                    if (("true".equals(message.getProperties().getProperty(Environment.EXCEPTION_ON_DELIVERY_FAILURE, "false")) || exceptionOnDeliveryFailure))
+	                	throw new MessageDeliverException("Failed to deliver message ["+message.getHeader()+"] to Service [" + service + "].  Told not to retry.");
 	                }
             	}
             	catch (MalformedEPRException ex)  // so we can differentiate failure modes, since returning null is limiting
@@ -456,7 +473,7 @@
          * @return Returns the message (or a reply message if synchronous) if the message was delivered
          *         without error, otherwise null.
          */
-        private Message attemptDelivery(Message message, EPR epr) throws FaultMessageException, MalformedEPRException {
+        private Message attemptDelivery(Message message, EPR epr) throws FaultMessageException, MalformedEPRException, MessageDeliverException {
             TwoWayCourier courier = null;
 
             final EPR targetEPR ;
@@ -519,15 +536,35 @@
                     }
                 } catch (FaultMessageException e) {
                     throw e;
+                } catch (final CourierServiceBindException e) {
+                    // meant to be masked by the SI fail-over
+                    
+                    logger.debug("Caught service lookup exception for EPR [" + targetEPR + "] and Service [" + service + "] and Message ["+message.getHeader()+"]. " + e.getMessage());
+                    
+                    // could be stale EPR, so move on to next entry in registry.
+                } catch (final CourierMarshalUnmarshalException e) {
+                    logger.warn("Courier indicated (un)marshal related error "+e+" during delivery to EPR [" + targetEPR + "] for Service [" + service + "] and Message ["+message.getHeader()+"]. " + e.getMessage());
+                    
+                    throw new MessageDeliverException("Caught (un)marshal related exception during attempted send/receive.", e);
+                } catch (final CourierTransportException e) {
+                    // meant to be masked by the SI fail-over
+                    
+                    logger.debug("Courier indicated transport related error "+e+" during send/receive with EPR [" + targetEPR + "] for Service [" + service + "] and Message ["+message.getHeader()+"]. " + e.getMessage());
                 } catch (CourierException e) {
-                    logger.debug("Badly formed EPR [" + targetEPR + "] for Service [" + service + "] and Message ["+message.getHeader()+"]. " + e.getMessage());
+                    // probable config error. Log it and move on to next EPR/service entry.
+                    
+                    logger.warn("Possible configuration error while using Courier for EPR [" + targetEPR + "] and Service [" + service + "] and Message ["+message.getHeader()+"]. " + e.getMessage());
                 } catch (MalformedEPRException e) {
                     // Hmmmm???... Can this really happen?  The Courier has already been created.  Haven't we already validated the EPR during the Courier lookup (above)??
-                    logger.warn("Unexpected error.  Badly formed EPR [" + targetEPR + "] for Service [" + service + "]. But the EPR has already been validated!!");
+                    logger.error("Unexpected error.  Badly formed EPR [" + targetEPR + "] for Service [" + service + "]. But the EPR has already been validated!!");
                     
                     throw e;
                 } catch (Throwable t) {
-                    logger.warn("Unexpected exception during attempted message delivery over Courier for EPR [" + targetEPR + "] for Service [" + service + "] and Message ["+message.getHeader()+"].", t);
+                    logger.error("Unexpected throwable during attempted message delivery using Courier for EPR [" + targetEPR + "] for Service [" + service + "] and Message ["+message.getHeader()+"].", t);
+                    
+                    // we don't know what state we're in so better to bail-out now!
+                    
+                    throw new MessageDeliverException("Caught unexpected throwable during send. Bailing-out!", t);
                 } finally {
                     CourierUtil.cleanCourier(courier);
 
@@ -554,5 +591,16 @@
     	{
     		removeDeadEprs = false;
     	}
+    	
+    	String exceptionOnFailure = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.EXCEPTION_ON_DELIVERY_FAILURE, "false");
+    	
+    	if ("true".equalsIgnoreCase(exceptionOnFailure))
+    	{
+    		exceptionOnDeliveryFailure = true;
+    	}
+    	else
+    	{
+    		exceptionOnDeliveryFailure = false;
+    	}
     }
 }

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -62,7 +62,7 @@
 			new KeyValuePair(Environment.ENCRYPT_FACTORY_CLASS, 		getEncryptionFactoryClass()),
             new KeyValuePair(Environment.LOAD_BALANCER_POLICY,          getLoadBalancerPolicy()),
             new KeyValuePair(Environment.REDELIVER_DLS_SERVICE_ON,      getRedeliveryDlsOn()),
-            new KeyValuePair(Environment.REGISTRY_CACHE_LIFE_MILLIES,   getRegistryCacheLife()),
+            new KeyValuePair(Environment.REGISTRY_CACHE_LIFE_MILLIS,   getRegistryCacheLife()),
 			new KeyValuePair(Environment.MSG_STORE_DB_CONNECTION_URL, 	getStoreUrl()),
 			new KeyValuePair(Environment.MSG_STORE_DB_JDBC_DRIVER, 		getStoreDriver()),
 			new KeyValuePair(Environment.MSG_STORE_DB_CONNECTION_USER, 	getStoreUser()),
@@ -151,8 +151,8 @@
     
     public static String getRegistryCacheLife()
     {
-        return ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.REGISTRY_CACHE_LIFE_MILLIES,
-                    Environment.DEFAULT_REGISTRY_CACHE_LIFE_MILLIES);
+        return ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.REGISTRY_CACHE_LIFE_MILLIS,
+                    Environment.DEFAULT_REGISTRY_CACHE_LIFE_MILLIS);
     }
 	/**
 	 * The Registry Query Manager URI can be used to obtain information about services and their endPoints.

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -60,8 +60,10 @@
 	public static final String ENCRYPT_FACTORY_CLASS          = "org.jboss.soa.esb.encryption.factory.class";
     public static final String LOAD_BALANCER_POLICY           = "org.jboss.soa.esb.loadbalancer.policy";
     public static final String REDELIVER_DLS_SERVICE_ON       = "org.jboss.soa.esb.dls.redeliver";
-    public static final String REGISTRY_CACHE_LIFE_MILLIES    = "org.jboss.soa.esb.registry.cache.life";
+    public static final String REGISTRY_CACHE_LIFE_MILLIS    = "org.jboss.soa.esb.registry.cache.life";
     public static final String REMOVE_DEAD_EPR                = "org.jboss.soa.esb.failure.detect.removeDeadEPR";
+    	public static final String EXCEPTION_ON_DELIVERY_FAILURE = "org.jboss.soa.esb.exceptionOnDeliverFailure";
+    	
 	/** 
 	 * The Registry Query Manager URI defines the endPoint where registry queries can be made. 
 	 */
@@ -123,7 +125,7 @@
 	public static final String DEFAULT_JNDI_PKG_PREFIX                = "org.jnp.interfaces";
     public static final String DEFAULT_LOAD_BALANCER_POLICY           = "org.jboss.soa.esb.listeners.ha.FirstAvailable";
 	public static final String DEFAULT_REDELIVER_DLS_ON               = "true";
-    public static final String DEFAULT_REGISTRY_CACHE_LIFE_MILLIES    = "60000";
+    public static final String DEFAULT_REGISTRY_CACHE_LIFE_MILLIS    = "60000";
 	/*
 	 * DatabaseMessageStore Persistence Store properties.
 	 */
@@ -175,6 +177,7 @@
 	 */
 	
 	public static final String JMS_MESSAGE_ID = "org.jboss.soa.esb.message.transport.jms.messageID";
+	public static final String JMS_NATIVE_MESSAGE_TYPE = "org.jboss.soa.esb.message.transport.jms.nativeMessageType"; // Text or Object
 	
 	/*
 	 * Filter properties should be identified by:

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierException.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierException.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierException.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -25,7 +25,14 @@
 import org.jboss.soa.esb.BaseException;
 
 /**
- * Dispatch Exception.
+ * General Courier exception. Consider this like SystemException. Other
+ * more specific exceptions will be derived from it. Most CourierExceptions
+ * are for configuration problems.
+ * 
+ * Note: to preserve existing signatures.
+ * Note: an alternative approach would be similar to SQLException or XAException
+ * with specific error codes.
+ * 
  * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
  * @since Version 4.0
  */

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierMarshalUnmarshalException.java (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/rosetta/src/org/jboss/soa/esb/couriers/CourierMarshalUnmarshalException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierMarshalUnmarshalException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierMarshalUnmarshalException.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.soa.esb.couriers;
+
+/**
+ * Problems with the Message that cause delivery to fail. Typically
+ * around marshalling or unmarshalling the Message.
+ * 
+ * @since Version 4.2.1CP2
+ */
+
+public class CourierMarshalUnmarshalException extends CourierException
+{
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Construct an exception instance.
+	 * 
+	 * @param message
+	 *            Exception message.
+	 */
+
+	public CourierMarshalUnmarshalException(String message)
+	{
+		super(message);
+	}
+	
+	public CourierMarshalUnmarshalException(String message, Throwable cause)
+	{
+		super(message, cause);
+	}
+
+	public CourierMarshalUnmarshalException (Throwable cause)
+	{
+	    super(cause);
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierServiceBindException.java (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/rosetta/src/org/jboss/soa/esb/couriers/CourierServiceBindException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierServiceBindException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierServiceBindException.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.soa.esb.couriers;
+
+/**
+ * An error happened during the service bind or look-up. This could be while
+ * communicating with the Registry or afterwards, while trying to
+ * set up (or bind to) the specific service.
+ * 
+ * @since Version 4.2.1CP2
+ */
+
+public class CourierServiceBindException extends CourierException
+{
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Construct an exception instance.
+	 * 
+	 * @param message
+	 *            Exception message.
+	 */
+
+	public CourierServiceBindException(String message)
+	{
+		super(message);
+	}
+	
+	public CourierServiceBindException(String message, Throwable cause)
+	{
+		super(message, cause);
+	}
+
+	public CourierServiceBindException (Throwable cause)
+	{
+	    super(cause);
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierTransportException.java (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/rosetta/src/org/jboss/soa/esb/couriers/CourierTransportException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierTransportException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierTransportException.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.soa.esb.couriers;
+
+/**
+ * Some transport related error was encountered during send or receive.
+ * 
+ * @since Version 4.2.1CP2
+ */
+
+public class CourierTransportException extends CourierException
+{
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Construct an exception instance.
+	 * 
+	 * @param message
+	 *            Exception message.
+	 */
+
+	public CourierTransportException(String message)
+	{
+		super(message);
+	}
+	
+	public CourierTransportException(String message, Throwable cause)
+	{
+		super(message, cause);
+	}
+
+	public CourierTransportException (Throwable cause)
+	{
+	    super(cause);
+	}
+}

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -28,7 +28,6 @@
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
 import java.io.StreamCorruptedException;
@@ -137,6 +136,8 @@
 		
 		while (retry > 0)
 		{
+		    serial = null;
+		    
 			try
 			{
 				reader = new FileInputStream(from);
@@ -149,6 +150,13 @@
 				
 				retry--;
 			}
+			catch (final IOException ex)
+			{
+			    if (serial == null)
+				throw new CourierTransportException(ex);
+			    else
+				throw new CourierMarshalUnmarshalException(ex);
+			}
 			catch (Exception e)
 			{
 				e.printStackTrace();
@@ -235,7 +243,7 @@
             {
                 courier.cleanup() ;
             }
-            catch (Exception e)
+            catch (final Throwable e)
             {
                 _logger.error("Problems invoking clean() Method for class "
                                 +courier.getClass().getSimpleName(),e);

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/lifecycle/LifecycleResourceManager.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/lifecycle/LifecycleResourceManager.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/lifecycle/LifecycleResourceManager.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -346,7 +346,17 @@
                 while(resourceIter.hasNext())
                 {
                     final LifecycleResource<?> resource = resourceIter.next() ;
-                    resource.destroyResources() ;
+                    
+                    try
+                    {
+                	resource.destroyResources() ;
+                    }
+                    catch (final Throwable ex)
+                    {
+                	// log it, but continue on to other resources
+                	
+                	logger.warn("Caught exception "+ex+" during destroyResources.");
+                    }
                 }
             }
             

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -253,18 +253,18 @@
         }
     }
 
-    private File setFileWorking(File file) {
+    protected File setFileWorking(File file) {
         File workingFile = getWorkFileName(file, _workingSuffix);
         
         try {
-            if (!renameFile(file, workingFile)) {
-                return null;
+            if (renameFile(file, workingFile)) {
+                return workingFile;
             }
         } catch (GatewayException e) {
-            _logger.error("Problems renaming file " + file + " to " + workingFile);
+            _logger.error("Unable to rename file '" + file.getAbsolutePath() + "' to it's working name '" + workingFile + "'. May be a contention issue with another listener.  You should avoid having multiple listeners polling on the same file subset.  Ignoring this file for now!");
         }
 
-        return workingFile;
+        return null;
     }
 
     protected File getWorkFileName(File fileIn, String suffix) {

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -37,6 +37,7 @@
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.addressing.EPR;
 import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.client.ServiceInvoker;
 import org.jboss.soa.esb.couriers.Courier;
 import org.jboss.soa.esb.couriers.CourierException;
 import org.jboss.soa.esb.couriers.CourierFactory;
@@ -46,6 +47,7 @@
 import org.jboss.soa.esb.listeners.ListenerUtil;
 import org.jboss.soa.esb.listeners.RegistryUtil;
 import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.services.registry.RegistryException;
 import org.jboss.soa.esb.services.registry.ServiceNotFoundException;
@@ -66,7 +68,6 @@
 	private static final long serialVersionUID = 1L;
 	private ArrayList<HibernateEventBean> m_events;
 	private final static Logger m_logger = Logger.getLogger(HibernateInterceptor.class);
-	private Courier m_courier;
 	
 	protected Class m_composerClass;
 	protected Method m_processMethod;
@@ -74,7 +75,7 @@
 	protected String m_composerName;
 	protected ConfigTree m_config;
 
-	protected Collection<EPR> m_targetEprs;
+	protected ServiceInvoker m_serviceInvoker;
 	protected String m_targetServiceCategory, m_targetServiceName;
         
 	// Event Strings
@@ -109,14 +110,21 @@
 			if (m_targetServiceName == null)
 				throw new ManagedLifecycleException("No target service name defined!");
 			
-            m_targetEprs = RegistryUtil.getEprs(m_targetServiceCategory,m_targetServiceName);
-            if (null == m_targetEprs || m_targetEprs.size() < 1)
-                throw new ManagedLifecycleException("EPR <" + m_targetServiceName + "> not found in registry") ;
+			Collection<EPR> _targetEprs = RegistryUtil.getEprs(m_targetServiceCategory,
+					m_targetServiceName);
+			if (null == _targetEprs || _targetEprs.size() < 1)
+				throw new ManagedLifecycleException("EPR <"
+						+ m_targetServiceName + "> not found in registry");
+			
+			m_serviceInvoker = new ServiceInvoker(m_targetServiceCategory, m_targetServiceName);
         } catch (ServiceNotFoundException snfe) {
-                throw new ManagedLifecycleException("EPR <" + m_targetServiceName + " "
-                        + m_targetServiceName + "> not found in registry");
+        	throw new ManagedLifecycleException("EPR <" + m_targetServiceName + " "
+        			+ m_targetServiceName + "> not found in registry");
         } catch (final RegistryException re) {
-            throw new ManagedLifecycleException("Unexpected registry exception", re) ;
+        	throw new ManagedLifecycleException("Unexpected registry exception", re);
+        } catch (MessageDeliverException mde) {
+			throw new ManagedLifecycleException("EPR <" + m_targetServiceName + " "
+					+ m_targetServiceName + "> not found in registry", mde);
 		} catch (ManagedLifecycleException ex) {
 			throw ex;
 		}
@@ -203,36 +211,10 @@
 		String text = null;
 
 		try {
-			boolean bSent = false;
-			for (EPR current : m_targetEprs) {
-				m_courier = CourierFactory.getCourier(current);
-
-				try {
-					if (m_courier.deliver(message)) {
-						bSent = true;
-                        break;
-					}
-				} finally {
-					CourierUtil.cleanCourier(m_courier) ;
-				}
-			}
-			
-			if (!bSent) {
-				text = "Target service <" + m_targetServiceCategory + "," + m_targetServiceName + "> is not registered";
-				thrown = new Exception(text);
-			}
-		} catch (ClassCastException e) {
+			m_serviceInvoker.deliverAsync(message);
+		} catch (MessageDeliverException e) {
 			thrown = e;
-			text = "Action class method <" + m_processMethod.getName() + "> returned a non Message object";
-		} catch (CourierException e) {
-			thrown = e;
-			text = "Courier <" + m_courier.getClass().getName() + ".deliverAsync(Message) FAILED";
-		} catch (MalformedEPRException ex) {
-			thrown = ex;
-			text = "Courier <" + m_courier.getClass().getName() + ".deliverAsync(Message) FAILED with malformed EPR.";
-		} catch (IllegalArgumentException e) {
-			thrown = e;
-			text = "Courier <" + m_courier.getClass().getName() + ".deliverAsync(Message) FAILED with IllegalArgumentException.";
+			text = "ServiceInvoker <" + m_targetServiceCategory + " " + m_targetServiceName+ ">.deliverAsync(Message) FAILED";
 		}
 		if (null != thrown) {
 			m_logger.error(text);

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -46,11 +46,8 @@
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.addressing.EPR;
 import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.client.ServiceInvoker;
 import org.jboss.soa.esb.common.Environment;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
 import org.jboss.soa.esb.filter.FilterManager;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.helpers.NamingContextException;
@@ -61,6 +58,7 @@
 import org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle;
 import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
 import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleThreadState;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.services.registry.RegistryException;
 import org.jboss.soa.esb.services.registry.ServiceNotFoundException;
@@ -85,15 +83,16 @@
      * @throws ManagedLifecycleException for errors while initialisation.
      */
     protected void doInitialise() throws ManagedLifecycleException {
+    	// Needed to retain prior semantics of fail-on-initialise if service lookup fails
         try {
-            _targetEprs = RegistryUtil.getEprs(_targetServiceCategory,
+        	Collection<EPR> _targetEprs = RegistryUtil.getEprs(_targetServiceCategory,
                     _targetServiceName);
             if (null == _targetEprs || _targetEprs.size() < 1)
                 throw new ManagedLifecycleException("EPR <"
                         + _targetServiceName + "> not found in registry");
-       } catch (ServiceNotFoundException snfe) {
-        throw new ManagedLifecycleException("EPR <" + _targetServiceName + " "
-                + _targetServiceName + "> not found in registry");
+        } catch (ServiceNotFoundException snfe) {
+        	throw new ManagedLifecycleException("EPR <" + _targetServiceName + " "
+            + _targetServiceName + "> not found in registry");
        }
         catch (final RegistryException re) {
             throw new ManagedLifecycleException(
@@ -101,6 +100,12 @@
         }
 
         try {
+        	_serviceInvoker = new ServiceInvoker(_targetServiceCategory, _targetServiceName);
+        } catch (MessageDeliverException e) {
+        	throw new ManagedLifecycleException(e);
+        }
+        
+        try {
             prepareMessageReceiver();
         }
         catch (final ConnectionException ce) {
@@ -174,26 +179,8 @@
                     obj = FilterManager.getInstance().doOutputWork((Message) obj, params);
 
                     try {
-                        boolean bSent = false;
-                        for (EPR current : _targetEprs) {
-                            _courier = CourierFactory.getCourier(current);
-                            try {
-                                if (_courier.deliver((Message) obj)) {
-                                    bSent = true;
-                                    break;
-                                }
-                            }
-                            finally {
-                                CourierUtil.cleanCourier(_courier);
-                            }
-                        }
-                        if (!bSent) {
-                            String text = "Target service <"
-                                    + _targetServiceCategory + ","
-                                    + _targetServiceName
-                                    + "> is not registered";
-                            throw new Exception(text);
-                        }
+                    	Message message = (Message) obj;
+                    	_serviceInvoker.deliverAsync(message);
                     }
                     catch (ClassCastException e) {
                         _logger.error("Action class method <"
@@ -203,15 +190,6 @@
 	                    rollbackJMSTransaction();
                         continue;
                     }
-                    catch (CourierException e) {
-                        String text = (null != _courier) ? "Courier <"
-                                + _courier.getClass().getName()
-                                + ".deliverAsync(Message) FAILED"
-                                : "NULL courier can't deliverAsync Message";
-                        _logger.error(text, e);
-	                    rollbackJMSTransaction();
-                        continue;
-                    }
                     continue;
                 }
                 catch (InvocationTargetException e) {
@@ -518,8 +496,8 @@
 
     protected EPR _myEpr;
 
-    protected Collection<EPR> _targetEprs;
-
+    protected ServiceInvoker _serviceInvoker;
+    
     protected String _composerName;
 
     protected Class _composerClass;
@@ -528,8 +506,6 @@
 
     protected Method _processMethod;
 
-    protected Courier _courier;
-
     protected JmsConnectionPool jmsConnectionPool;
 
     /**

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -47,15 +47,12 @@
 import org.apache.log4j.Logger;
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
 import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+import org.jboss.soa.esb.client.ServiceInvoker;
 import org.jboss.soa.esb.common.Environment;
 import org.jboss.soa.esb.common.TransactionStrategy;
 import org.jboss.soa.esb.common.TransactionStrategyException;
-import org.jboss.soa.esb.couriers.Courier;
 import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
 import org.jboss.soa.esb.filter.FilterManager;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.helpers.persist.JdbcCleanConn;
@@ -63,10 +60,10 @@
 import org.jboss.soa.esb.listeners.ListenerTagNames;
 import org.jboss.soa.esb.listeners.ListenerUtil;
 import org.jboss.soa.esb.listeners.RegistryUtil;
-import org.jboss.soa.esb.listeners.message.MessageDeliverException;
 import org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle;
 import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
 import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleThreadState;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.message.MessagePayloadProxy;
 import org.jboss.soa.esb.message.format.MessageFactory;
@@ -120,8 +117,9 @@
      * @throws ManagedLifecycleException for errors while initialisation.
      */
     protected void doInitialise() throws ManagedLifecycleException {
+    	// Needed to retain prior semantics of fail-on-initialise if service lookup fails
         try {
-            _targetEprs = RegistryUtil.getEprs(_targetServiceCategory,
+            Collection<EPR> _targetEprs = RegistryUtil.getEprs(_targetServiceCategory,
                     _targetServiceName);
             if (null == _targetEprs || _targetEprs.size() < 1)
                 throw new ManagedLifecycleException("EPR <"
@@ -132,9 +130,15 @@
                 + _targetServiceName + "> not found in registry");
         }
         catch (final RegistryException re) {
-            throw new ManagedLifecycleException(
-                    "Unexpected registry exception", re);
+        	throw new ManagedLifecycleException("Unexpected registry exception", re);
         }
+        
+        try {
+        	_serviceInvoker = new ServiceInvoker(_targetServiceCategory, _targetServiceName);
+        	_serviceInvoker.loadServiceClusterInfo();
+        } catch (MessageDeliverException mde) {
+        	throw new ManagedLifecycleException(mde);    		
+        }
 
         boolean failure = true;
         try {
@@ -190,28 +194,14 @@
                             params.put(Environment.GATEWAY_CONFIG, _config);
         
                             message = FilterManager.getInstance().doOutputWork(message, params);
-        
-                            boolean bSent = false;
-                            for (EPR current : _targetEprs) {
-                                _courier = CourierFactory.getCourier(current);
-                                try {
-                                    if (_courier.deliver(message)) {
-                                        bSent = true;
-                                        break;
-                                    }
-                                }
-                                finally {
-                                    CourierUtil.cleanCourier(_courier);
-                                }
-                            }
-                            if (!bSent) {
-                                text = "Target service <" + _targetServiceCategory
-                                        + "," + _targetServiceName
-                                        + "> is not registered";
-                                thrown = new Exception(text);
-                            }
-                        }
-                        catch (InvocationTargetException e) {
+                            
+                            _serviceInvoker.deliverAsync(message);
+                        } catch (MessageDeliverException e) {
+                        	thrown = e;
+                        	text = "Target service <" + _targetServiceCategory
+                        		+ "," + _targetServiceName
+                        		+ "> is not registered";
+                    	} catch (InvocationTargetException e) {
                             thrown = e;
                             text = "Problems invoking method <"
                                     + _processMethod.getName() + ">";
@@ -228,16 +218,10 @@
                         }
                         catch (CourierException e) {
                             thrown = e;
-                            text = "Courier <" + _courier.getClass().getName()
-                                    + ".deliverAsync(Message) FAILED";
+                            text = "Message filter FAILED";
                         }
-                        catch (MalformedEPRException ex) {
-                            thrown = ex;
-                            text = "Courier <"
-                                    + _courier.getClass().getName()
-                                    + ".deliverAsync(Message) FAILED with malformed EPR.";
-                        }
-        
+
+                        
                         if (null == thrown) {
                             if (_deleteAfterOK)
                                 deleteCurrentRow();
@@ -861,9 +845,8 @@
 
     protected String _targetServiceCategory, _targetServiceName;
 
-    protected Collection<EPR> _targetEprs;
-
     protected String _composerName;
+    protected ServiceInvoker _serviceInvoker;
 
     protected Class _composerClass;
 
@@ -871,8 +854,6 @@
 
     protected Method _processMethod;
 
-    protected Courier _courier;
-
     protected String _driver, _url, _user, _password, _datasource;
 
     protected String _tableName, _selectFields, _keyFields, _timestamp;

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JcaMessageAwareListener.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JcaMessageAwareListener.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JcaMessageAwareListener.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -139,7 +139,14 @@
     {
         super.doDestroy();
         
-        pipeline.destroy() ;
+        try
+        {
+            pipeline.destroy() ;
+        }
+        catch (final Throwable ex)
+        {
+        }
+        
         pipeline = null ;
         RegistryUtil.unregister(serviceCategory, serviceName, serviceEPR) ;
     }

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -363,8 +363,19 @@
         {
             if (_execService != null)
             {
-                _execService.shutdown() ;
-                checkExecutorTermination() ;
+        	try
+        	{
+        	    _execService.shutdown() ;
+                    checkExecutorTermination() ;
+        	}
+        	catch (final ManagedLifecycleException ex)
+        	{
+        	    throw ex;
+        	}
+        	catch (final Throwable ex)
+        	{
+        	    _logger.warn("Caught throwable during shutdown: "+ex);
+        	}
             }
 
             pipeline.destroy() ;

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -25,20 +25,21 @@
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.net.URISyntaxException;
 
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.addressing.eprs.FTPEpr;
 import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.message.MessageDeliverException;
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.message.MessagePayloadProxy;
 import org.jboss.soa.esb.message.body.content.BytesBody;
 import org.jboss.soa.esb.util.RemoteFileSystem;
 import org.jboss.soa.esb.util.RemoteFileSystemException;
 import org.jboss.soa.esb.util.RemoteFileSystemFactory;
+import org.jboss.soa.esb.listeners.ListenerUtil;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
 
 /**
  * Sends a message to an outgoing FTP server. The outgoing filename can have
@@ -164,7 +165,7 @@
 	}
 
 	/**
-	 * Builds an FTP EPR from the configutation data.
+	 * Builds an FTP EPR from the configuration data.
 	 * 
 	 * @return FTPEpr
 	 */
@@ -173,10 +174,16 @@
 			ConfigTree ftpConfig = getFtpConfig();
 			String url = ftpConfig.getAttribute(FTPEpr.URL_TAG);
 			try {
-				epr = new FTPEpr(url);
-			} catch (URISyntaxException e) {
-				throw new NotificationException(e);
+			    epr = (FTPEpr) ListenerUtil.fileEprFromElement(ftpConfig);
 			}
+			catch (final ConfigurationException ex)
+			{
+			    throw new NotificationException(ex);
+			}
+			catch (final ClassCastException ex)
+			{
+			    throw new NotificationException("Not an FTPEpr!", ex);
+			}
 		}
 		return epr;
 	}
@@ -187,32 +194,10 @@
 	 * @see org.jboss.soa.esb.notification.NotificationTarget#sendNotification(org.jboss.soa.esb.message.Message)
 	 */
 	public void sendNotification(Message message) throws NotificationException {
-		File fileToSend = null;
-		RemoteFileSystem rfs = null;
-		try {
-			fileToSend = getFileToSend( message );
-			rfs = RemoteFileSystemFactory.getRemoteFileSystem(getFtpEpr(), true);
-			rfs.uploadFile(fileToSend, getFileName(message));
-		} catch (RemoteFileSystemException e) {
-			throw new NotificationException("Could not complete FTP notification", e);
-		} catch (IOException e) {
-			throw new NotificationException("Could not complete FTP notification", e);
-		} finally {
-			if (fileToSend != null) {
-				fileToSend.delete();
-			}
-			if (rfs != null) {
-				rfs.quit();
-			}
-		}
-	}
-	
-	protected File getFileToSend( final Message message ) throws IOException
-	{
 		FileOutputStream stream = null;
 		File tmpFile = null;
-		try 
-		{
+		RemoteFileSystem rfs = null;
+		try {
 			tmpFile = File.createTempFile(TEMP_FILE_BASE, null);
 			stream = new FileOutputStream(tmpFile);
 			
@@ -224,18 +209,25 @@
 				IOUtils.write(payload.toString(), stream);
 			
             stream.close();
-            
+			rfs = RemoteFileSystemFactory.getRemoteFileSystem(getFtpEpr(), true);
+			rfs.uploadFile(tmpFile, getFileName(message));
+        } catch (MessageDeliverException e) {
+            log.error( "MessageDeliveryException while calling getPayLoad : " + e );
+		} catch (RemoteFileSystemException e) {
+			throw new NotificationException("Could not complete FTP notification", e);
+		} catch (IOException e) {
+			throw new NotificationException("Could not complete FTP notification", e);
+		} finally {
+			if (stream != null) {
+				IOUtils.closeQuietly(stream);
+			}
+			if (tmpFile != null) {
+				tmpFile.delete();
         } 
-		catch (MessageDeliverException e) 
-		{
-			log.error( "MessageDeliveryException while calling getPayLoad : " + e );
+			if (rfs != null) {
+				rfs.quit();
 		} 
-		finally 
-		{
-			if (stream != null) 
-				IOUtils.closeQuietly(stream);
 		}
-		return tmpFile;
 	}
 	
 }
\ No newline at end of file

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFiles.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFiles.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFiles.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -34,6 +34,7 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.ObjectOutputStream;
+import java.io.Serializable;
 import java.net.URI;
 import java.net.URISyntaxException;
 
@@ -168,44 +169,57 @@
         final StringBuilder exceptions = new StringBuilder();
 		for (NotificationFile notificationFile : m_oaOutF)
 		{
-			try
+		    try
+		    {
+			fileOutStream = new FileOutputStream(notificationFile,
+				notificationFile.append);
+			Object obj = payloadProxy.getPayload(message);
+
+			/*
+			 * TODO
+			 * 
+			 * Hmmm, why was this keying off the ESB message type? Change it so
+			 * that if it's a byte[] or a String then we'll use the stringNotification.
+			 * Otherwise output as a generic Serializable. Slightly different to other
+			 * notifiers (except JMSNotifier), but probably the best we can do in the
+			 * situation.
+			 * 
+			 * http://jira.jboss.com/jira/browse/JBESB-1607
+			 */
+			
+			if ((obj instanceof Serializable) && !(obj instanceof byte[]) && !(obj instanceof String))
 			{
-				fileOutStream = new FileOutputStream(notificationFile,
-						notificationFile.append);
-				if (MessageType.JAVA_SERIALIZED.equals(message.getType()))
-				{
-                    objectNotification(fileOutStream, payloadProxy.getPayload(message));
-				}
-				else
-				{
-                    Object obj = payloadProxy.getPayload(message);
-                    String content=null;
-                    if (obj instanceof byte[]) {
-                        content = new String((byte[]) obj);
-                    } else {
-                        content = obj.toString();
-                    }
-                    stringNotification(fileOutStream, content);
-				}
+			    objectNotification(fileOutStream, payloadProxy.getPayload(message));
 			}
-			catch (IOException e)
+			else
 			{
-                handleException(notificationFile, e, exceptions);
+			    String content=null;
+			    if (obj instanceof byte[]) {
+				content = new String((byte[]) obj);
+			    } else {
+				content = obj.toString();
+			    }
+			    stringNotification(fileOutStream, content);
 			}
-            catch (MessageDeliverException e) {
-                handleException(notificationFile, e, exceptions);
-            } finally
+		    }
+		    catch (IOException e)
+		    {
+			handleException(notificationFile, e, exceptions);
+		    }
+		    catch (MessageDeliverException e) {
+			handleException(notificationFile, e, exceptions);
+		    } finally
+		    {
+			try
 			{
-				try
-				{
-					if ( fileOutStream != null )
-						fileOutStream.close();
-				}
-				catch (IOException eCl)
-				{
-					log.error( "IOException while closing fileOutStream: ", eCl );
-				}
+			    if ( fileOutStream != null )
+				fileOutStream.close();
 			}
+			catch (IOException eCl)
+			{
+			    log.error( "IOException while closing fileOutStream: ", eCl );
+			}
+		    }
 		}
 		if ( exceptions.length() > 0 )
 			throw new NotificationException( exceptions.toString() );

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -41,6 +41,7 @@
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.listeners.message.MessageDeliverException;
 import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.common.Environment;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.helpers.KeyValuePair;
 import org.jboss.soa.esb.message.body.content.BytesBody;
@@ -64,6 +65,13 @@
  */
 public abstract class NotifyJMS extends NotificationTarget
 {
+    /*
+     * Value can be used to determine how the notification message
+     * will be represented on the JMS "wire".
+     */
+    
+    public static enum NativeMessage { text, object }
+    
     protected Logger log = Logger.getLogger(this.getClass());
 
 	/**
@@ -222,12 +230,37 @@
 	 */
 	public void sendNotification (org.jboss.soa.esb.message.Message esbMessage) throws NotificationException
 	{
+	    /*
+	     * Blah. We do this for backward compatibility.
+	     */
+	    
+	    NativeMessage defaultType = NativeMessage.text;
+	    
+	    if (esbMessage != null)
+	    {
+		if (esbMessage.getType().equals(MessageType.JAVA_SERIALIZED))
+		    defaultType = NativeMessage.object;
+	    }
+	    
+	    /*
+	     * http://jira.jboss.com/jira/browse/JBESB-1606
+	     * 
+	     * Prior to this, the JMS message type transmitted depended on the
+	     * ESB message type! That should be opaque and not affect how the contents
+	     * are transmitted. So we fixed it, but need to provide backward
+	     * compatibility for now. But the old approach/"feature" is essentially
+	     * deprecated.
+	     * 
+	     * http://jira.jboss.com/jira/browse/JBESB-1607
+	     */
+	    
 	    try
 	    {
 		Message jmsMessage = null;
 		Object obj = payloadProxy.getPayload(esbMessage);
-
-		if (MessageType.JAVA_SERIALIZED.equals(esbMessage.getType()))
+		NativeMessage type = (NativeMessage) esbMessage.getProperties().getProperty(Environment.JMS_NATIVE_MESSAGE_TYPE, defaultType);
+		
+		if (type == NativeMessage.object)
 		{
 		    if(obj == null) {
 			// create a null payload message...
@@ -235,7 +268,7 @@
 		    } else if(obj instanceof byte[]) {
 			jmsMessage = sessions[0].createObjectMessage((byte[]) obj);
 		    } else {
-			throw new NotificationException("Expected payload type for '" + MessageType.JAVA_SERIALIZED + "' is byte[].  Recieved '" + obj.getClass().getName() + "'.");
+			throw new NotificationException("Expected payload type for '" + esbMessage.getType() + "' is byte[].  Received '" + obj.getClass().getName() + "'.");
 		    }
 		}
 		else
@@ -248,7 +281,7 @@
 		    }
 		    jmsMessage = sessions[0].createTextMessage(content);
 		}
-
+		
 		setJMSProperties( esbMessage, jmsMessage );
 
 		for (Iterator<Object> II = m_oProps.keySet().iterator(); II.hasNext();)

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/schedule/ScheduleProvider.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/schedule/ScheduleProvider.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/schedule/ScheduleProvider.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -205,7 +205,7 @@
         }
     }
 
-    public static class ESBScheduledJob implements Job {
+    public static class ESBScheduledJob implements StatefulJob {
         public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
             final JobDataMap jobDataMap = jobExecutionContext.getJobDetail().getJobDataMap() ;
             ScheduledEventListener listener = (ScheduledEventListener) jobDataMap.get(ScheduledEventListener.class.getName());

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -44,14 +44,16 @@
    }
 
 
-   public static Registry getRegistry() throws RegistryException
-	{
-      // no synchronized block as there should be a service that initializes this
-      if (singleton != null) return singleton;
-      return createRegistry();
-	}
+    public static Registry getRegistry() throws RegistryException {
+        // no synchronized block as there should be a service that initializes this
+        if (singleton != null) {
+            return singleton;
+        }
 
-   public static Registry createRegistry()
+        return createRegistry();
+    }
+
+    public static Registry createRegistry()
            throws RegistryException
    {
       Registry registry = null;

Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FileUtil.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FileUtil.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FileUtil.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -22,16 +22,20 @@
 
 package org.jboss.soa.esb.util;
 
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+
 import java.io.*;
+import java.util.UUID;
 
-import org.apache.log4j.Logger;
-
 /**
  * Common file utility functions.
  * @author kevin
  */
 public class FileUtil
 {
+    public static final String classInstanceUUID = UUID.randomUUID().toString();
+
     /**
      * The logger for this class.
      */
@@ -45,37 +49,110 @@
      */
     public static boolean renameTo(final File from, final File to)
     {
+        AssertArgument.isNotNull(from, "from");
+        AssertArgument.isNotNull(to, "to");
+
+        if(!from.exists())
+        {
+            LOGGER.debug("Unable to rename file '" + from.getAbsolutePath() + "' to '" + to.getAbsolutePath() + "'.  '" + from.getAbsolutePath() + "' doesn't exist.");
+            return false;
+        }
+
+        if(to.exists()) {
+            LOGGER.debug("Unable to rename file '" + from.getAbsolutePath() + "' to '" + to.getAbsolutePath() + "'.  '" + to.getAbsolutePath() + "' already exist.");
+            return false;
+        }
+
         if (!from.renameTo(to))
         {
-            final File tmpFile ;
-            try
+            // The rename may have failed because it's really a file move that's being requested i.e.
+            // move the file to a different partition and the local VM doesn't supporting this
+            // in the rename. So we try moving the file...
+            return moveFile(from, to);
+        }
+        
+        return true;
+    }
+
+    /**
+     * Moves a "from" file to a "to" file through copying of the file contents.
+     * <p/>
+     * This is not a file rename.
+     * 
+     * @param from The source file.
+     * @param to The target file.
+     * @return True if the move was successful, otherwise false.
+     */
+    public static boolean moveFile(File from, File to)
+    {
+        AssertArgument.isNotNull(from, "from");
+        AssertArgument.isNotNull(to, "to");
+
+        if(!from.exists())
+        {
+            LOGGER.debug("Unable to move file '" + from.getAbsolutePath() + "' to '" + to.getAbsolutePath() + "'.  '" + from.getAbsolutePath() + "' doesn't exist.");
+            return false;
+        }
+
+        if(to.exists()) {
+            LOGGER.debug("Unable to move file '" + from.getAbsolutePath() + "' to '" + to.getAbsolutePath() + "'.  '" + to.getAbsolutePath() + "' already exist.");
+            return false;
+        }
+
+        // Before doing the copy, we perform a local rename of the from file.  This is to make
+        // sure that the file is not picked up by another processor while the copy is taking place.
+        // We prefix and postfix the UUID on the rename file, because we don't know the filter pattern being
+        // used by the processors on picking up these files.  This still doesn't guarantee that the rename file
+        // is not picked up too, but it is "stronger"!
+
+        File fromFileDir = from.getParentFile();
+        File fromLocalRename = new File(fromFileDir, classInstanceUUID + "." + from.getName() + "." + classInstanceUUID);
+
+        if(!from.renameTo(fromLocalRename))
+        {
+                LOGGER.debug("Unable to perform local rename of file '" + from.getAbsolutePath() + "' to '" + fromLocalRename.getAbsolutePath() + "'.  Unable to move file.");
+                return true;
+        }
+
+        if(!fromLocalRename.exists())
+        {
+            LOGGER.debug("Failed to perform local rename of file '" + from.getAbsolutePath() + "' to '" + fromLocalRename.getAbsolutePath() + "'.  Unable to move file.");
+            return true;
+        }
+
+        final File tmpFile ;
+        try
+        {
+            tmpFile = File.createTempFile("copy", ".tmp", to.getParentFile()) ;
+        }
+        catch (final IOException ioe)
+        {
+            LOGGER.debug("Could not create temporary file for writing", ioe) ;
+            return true;
+        }
+
+        try
+        {
+            copyFile(fromLocalRename, tmpFile) ;
+            if (!tmpFile.renameTo(to))
             {
-                tmpFile = File.createTempFile("copy", ".tmp", to.getParentFile()) ;
-            }
-            catch (final IOException ioe)
-            {
-                LOGGER.debug("Could not create temporary file for writing", ioe) ;
+                LOGGER.debug("Could not rename temporary file " + tmpFile.getAbsolutePath()) ;
                 return false ;
             }
-            
-            try
-            {
-                copyFile(from, tmpFile) ;
-                if (!tmpFile.renameTo(to))
-                {
-                    LOGGER.debug("Could not rename temporary file " + tmpFile.getAbsolutePath()) ;
-                    return false ;
-                }
-                from.delete();
+            if(!fromLocalRename.delete()) {
+                LOGGER.debug("Failed to delete local rename file '" + fromLocalRename.getAbsolutePath() + "'.");
+                // This is not desireable, but shouldn't be fatal because the from file no longer exists
+                // and the to file has been successfully created.
             }
-            finally
-            {
-                tmpFile.delete() ;
-            }
         }
+        finally
+        {
+            tmpFile.delete() ;
+        }
+        
         return true;
     }
-    
+
     /**
      * Attempt to copy the file.
      * @param from The original file

Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -80,8 +80,9 @@
 	@Test
 	public void publishOrganization() 
 	{
+        JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
 		try {
-			Organization org = JAXRRegistryImpl.createJBossESBOrganization();
+			Organization org = JAXRRegistryImpl.createJBossESBOrganization(jaxrConnectionFactory);
 			logger.debug("Succesfully created organization: " + org.getName().getValue());
 			assertEquals("Red Hat/JBossESB", org.getName().getValue());
 		} catch (JAXRException je) {
@@ -92,8 +93,9 @@
 	@Test
 	public void findOrganization() 
 	{
+        JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
 		try {
-			Organization org = JAXRRegistryImpl.findOrganization("Red Hat/JBossESB");
+			Organization org = JAXRRegistryImpl.findOrganization("Red Hat/JBossESB", jaxrConnectionFactory);
 			logger.debug("Succesfully created organization: " + org.getName().getValue());
 			assertEquals("Red Hat/JBossESB", org.getName().getValue());
 		} catch (JAXRException je) {
@@ -101,7 +103,7 @@
 			assertTrue(false);
 		}
 		try {
-			Organization org = JAXRRegistryImpl.findOrganization("Not Existing Org");
+			Organization org = JAXRRegistryImpl.findOrganization("Not Existing Org", jaxrConnectionFactory);
 			logger.debug("Could not find non-existing organization.");
 			assertEquals(null, org);
 		} catch (JAXRException je) {
@@ -151,8 +153,9 @@
 	@Test
 	public void findServicesForAnOrganization()
     {
+        JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
 		try {
-			Organization org = JAXRRegistryImpl.findOrganization("Red Hat/JBossESB");
+			Organization org = JAXRRegistryImpl.findOrganization("Red Hat/JBossESB", jaxrConnectionFactory);
 			//Listing out the services and their Bindings
 			logger.debug("-------------------------------------------------");
 			logger.debug("Organization name: " + org.getName().getValue());
@@ -187,7 +190,8 @@
 	 */
 	public void findServicesByClassification()
 	{
-		Connection connection = JAXRRegistryImpl.getConnection();
+        JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
+        Connection connection = jaxrConnectionFactory.getConnection();
 		try {
 			// Get registry service and business query manager
 			RegistryService rs = connection.getRegistryService();
@@ -210,7 +214,9 @@
 		} catch (JAXRException je) {
 			logger.error(je);
 		}
-		finally{}
+		finally{
+            jaxrConnectionFactory.closeConnection(connection);
+        }
 	}
 	/**
 	 * Setup the database.

Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessorUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessorUnitTest.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessorUnitTest.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -24,10 +24,8 @@
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.actions.ActionLifecycleException;
 import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionUtils;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.body.content.BytesBody;
 import org.jboss.soa.esb.message.format.MessageFactory;
 
 /**
@@ -45,10 +43,35 @@
         GroovyActionProcessor processor = new GroovyActionProcessor(config);
         Message message = MessageFactory.getInstance().getMessage();
 
-        assertProcessingOK(processor, message, messageContents);
+        assertProcessingOK(processor, message, messageContents, null);
     }
 
-    public void test_script_inlined() throws ConfigurationException, ActionLifecycleException, ActionProcessingException {
+    public void test_script_caching_on() throws ConfigurationException, ActionLifecycleException, ActionProcessingException {
+        ConfigTree config = getConfig("test.groovy");
+        GroovyActionProcessor processor = new GroovyActionProcessor(config);
+        Message message = MessageFactory.getInstance().getMessage();
+
+        processor.initialise();
+        // Test script caching...
+        assertTrue("script should not be null", processor.getScript(message) != null);
+        assertTrue("script should be cached", processor.getScript(message) == processor.getScript(message));                
+    }
+
+    public void test_script_caching_off() throws ConfigurationException, ActionLifecycleException, ActionProcessingException {
+        ConfigTree config = getConfig("test.groovy");
+        GroovyActionProcessor processor;
+        Message message = MessageFactory.getInstance().getMessage();
+
+        config.setAttribute("cacheScript", "false");
+        processor = new GroovyActionProcessor(config);
+
+        processor.initialise();
+        // Test script caching...
+        assertTrue("script should not be null", processor.getScript(message) != null);
+        assertTrue("script should not be cached", processor.getScript(message) != processor.getScript(message));
+    }
+
+    public void test_script_inlined_fail() throws ConfigurationException, ActionLifecycleException, ActionProcessingException {
         ConfigTree config = new ConfigTree("<config/>");
         String messageContents = "Hello World - Inlined!";
 
@@ -61,17 +84,41 @@
         message.getBody().add("import org.jboss.soa.esb.message.*\n" +
                 "message.getBody().add(config.getAttribute(\"messageContents\").getBytes());");
 
-        assertProcessingOK(processor, message, messageContents);
+        assertProcessingOK(processor, message, messageContents, "'script' not configured on the action and message based scripting is not enabled ('supportMessageBasedScripting=false').");
     }
 
-    private void assertProcessingOK(GroovyActionProcessor processor, Message message, String messageContents) throws ActionLifecycleException, ActionProcessingException {
-        processor.initialise();
-        processor.process(message);
-        byte[] bodyContents = (byte[]) message.getBody().get();
-        assertNotNull("Expected body contents to be set.", bodyContents);
-        assertEquals(messageContents, new String(bodyContents));
+    public void test_script_inlined_success() throws ConfigurationException, ActionLifecycleException, ActionProcessingException {
+        ConfigTree config = new ConfigTree("<config/>");
+        String messageContents = "Hello World - Inlined!";
+
+        config.setAttribute("messageContents", messageContents);
+        config.setAttribute("supportMessageBasedScripting", "true");
+
+        GroovyActionProcessor processor = new GroovyActionProcessor(config);
+        Message message = MessageFactory.getInstance().getMessage();
+
+        // Set the script as the message task object...
+        message.getBody().add("import org.jboss.soa.esb.message.*\n" +
+                "message.getBody().add(config.getAttribute(\"messageContents\").getBytes());");
+
+        assertProcessingOK(processor, message, messageContents, null);
     }
 
+    private void assertProcessingOK(GroovyActionProcessor processor, Message message, String messageContents, String errorMessage) throws ActionLifecycleException, ActionProcessingException {
+        try {
+            processor.initialise();
+            processor.process(message);
+            byte[] bodyContents = (byte[]) message.getBody().get();
+            assertNotNull("Expected body contents to be set.", bodyContents);
+            assertEquals(messageContents, new String(bodyContents));
+            if(errorMessage != null) {
+                fail("Expected error message: \"" + errorMessage + "\".");
+            }
+        } catch(ActionLifecycleException e) {
+            assertEquals(errorMessage, e.getMessage());
+        }
+    }
+
     private ConfigTree getConfig(String script) {
         ConfigTree config = new ConfigTree("<config/>");
 

Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultJdbcReplyToEprUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultJdbcReplyToEprUnitTest.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultJdbcReplyToEprUnitTest.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -33,8 +33,11 @@
 import org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier;
 import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
 import org.jboss.soa.esb.addressing.util.DefaultReplyTo;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
 import org.jboss.soa.esb.couriers.CourierFactory;
 import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierTimeoutException;
 import org.jboss.soa.esb.helpers.persist.JdbcCleanConn;
 import org.jboss.soa.esb.helpers.persist.SimpleDataSource;
 import org.jboss.soa.esb.message.Message;
@@ -118,52 +121,43 @@
 
     
   @Test
-    public void testJdbcReplyEpr()
-    {
+    public void testJdbcReplyEpr() throws MalformedEPRException, CourierException, URISyntaxException, CourierTimeoutException {
   		_logger.info("_________________________________________");
     	_logger.info("testJdbcReplyEpr() invoked");
-        try
-        {
-        	//  Send a Message that will be picked up by a listener, and specify replyTo
-        	JDBCEpr toEpr = getEpr("foo");
-        	JDBCEpr replyToEpr = (JDBCEpr)DefaultReplyTo.getReplyTo(toEpr);
+        //  Send a Message that will be picked up by a listener, and specify replyTo
+        JDBCEpr toEpr = getEpr("foo");
+        JDBCEpr replyToEpr = (JDBCEpr)DefaultReplyTo.getReplyTo(toEpr);
 
-        	String text_1 = "Outgoing";
-        	Message outgoingMsg = MessageFactory.getInstance().getMessage();
-        	outgoingMsg.getHeader().getCall().setTo(toEpr);
-        	outgoingMsg.getHeader().getCall().setReplyTo(replyToEpr);
-        	outgoingMsg.getBody().add(text_1.getBytes());
-        	CourierUtil.deliverMessage(outgoingMsg);
+        String text_1 = "Outgoing";
+        Message outgoingMsg = MessageFactory.getInstance().getMessage();
+        outgoingMsg.getHeader().getCall().setTo(toEpr);
+        outgoingMsg.getHeader().getCall().setReplyTo(replyToEpr);
+        outgoingMsg.getBody().add(text_1.getBytes());
+        CourierUtil.deliverMessage(outgoingMsg);
 
-        	// Mock a service that picks up the original message and replies
-        	JDBCEpr serviceEpr = getEpr("foo");
-        	PickUpOnlyCourier listener = CourierFactory.getPickupCourier(serviceEpr);
-        	Message received = listener.pickup(100);
-        	String text_2 = new String((byte[]) received.getBody().get());
-        	assertTrue(text_1.equals(text_2));
+        // Mock a service that picks up the original message and replies
+        JDBCEpr serviceEpr = getEpr("foo");
+        PickUpOnlyCourier listener = CourierFactory.getPickupCourier(serviceEpr);
+        Message received = listener.pickup(100);
+        String text_2 = new String((byte[]) received.getBody().get());
+        assertTrue(text_1.equals(text_2));
 //        	assertTrue(replyToEpr.equals(received.getHeader().getCall().getReplyTo()));
-        	
-        	// now respond to replyTo
-        	text_2	+= " + processed by listener";
-        	Message response = MessageFactory.getInstance().getMessage();
-        	response.getHeader().getCall().setTo(received.getHeader().getCall().getReplyTo());
-        	response.getBody().add(text_2.getBytes());
-        	CourierUtil.deliverMessage(response);
-        	
-        	// try to pick up reply
-        	PickUpOnlyCourier waiter = CourierFactory.getPickupCourier(replyToEpr);
-        	Message finalMsg = waiter.pickup(100);
-        	assertTrue(text_2.equals(new String((byte[]) finalMsg.getBody().get())));
-        	
-        	_logger.info(text_2+"... and back from jdbc ReplyTo EPR");
-        	_logger.info("getDefaultReplyToEpr test succeeded for JDBC message transport");
 
-        }
-        catch (Exception e)
-        {
-  			_logger.error(e);
-            assertTrue(false);
-        }
+        // now respond to replyTo
+        text_2	+= " + processed by listener";
+        Message response = MessageFactory.getInstance().getMessage();
+        response.getHeader().getCall().setTo(received.getHeader().getCall().getReplyTo());
+        response.getBody().add(text_2.getBytes());
+        CourierUtil.deliverMessage(response);
+
+        // try to pick up reply
+        PickUpOnlyCourier waiter = CourierFactory.getPickupCourier(replyToEpr);
+        Message finalMsg = waiter.pickup(100);
+        assertTrue(text_2.equals(new String((byte[]) finalMsg.getBody().get())));
+
+        _logger.info(text_2+"... and back from jdbc ReplyTo EPR");
+        _logger.info("getDefaultReplyToEpr test succeeded for JDBC message transport");
+
     }
 	private static void dropTable(String tableName) throws Exception
 	{

Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListenerUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListenerUnitTest.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListenerUnitTest.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -24,10 +24,13 @@
 
 import java.io.File;
 import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.MalformedURLException;
 
 import org.apache.log4j.Logger;
 import org.jboss.internal.soa.esb.services.registry.MockRegistry;
 import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.services.registry.RegistryException;
 import org.jboss.soa.esb.common.tests.BaseTest;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.listeners.ListenerTagNames;
@@ -39,39 +42,45 @@
 public class FileGatewayListenerUnitTest extends BaseTest
 {
 	private Logger log = Logger.getLogger( FileGatewayListenerUnitTest.class );
-	
-	public FileGatewayListenerUnitTest ()
+
+    private File tmpDir = new File(System.getProperty("user.dir")) ;
+    private File dir1 = new File(tmpDir, FileGatewayListenerUnitTest.class.getSimpleName());
+    private File dir2 = new File(tmpDir, FileGatewayListenerUnitTest.class.getSimpleName());
+    private File file1 = new File(dir1, "file1");
+    private final File file2 = new File(dir2, "file2");
+
+    public FileGatewayListenerUnitTest ()
 	{
-	}
+    }
 	
 	public void setUp()
 	{
 		MockRegistry.install();
-	}
-	
-	public void tearDown()
+        cleanupTemps();
+        dir1.mkdirs();
+        dir2.mkdirs();
+    }
+
+    public void tearDown()
 	{
+        cleanupTemps();
 		MockRegistry.uninstall();
 	}
 
-	public void testGateway () throws Exception
+    private void cleanupTemps() {
+        file1.delete();
+        file2.delete();
+        dir1.delete();
+        dir2.delete();
+    }
+
+    public void testGateway () throws Exception
 	{
-		ConfigTree tree = new ConfigTree("test");
-		final File tmpDir = new File(System.getProperty("user.dir")) ;
-		final String tmpDirForm = tmpDir.toURL().toExternalForm() ;
+        ConfigTree tree = createTestListenerConfig();
+        FileGatewayListener gateway = new FileGatewayListener(tree);
 
-		tree.setAttribute("inputDir", tmpDirForm);
-		tree.setAttribute("target-service-category", "Example");
-		tree.setAttribute("target-service-name", "Test");
-		tree.setAttribute("gatewayClass", "org.jboss.soa.esb.listeners.gateway.FileGatewayListener");
-		tree.setAttribute("inputSuffix", "dummy");
-		tree.setAttribute("workSuffix", "work");
-		tree.setAttribute("postDelete", "true");
-		tree.setAttribute(ListenerTagNames.POLL_LATENCY_SECS_TAG, "abcd");
+        boolean exception = false;
 		
-		FileGatewayListener gateway = new FileGatewayListener(tree);
-		boolean exception = false;
-		
 		try
 		{
 			gateway.seeIfOkToWorkOnDir(new File("foobarDir"));
@@ -199,5 +208,72 @@
 			anTestFile.delete();
 		}
 	}
-	
+
+    public void test_rename_ok() throws GatewayException, IOException, RegistryException, ConfigurationException {
+        ConfigTree tree = createTestListenerConfig();
+
+        FileGatewayListener gateway = new FileGatewayListener(tree) {
+            protected File getWorkFileName(File fileIn, String suffix) {
+                return file2;
+            }
+        };
+
+        file1.createNewFile();
+        assertTrue(file1.exists());
+        assertTrue(!file2.exists());
+
+        File workingFile = gateway.setFileWorking(file1);
+        assertNotNull(workingFile);
+        assertTrue(!file1.exists());
+        assertTrue(file2.exists());
+        assertTrue(file2.equals(workingFile));
+    }
+
+    public void test_rename_no_from_file() throws GatewayException, IOException, RegistryException, ConfigurationException {
+        ConfigTree tree = createTestListenerConfig();
+
+        FileGatewayListener gateway = new FileGatewayListener(tree) {
+            protected File getWorkFileName(File fileIn, String suffix) {
+                return file2;
+            }
+        };
+
+        assertTrue(!file1.exists());
+        assertTrue(!file2.exists());
+
+        assertNull(gateway.setFileWorking(file1));
+    }
+
+    public void test_rename_to_file_exists() throws GatewayException, IOException, RegistryException, ConfigurationException {
+        ConfigTree tree = createTestListenerConfig();
+
+        FileGatewayListener gateway = new FileGatewayListener(tree) {
+            protected File getWorkFileName(File fileIn, String suffix) {
+                return file2;
+            }
+        };
+
+        file2.createNewFile();
+        assertTrue(!file1.exists());
+        assertTrue(file2.exists());
+
+        assertNull(gateway.setFileWorking(file1));
+    }
+
+    private ConfigTree createTestListenerConfig() throws MalformedURLException, ConfigurationException, RegistryException, GatewayException {
+        ConfigTree tree = new ConfigTree("test");
+        final File tmpDir = new File(System.getProperty("user.dir")) ;
+        final String tmpDirForm = tmpDir.toURL().toExternalForm() ;
+
+        tree.setAttribute("inputDir", tmpDirForm);
+        tree.setAttribute("target-service-category", "Example");
+        tree.setAttribute("target-service-name", "Test");
+        tree.setAttribute("gatewayClass", "org.jboss.soa.esb.listeners.gateway.FileGatewayListener");
+        tree.setAttribute("inputSuffix", "dummy");
+        tree.setAttribute("workSuffix", "work");
+        tree.setAttribute("postDelete", "true");
+        tree.setAttribute(ListenerTagNames.POLL_LATENCY_SECS_TAG, "abcd");
+
+        return tree;
+    }
 }

Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyQueuesUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyQueuesUnitTest.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyQueuesUnitTest.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -46,6 +46,7 @@
 import org.apache.log4j.Logger;
 import org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException;
 import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.common.Environment;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.helpers.NamingContextException;
 import org.jboss.soa.esb.helpers.NamingContextPool;
@@ -121,6 +122,7 @@
 	public void test_NonStringObj() throws Exception {
         org.jboss.soa.esb.message.Message message = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
         message.getBody().add(((new Integer(123).toString().getBytes())));
+        message.getProperties().setProperty(Environment.JMS_NATIVE_MESSAGE_TYPE, NotifyJMS.NativeMessage.object);
 		notifyQueues.sendNotification(message);
 		
 		checkQueueObjectMessage(mockQueue1, 0, new Integer(123).toString().getBytes());
@@ -131,6 +133,7 @@
 	public void sendNotification_without_body() 
 	{
         org.jboss.soa.esb.message.Message message = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+        message.getProperties().setProperty(Environment.JMS_NATIVE_MESSAGE_TYPE, NotifyJMS.NativeMessage.object);
 		try
 		{
 			notifyQueues.sendNotification(message);

Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyTopicsUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyTopicsUnitTest.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyTopicsUnitTest.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -41,6 +41,7 @@
 
 import org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException;
 import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.common.Environment;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.helpers.NamingContextException;
 import org.jboss.soa.esb.helpers.NamingContextPool;
@@ -97,6 +98,7 @@
 	
 	public void test_NonStringObj() throws Exception {
         org.jboss.soa.esb.message.Message message = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+        message.getProperties().setProperty(Environment.JMS_NATIVE_MESSAGE_TYPE, NotifyJMS.NativeMessage.object);
         message.getBody().add((new Integer(123).toString().getBytes()));
 		notifyTopics.sendNotification(message);
 		

Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/MockScheduledEventListener.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/MockScheduledEventListener.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/MockScheduledEventListener.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -29,11 +29,15 @@
     public static ConfigTree config;
     public static boolean onSchedule;
     public static boolean uninitialised;
+    public static int execCount;
+    public static long sleep;
 
     public static void reset() {
         config = null;
         onSchedule = false;
         uninitialised = false;
+        execCount = 0;
+        sleep = 0;
     }
 
     public void initialize(ConfigTree config) {
@@ -42,6 +46,14 @@
 
     public void onSchedule() throws SchedulingException {
         onSchedule = true;
+        execCount++;
+        if(sleep > 0) {
+            try {
+                Thread.sleep(sleep);
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+        }
     }
 
     public void uninitialize() {

Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/SchedulingUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/SchedulingUnitTest.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/SchedulingUnitTest.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -85,6 +85,14 @@
         assertTrue(MockScheduledEventMessageComposer.composedMessages.size() > 1);
     }
 
+    public void test_simple_schedule_03_1() throws UnsupportedEncodingException, ParamRepositoryException, ConfigurationException, ManagedLifecycleException, SAXException, InterruptedException {
+        MockScheduledEventListener.sleep = 6000;
+        runTestConfig("config-03.1.xml", 7000);
+
+        // Just check that the schedule wasn't run concrurrently...
+        assertTrue(MockScheduledEventListener.execCount < 3);
+    }
+
     public void test_simple_schedule_04() throws UnsupportedEncodingException, ParamRepositoryException, ConfigurationException, ManagedLifecycleException, SAXException, InterruptedException {
         runTestConfig("config-04.xml", 5000);
 

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/config-03.1.xml (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/rosetta/tests/src/org/jboss/soa/esb/schedule/config-03.1.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/config-03.1.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/schedule/config-03.1.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,17 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+
+    <services>
+        <service category="ServiceCat" name="ServiceName" description="Test Service">
+
+            <listeners>
+                <scheduled-listener name="simple-schedule-listener" schedule-frequency="1" event-processor="org.jboss.soa.esb.schedule.MockScheduledEventListener" />
+            </listeners>
+
+            <actions>
+                <action name="action" class="org.jboss.soa.esb.mock.MockAction" />
+            </actions>			
+        </service>
+    </services>
+
+</jbossesb>
\ No newline at end of file

Modified: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/FileUtil.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/FileUtil.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/FileUtil.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -67,6 +67,7 @@
         reader.close();
         return sb.toString();
     }
+
     /**
      * Write a String into a file.
      * @param file - File to which we write the String

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/FileUtilUnitTest.java (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/rosetta/tests/src/org/jboss/soa/esb/util/FileUtilUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/FileUtilUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/FileUtilUnitTest.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.util;
+
+import junit.framework.TestCase;
+
+import java.io.*;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class FileUtilUnitTest extends TestCase {
+
+    private File tmpDir = new File(System.getProperty("user.dir")) ;
+    private File dir1 = new File(tmpDir, FileUtilUnitTest.class.getSimpleName());
+    private File dir2 = new File(tmpDir, FileUtilUnitTest.class.getSimpleName());
+    private File file1 = new File(dir1, "file1");
+    private final File file2 = new File(dir2, "file2");
+
+    protected void setUp() throws Exception {
+        cleanupTemps();
+        dir1.mkdirs();
+        dir2.mkdirs();
+    }
+
+    protected void tearDown() throws Exception {
+        cleanupTemps();
+    }
+
+    public void test_moveTo_good() throws IOException {
+        writeToFile(file1, "Hi there!");
+
+        assertTrue(file1.exists());
+        assertTrue(!file2.exists());
+
+        assertTrue(FileUtil.moveFile(file1, file2));
+
+        assertTrue(!file1.exists());
+        assertTrue(file2.exists());
+
+        assertEquals("Hi there!", FileUtil.readTextFile(file2));        
+    }
+
+    public void test_moveTo_from_doesnt_exists() throws IOException {
+        assertTrue(!FileUtil.moveFile(file1, file2));
+    }
+
+    public void test_moveTo_to_exists() throws IOException {
+        file2.createNewFile();
+        assertTrue(!FileUtil.moveFile(file1, file2));
+    }
+
+    private void cleanupTemps() {
+        file1.delete();
+        file2.delete();
+        dir1.delete();
+        dir2.delete();
+    }
+
+    public static void writeToFile(File file, String str) throws IOException {
+        Writer writer = new FileWriter(file);
+        writer.write(str);
+        writer.close();
+    }
+}

Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/processDefinition/processdefinition.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/processDefinition/processdefinition.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/processDefinition/processdefinition.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -26,7 +26,6 @@
       <action name="action2" class="org.jboss.soa.esb.services.jbpm.actionhandlers.EsbActionHandler">
          <esbCategoryName>BPM_Orchestration_Service2</esbCategoryName>
          <esbServiceName>Service2</esbServiceName>
-         <millisToWaitForResponse>5000</millisToWaitForResponse>
          <bpmToEsbVars>
          	<mapping bpm="theBody" esb="BODY_CONTENT" />
          </bpmToEsbVars>

Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/jboss-esb.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -73,7 +73,7 @@
                 <jms-listener name="ESB-Listener" busidref="startEsbChannel"
                 maxThreads="1"/>
             </listeners>
-            <actions>
+            <actions mep="OneWay">
                 <action name="testStore" class="org.jboss.soa.esb.actions.TestMessageStore"/>
 				<action name="dump1" class="org.jboss.soa.esb.actions.SystemPrintln">
                    		<property name="printfull" value="true"/>

Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/readme.txt	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration2/readme.txt	2008-04-18 14:22:42 UTC (rev 19625)
@@ -70,53 +70,46 @@
 
     esb-name maps to Message.getBody().get("esbMsgVar1")
     "BODY_CONTENT" maps to Message.getBody()
+
+Sample Output from "ant deployProcess": 
+======================================
+13:14:07,359 INFO  [CommandExecutor] Process Definition 'bpm_orchestration2Process' is deployed.
+13:14:07,396 INFO  [STDOUT] Process Definition Deployed: 
+13:14:07,396 INFO  [STDOUT] [Hello World: Deploy the process def].
 
 Sample Output from "ant startProcess":
-======================================
-11:18:50,656 INFO  [STDOUT] ** Begin Receive Order - Service 1 **
-11:18:50,765 INFO  [STDOUT] In: Getting Started
-11:18:50,765 INFO  [STDOUT] Out: Getting Started 'Receive Order'
-11:18:50,765 INFO  [STDOUT] ** End Receive Order - Service 1 **
-11:18:51,640 INFO  [STDOUT] ** Begin Credit Check - Service 3 **
-11:18:51,640 INFO  [STDOUT] In: Getting Started 'Receive Order'
-11:18:51,640 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check'
-
-11:18:51,640 INFO  [STDOUT] ** End Credit Check - Service 3 **
-11:18:52,312 INFO  [STDOUT] ** Begin Validate Order - Service 2 **
-11:18:52,312 INFO  [STDOUT] In: Getting Started 'Receive Order'  'Credit Check'
-
-11:18:52,312 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check'
-  'Validate Order'
-11:18:52,312 INFO  [STDOUT] ** End Validate Order - Service 2 **
-11:18:52,828 INFO  [STDOUT] ** Begin Inventory Check - Service 4 **
-11:18:52,828 INFO  [STDOUT] In: Getting Started 'Receive Order'  'Credit Check'
- 'Validate Order'
-11:18:52,828 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check'
-  'Validate Order'  'Inventory Check'
-11:18:52,828 INFO  [STDOUT] ** End Inventory Check - Service 4 **
-11:18:53,359 INFO  [STDOUT] ** Begin Atlanta - Service 7 **
-11:18:53,359 INFO  [STDOUT] In: Getting Started 'Receive Order'  'Credit Check'
- 'Validate Order'  'Inventory Check'
-11:18:53,359 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check'
-  'Validate Order'  'Inventory Check'  'Atlanta'
-11:18:53,359 INFO  [STDOUT] ** End Atlanta - Service 7 **
-11:18:53,734 INFO  [STDOUT] ** Begin Dallas - Service 6 **
-11:18:53,734 INFO  [STDOUT] In: Getting Started 'Receive Order'  'Credit Check'
- 'Validate Order'  'Inventory Check'  'Atlanta'
-11:18:53,734 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check'
-  'Validate Order'  'Inventory Check'  'Atlanta'  'Dallas'
-11:18:53,734 INFO  [STDOUT] ** End Dallas - Service 6 **
-11:18:54,078 INFO  [STDOUT] ** Begin Los Angeles - Service 5 **
-11:18:54,093 INFO  [STDOUT] In: Getting Started 'Receive Order'  'Credit Check'
- 'Validate Order'  'Inventory Check'  'Atlanta'  'Dallas'
-11:18:54,093 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check'
-  'Validate Order'  'Inventory Check'  'Atlanta'  'Dallas'  'Los Angeles'
-11:18:54,093 INFO  [STDOUT] ** End Los Angeles - Service 5 **
-11:18:54,234 INFO  [STDOUT] Very simple BPM Process ActionHandler
-11:18:54,453 INFO  [MessageSpy] Body: Getting Started 'Receive Order'  'Credit C
-heck'  'Validate Order'  'Inventory Check'  'Atlanta'  'Dallas'  'Los Angeles'
-11:18:54,640 INFO  [STDOUT] SUCCESS!:
-11:18:54,640 INFO  [STDOUT] [Getting Started 'Receive Order'  'Credit Check'  'V
-alidate Order'  'Inventory Check'  'Atlanta'  'Dallas'  'Los Angeles' ].
-11:18:54,937 INFO  [MessageSpy] Body: Getting Started 'Receive Order'  'Credit C
-heck'  'Validate Order'  'Inventory Check'  'Atlanta'  'Dallas'  'Los Angeles'
\ No newline at end of file
+======================================
+13:18:38,451 INFO  [STDOUT] ** Begin Receive Order - Service 1 **
+13:18:38,451 INFO  [STDOUT] In: Getting Started
+13:18:38,451 INFO  [STDOUT] Out: Getting Started 'Receive Order' 
+13:18:38,451 INFO  [STDOUT] ** End Receive Order - Service 1 **
+13:18:38,553 INFO  [STDOUT] ** Begin Credit Check - Service 3 **
+13:18:38,554 INFO  [STDOUT] In: Getting Started 'Receive Order' 
+13:18:38,554 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check' 
+13:18:38,554 INFO  [STDOUT] ** End Credit Check - Service 3 **
+13:18:38,651 INFO  [STDOUT] ** Begin Validate Order - Service 2 **
+13:18:38,651 INFO  [STDOUT] In: Getting Started 'Receive Order'  'Credit Check' 
+13:18:38,651 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check'  'Validate Order' 
+13:18:38,651 INFO  [STDOUT] ** End Validate Order - Service 2 **
+13:18:38,736 INFO  [STDOUT] ** Begin Inventory Check - Service 4 **
+13:18:38,736 INFO  [STDOUT] In: Getting Started 'Receive Order'  'Credit Check'  'Validate Order' 
+13:18:38,736 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check' 
+13:18:38,736 INFO  [STDOUT] ** End Inventory Check - Service 4 **
+13:18:38,847 INFO  [STDOUT] ** Begin Los Angeles - Service 5 **
+13:18:38,847 INFO  [STDOUT] In: Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check' 
+13:18:38,848 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check'  'Los Angeles' 
+13:18:38,848 INFO  [STDOUT] ** End Los Angeles - Service 5 **
+13:18:38,891 INFO  [STDOUT] ** Begin Atlanta - Service 7 **
+13:18:38,892 INFO  [STDOUT] In: Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check' 
+13:18:38,892 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check'  'Atlanta' 
+13:18:38,893 INFO  [STDOUT] ** End Atlanta - Service 7 **
+13:18:38,949 INFO  [STDOUT] ** Begin Dallas - Service 6 **
+13:18:38,949 INFO  [STDOUT] In: Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check' 
+13:18:38,950 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check'  'Dallas' 
+13:18:38,950 INFO  [STDOUT] ** End Dallas - Service 6 **
+13:18:39,105 INFO  [STDOUT] ***** Ship It *****
+13:18:39,106 INFO  [STDOUT] In: Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check'  'Dallas' 
+13:18:39,106 INFO  [STDOUT] Out: Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check'  'Dallas'  'Shipped' 
+13:18:39,106 INFO  [STDOUT] ***** End Ship It *****
+13:18:39,113 INFO  [STDOUT] SUCCESS!: 
+13:18:39,113 INFO  [STDOUT] [Getting Started 'Receive Order'  'Credit Check'  'Validate Order'  'Inventory Check'  'Dallas'  'Shipped' ].
\ No newline at end of file

Modified: labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/conf/base-build.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -138,6 +138,7 @@
 			<fileset dir="${org.jboss.esb.server.server}/deploy/jbpm.esb" includes="*.jar"/>
 			<pathelement location="${org.jboss.esb.server.server}/deploy/jbpm.esb"/>
 			<pathelement location="${org.jboss.esb.server.server}/lib/cglib.jar"/>
+			<pathelement location="${org.jboss.esb.server.server}/lib/dom4j.jar"/>
 			<!-- smooks config -->
 			<fileset dir="${org.jboss.esb.server.server}/deploy/smooks.esb" includes="*.jar"/>
 			<pathelement location="${org.jboss.esb.server.server}/deploy/smooks.esb"/>
@@ -156,6 +157,7 @@
 			<pathelement location="${org.jboss.esb.server.home}/lib/commons-codec.jar"/>
 			<pathelement location="${org.jboss.esb.server.home}/lib/jboss-system.jar"/>
 			<pathelement location="${org.jboss.esb.server.home}/lib/jboss-xml-binding.jar"/>
+			<pathelement location="${org.jboss.esb.server.server}/lib/jbossts-common.jar"/>
 		</path>
 	</target>
 

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld/jboss-esb.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld/jboss-esb.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -2,10 +2,7 @@
 <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
 
     <providers>
-          <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
-                        jndi-URL="jnp://127.0.0.1:1099" jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
-                        jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
-                      
+          <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
               <jms-bus busid="quickstartGwChannel">
                   <jms-message-filter
                       dest-type="QUEUE"

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_db_registration/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_db_registration/jboss-esb.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_db_registration/jboss-esb.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,8 +1,7 @@
 <?xml version = "1.0" encoding = "UTF-8"?>
 <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" >
     <providers>
-        <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
-            jndi-URL="localhost" jndi-context-factory="org.jnp.interfaces.NamingContextFactory">
+        <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
             <jms-bus busid="helloworldDBGatewayChannel">
                 <jms-message-filter dest-name="queue/quickstart_helloworld_db_registration"
                     dest-type="QUEUE"/>

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/jboss-esb.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/jboss-esb.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -7,15 +7,12 @@
           	<hibernate-bus busid="helloHibernateChannel" >
 			<hibernate-message-filter
 				classname="org.jboss.soa.esb.samples.quickstart.hibernateaction.Order"
-				event="onLoad,onDelete"/>
+				event="onSave,onDelete"/>
           	</hibernate-bus>
           </hibernate-provider>
           
           <jms-provider name="JBossMQ" 
-          		connection-factory="ConnectionFactory"
-            	jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
-            	jndi-URL="localhost" >
-            
+          		connection-factory="ConnectionFactory">
 			    <jms-bus busid="quickstartEsbChannel">
 			        <jms-message-filter
 			            dest-type="QUEUE"

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/readme.txt	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/readme.txt	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,7 +1,7 @@
 Overview:
 =========
   This is a demonstration of a Hibernate listener. This test is configured 
-  to use a mysql database running on localhost (see jbossesb.xml).  This 
+  to use an hsqldb database (see jbossesb.xml).  This 
   quickstart builds an ear containing both an .esb and a .war.  The .war
   has a series of .jsps which demonstrate insert/delete/load/update.   
 
@@ -25,30 +25,29 @@
   Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
   and a more detailed descripton of the different ways to run the quickstarts.
 
-  Make sure that you have MySQL running before starting this quickstart.  Once
-  it is running, execute 'ant createdb' to create the database.   
-
   Installation instructions can be found in the install/readme.txt.
 
-Setting up MySQL 
+Setting Up 
 ======================= 
-By default, this quickstart uses a standard MySQL database with root as the
-user and no password set.    You can easily change these settings by changing
-the hibernate.cfg.xml file.    Note that you may also have to make minor 
-modifications to the createdb target of build.xml.
+By default, this quickstart uses a standard hsqldb DB with "sa" as the
+user and "sa" as the password.    You can easily change these settings by
+changing the hibernate.cfg.xml file and the appropriate build.xml targets.    
 
 This quickstart uses the same database settings that are required in the 
 helloworld_sql_action quickstart.
 
 To Run .esb mode:
 =======================
-  1. In a command terminal window in the quickstart folder type 'ant deploy'.
-  2. Start your appserver.    This quickstart deploys a jar into a common
+  1. Make sure your appserver is stopped.    If it is running, please 
+     shutdown before installing this quickstart.
+  2. In a command terminal window in the quickstart folder type 'ant deploy'.
+  3. Start your appserver.    This quickstart deploys a jar into a common
      lib directory, so it is important that the app server be started 
      after deployment.    You may see JSP compilation errors if you try
      to deploy the quickstart for the first time while the appserver is 
      still running.
-  3. Assuming that your appserver is running tomcat on port 8080, Browse to
+  4. Assuming that your appserver is running tomcat on port 8080, Browse to
      http://localhost:8080/hibernateaction/index.jsp
-  4. Watch the events in the JBoss appserver console.
-  5. To undeploy the application, type 'ant undeploy'
+  5. Watch the events in the JBoss appserver console - by default this
+     quickstart logs the onSave and onDelete actions.
+  6. To undeploy the application, type 'ant undeploy'

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/resources/application.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/resources/application.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/resources/application.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -21,8 +21,4 @@
 	<java>Quickstart_helloworld_hibernate_action.esb</java>
    </module>
 
-   <module>
-	<java>mysql-connector-java-3.1.12-bin.jar</java>
-   </module>
-
 </application>

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/jboss-esb.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/jboss-esb.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -21,10 +21,7 @@
           </sql-provider>
           
           <jms-provider name="JBossMQ" 
-          		connection-factory="ConnectionFactory"
-            	jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
-            	jndi-URL="localhost" >
-            
+          		connection-factory="ConnectionFactory">
 			    <jms-bus busid="quickstartEsbChannel">
 			        <jms-message-filter
 			            dest-type="QUEUE"

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_topic_notifier/jboss-esb.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -44,7 +44,7 @@
                        	<NotificationList type="ok">
 							<target class="NotifyConsole"/>
                         	<target class="NotifyFiles">
-								<file append="false" URI="file:////Users/tcunning/src/esb/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_topic_notifier/results.log"/>
+								<file append="false" URI="file:////Users/cunningt/src/esb/JBESB_4_2_1_GA_CP/product/samples/quickstarts/helloworld_topic_notifier/results.log"/>
 								<file append="false" URI="/tmp/HelloWorldFileNotifierTest.log"/>
 							</target>
 							<target class="NotifyTopics">

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jboss-esb.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/jboss-esb.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -13,7 +13,7 @@
           			status-column="STATUS_COL"
 				order-by="DATA_COLUMN"	
 				where-condition="DATA_COLUMN like 'data%'"
-					message-column="message"
+					message-column="DATA_COLUMN"
           			message-id-column="UNIQUE_ID"
           			insert-timestamp-column="TIMESTAMP_COL"
           		/>
@@ -29,7 +29,7 @@
 				message-id-column="MESSAGE_ID"
           			status-column="STATUS_COL"
 				insert-timestamp-column="TIMESTAMP_COL"
-				message-column="DATA_COL"
+				message-column="DATA_COLUMN"
           		/>
           	</sql-bus>
           </sql-provider>

Modified: labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/create.sql
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/create.sql	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/helloworld_tx_sql_action/src/hsqldb/create.sql	2008-04-18 14:22:42 UTC (rev 19625)
@@ -2,5 +2,14 @@
 (
 unique_id INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,
 data_column VARCHAR(255) NOT NULL,
-status_col VARCHAR(255) NOT NULL
+status_col VARCHAR(255) NOT NULL,
+timestamp_col VARCHAR(255)
 );
+
+create table TX_ESB_MESSAGES
+(
+message_id VARCHAR(255) NOT NULL,
+data_column VARCHAR(255) NOT NULL,
+status_col VARCHAR(255) NOT NULL,
+timestamp_col VARCHAR(255)
+);

Modified: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/readme.txt	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/readme.txt	2008-04-18 14:22:42 UTC (rev 19625)
@@ -27,7 +27,7 @@
 
 To Run '.esb' archive mode:
 ===========================
-  1. In a command terminal window in this folder ("Window1"), type 'ant deploy-jms-dests' and then 'ant deploy'.
+  1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
   2. Open another command terminal window in this folder ("Window2"), type
      'ant runtest' or 'ant runtest-secure'.
   3. Switch back to Application Server console to see the output from the ESB

Modified: labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/jboss-esb.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/simple_cbr/jboss-esb.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -2,10 +2,7 @@
 <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
 
     <providers>
-          <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
-                      jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
-                      jndi-URL="localhost" >
-                      
+          <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
               <jms-bus busid="quickstartGwChannel">
                   <jms-message-filter
                       dest-type="QUEUE"

Modified: labs/jbossesb/trunk/product/samples/quickstarts/spring_aop/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/spring_aop/jboss-esb.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/spring_aop/jboss-esb.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -3,7 +3,6 @@
 
     <providers>
           <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
-                      
               <jms-bus busid="quickstartGwChannel">
                   <jms-message-filter
                       dest-type="QUEUE"

Modified: labs/jbossesb/trunk/product/samples/quickstarts/spring_helloworld/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/spring_helloworld/jboss-esb.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/spring_helloworld/jboss-esb.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -3,7 +3,6 @@
 
     <providers>
           <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
-                      
               <jms-bus busid="quickstartGwChannel">
                   <jms-message-filter
                       dest-type="QUEUE"

Modified: labs/jbossesb/trunk/product/samples/quickstarts/spring_jpetstore/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/spring_jpetstore/jboss-esb.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/spring_jpetstore/jboss-esb.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -3,7 +3,6 @@
 
     <providers>
           <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
-                      
               <jms-bus busid="quickstartGwChannel">
                   <jms-message-filter
                       dest-type="QUEUE"

Modified: labs/jbossesb/trunk/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transform_CSV2XML/jboss-esb.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -4,9 +4,7 @@
 
 	<providers>
 		<jms-provider name="JBossMQ"
-			connection-factory="ConnectionFactory"
-			jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
-			jndi-URL="localhost">
+			connection-factory="ConnectionFactory">
 
 			<jms-bus busid="quickstartCSVGwChannel">
 				<jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_transform_CSV2XML_gw" />

Modified: labs/jbossesb/trunk/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jboss-esb.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transform_EDI2XML_Groovy_XSLT/jboss-esb.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -4,10 +4,7 @@
 
 	<providers>
 		<jms-provider name="JBossMQ"
-			connection-factory="ConnectionFactory"
-			jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
-			jndi-URL="localhost">
-
+			connection-factory="ConnectionFactory">
 			<jms-bus busid="quickstartGwChannel">
 				<jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_edi_groovy_xslt_gw" />
 			</jms-bus>

Modified: labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2POJO2/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2POJO2/jboss-esb.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2POJO2/jboss-esb.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -2,10 +2,7 @@
 <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
 
     <providers>
-          <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
-                      jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
-                      jndi-URL="localhost" >
-                      
+          <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
               <jms-bus busid="quickstartGwChannel">
                   <jms-message-filter
                       dest-type="QUEUE"

Modified: labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_date_manipulation/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_date_manipulation/jboss-esb.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_date_manipulation/jboss-esb.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -5,9 +5,7 @@
 
     <providers>
         <jms-provider name="JBossMQ"
-                      connection-factory="ConnectionFactory"
-                      jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
-                      jndi-URL="localhost">
+                      connection-factory="ConnectionFactory">
 
             <jms-bus busid="quickstartGwChannel">
                 <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_date_manipulation_gw"/>

Modified: labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_simple/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_simple/jboss-esb.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_simple/jboss-esb.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -4,10 +4,7 @@
 
 	<providers>
 		<jms-provider name="JBossMQ"
-			connection-factory="ConnectionFactory"
-			jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
-			jndi-URL="localhost">
-
+			connection-factory="ConnectionFactory">
 			<jms-bus busid="quickstartGwChannel">
 				<jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_transform_simple_gw" />
 			</jms-bus>

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers)

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/build.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/build.xml	2008-04-18 10:37:34 UTC (rev 19621)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/build.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,113 +0,0 @@
-<project name="Quickstart_twoservers" default="run" basedir=".">
-	
-	<description> 
-		${ant.project.name}
-		${line.separator}
-	</description>
-	
-	<!-- Import the base Ant build script... -->
-	<import file="../conf/base-build.xml"/>
-
-	<property file="server.properties"/>
-	
-	<target name="setup-servers">
-		<input message="The following task is going to delete the directories ${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.first} and ${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.second} and replace them.    Continue (Y/N)?" validargs="Y,N" addproperty="input.response"/>
-		<condition property="exit.setup" value="blah">
-			<matches string="${input.response}" pattern="^Y$"/>
-		</condition>
-
-		<fail unless="exit.setup"/>
-			
-		<delete dir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.first}"/>
-		<delete dir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.second}"/>
-
-		<copy todir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.first}">
-			<fileset dir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.orig.config}" includes="**"/>
-		</copy>
-		<copy todir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.second}">
-			<fileset dir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.orig.config}" includes="**"/>
-		</copy>
-
-		<copy overwrite="true" file="resources/jboss-service.xml" todir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.first}/conf">
-			<filterset>
-				<filter token="server.name" value="ports-01"/> 
-			</filterset>
-		</copy>
-
-		<copy overwrite="true" file="resources/jboss-service.xml" todir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.second}/conf">
-			<filterset>
-				<filter token="server.name" value="ports-02"/>
-			</filterset>
-		</copy>
-
-	</target>
-
-	<!-- This Quickstart requires two different .esb packages, one for each
-		server, so we need to override the deploy-esb and package-deployment
-		targets -->
-	<target name="package-deployment">
-
-        <copy overwrite="true" file="jboss-esb.xml.first" tofile="build/META-INF/jboss-esb.xml"/>
-
-        <jar destfile="${build.dir}/${ant.project.name}-first.esb">
-			<fileset dir="${build.dir}/classes" />
-			<fileset dir="${build.dir}" includes="*.jar,*.war"/>
-			<fileset dir="${build.dir}" includes="deployment.xml"/>
-			<fileset dir="${build.dir}" includes="META-INF/**" />
-			<fileset dir="${basedir}/src" excludes="**/*.java" /> <!-- Please leave the src dir in here! -->
-			<fileset dir="${basedir}" includes="${jms.service.file} ${additional.deploys}" excludes="build/**" />
-			<fileset dir="${basedir}/lib" includes="*.jar"/>
-        </jar>
-
-        <copy overwrite="true" file="jboss-esb.xml.second" tofile="build/META-INF/jboss-esb.xml"/>
-
-        <jar destfile="${build.dir}/${ant.project.name}-second.esb">
-			<fileset dir="${build.dir}/classes" />
-			<fileset dir="${build.dir}" includes="*.jar,*.war"/>
-			<fileset dir="${build.dir}" includes="deployment.xml"/>
-			<fileset dir="${build.dir}" includes="META-INF/**" />
-			<fileset dir="${basedir}/src" excludes="**/*.java" /> <!-- Please leave the src dir in here! -->
-			<fileset dir="${basedir}" includes="${jms.service.file} ${additional.deploys}" excludes="build/**" />
-			<fileset dir="${basedir}/lib" includes="*.jar"/>
-        </jar>
-	
-	</target>
-
-	<target name="deploy-esb">
-		<copy todir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.first}/deploy">
-			<fileset dir="build" includes="${ant.project.name}-first.esb"/>
-		</copy>
-
-		<copy todir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.second}/deploy">
-			<fileset dir="build" includes="${ant.project.name}-second.esb"/>
-		</copy>
-	</target>
-
-	<target name="quickstart-specific-undeploys">
-        <delete verbose="true" includeemptydirs="true" quiet="true"
-          dir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.second}/deploy/${ant.project.name}-first.esb"/>
-        <delete verbose="true" includeemptydirs="true" quiet="true"
-          dir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.second}/deploy/${ant.project.name}-second.esb"/>
-	</target>
-	
-	<target name="runtest" depends="compile" 
-		description="sends a JMS message to queue/quickstart_twoservers_Request_gw">
-		<echo>Runs Test JMS Sender</echo>
-		<java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.twoservers.test.SendJMSMessage" failonerror="true">
-			<arg value="Hello World"/>
-			<classpath refid="exec-classpath"/>
-		</java>
-	</target>  
-	
-	<target name="sendesb" depends="compile"
-		description="Will send an esb Message">
-		<echo>Runs Test ESB Message Sender</echo>
-		<java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.twoservers.test.SendEsbMessage" failonerror="true">
-			<arg value="FirstServiceESB"/> <!--  service category -->
-			<arg value="SimpleListener"/>  <!--  service name -->
-			<arg value="Hello World - Straight to ESB listener - no Gateway"/> <!--  Message text -->
-			<classpath refid="exec-classpath"/>
-		</java>
-	</target>
-	
-</project>

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/build.xml (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/build.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/two_servers/build.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/build.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,113 @@
+<project name="Quickstart_twoservers" default="run" basedir=".">
+	
+	<description> 
+		${ant.project.name}
+		${line.separator}
+	</description>
+	
+	<!-- Import the base Ant build script... -->
+	<import file="../conf/base-build.xml"/>
+
+	<property file="server.properties"/>
+	
+	<target name="setup-servers">
+		<input message="The following task is going to delete the directories ${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.first} and ${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.second} and replace them.    Continue (Y/N)?" validargs="Y,N" addproperty="input.response"/>
+		<condition property="exit.setup" value="blah">
+			<matches string="${input.response}" pattern="^Y$"/>
+		</condition>
+
+		<fail unless="exit.setup"/>
+			
+		<delete dir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.first}"/>
+		<delete dir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.second}"/>
+
+		<copy todir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.first}">
+			<fileset dir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.orig.config}" includes="**"/>
+		</copy>
+		<copy todir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.second}">
+			<fileset dir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.orig.config}" includes="**"/>
+		</copy>
+
+		<copy overwrite="true" file="resources/jboss-service.xml" todir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.first}/conf">
+			<filterset>
+				<filter token="server.name" value="ports-01"/> 
+			</filterset>
+		</copy>
+
+		<copy overwrite="true" file="resources/jboss-service.xml" todir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.second}/conf">
+			<filterset>
+				<filter token="server.name" value="ports-02"/>
+			</filterset>
+		</copy>
+
+	</target>
+
+	<!-- This Quickstart requires two different .esb packages, one for each
+		server, so we need to override the deploy-esb and package-deployment
+		targets -->
+	<target name="package-deployment">
+
+        <copy overwrite="true" file="jboss-esb.xml.first" tofile="build/META-INF/jboss-esb.xml"/>
+
+        <jar destfile="${build.dir}/${ant.project.name}-first.esb">
+			<fileset dir="${build.dir}/classes" />
+			<fileset dir="${build.dir}" includes="*.jar,*.war"/>
+			<fileset dir="${build.dir}" includes="deployment.xml"/>
+			<fileset dir="${build.dir}" includes="META-INF/**" />
+			<fileset dir="${basedir}/src" excludes="**/*.java" /> <!-- Please leave the src dir in here! -->
+			<fileset dir="${basedir}" includes="${jms.service.file} ${additional.deploys}" excludes="build/**" />
+			<fileset dir="${basedir}/lib" includes="*.jar"/>
+        </jar>
+
+        <copy overwrite="true" file="jboss-esb.xml.second" tofile="build/META-INF/jboss-esb.xml"/>
+
+        <jar destfile="${build.dir}/${ant.project.name}-second.esb">
+			<fileset dir="${build.dir}/classes" />
+			<fileset dir="${build.dir}" includes="*.jar,*.war"/>
+			<fileset dir="${build.dir}" includes="deployment.xml"/>
+			<fileset dir="${build.dir}" includes="META-INF/**" />
+			<fileset dir="${basedir}/src" excludes="**/*.java" /> <!-- Please leave the src dir in here! -->
+			<fileset dir="${basedir}" includes="${jms.service.file} ${additional.deploys}" excludes="build/**" />
+			<fileset dir="${basedir}/lib" includes="*.jar"/>
+        </jar>
+	
+	</target>
+
+	<target name="deploy-esb">
+		<copy todir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.first}/deploy">
+			<fileset dir="build" includes="${ant.project.name}-first.esb"/>
+		</copy>
+
+		<copy todir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.second}/deploy">
+			<fileset dir="build" includes="${ant.project.name}-second.esb"/>
+		</copy>
+	</target>
+
+	<target name="quickstart-specific-undeploys">
+        <delete verbose="true" includeemptydirs="true" quiet="true"
+          dir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.second}/deploy/${ant.project.name}-first.esb"/>
+        <delete verbose="true" includeemptydirs="true" quiet="true"
+          dir="${org.jboss.esb.twoservers.home}/server/${org.jboss.esb.twoservers.dest.second}/deploy/${ant.project.name}-second.esb"/>
+	</target>
+	
+	<target name="runtest" depends="compile" 
+		description="sends a JMS message to queue/quickstart_twoservers_Request_gw">
+		<echo>Runs Test JMS Sender</echo>
+		<java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.twoservers.test.SendJMSMessage" failonerror="true">
+			<arg value="Hello World"/>
+			<classpath refid="exec-classpath"/>
+		</java>
+	</target>  
+	
+	<target name="sendesb" depends="compile"
+		description="Will send an esb Message">
+		<echo>Runs Test ESB Message Sender</echo>
+		<java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.twoservers.test.SendEsbMessage" failonerror="true">
+			<arg value="FirstServiceESB"/> <!--  service category -->
+			<arg value="SimpleListener"/>  <!--  service name -->
+			<arg value="Hello World - Straight to ESB listener - no Gateway"/> <!--  Message text -->
+			<classpath refid="exec-classpath"/>
+		</java>
+	</target>
+	
+</project>

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/deployment.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/deployment.xml	2008-04-18 10:37:34 UTC (rev 19621)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/deployment.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,4 +0,0 @@
-<jbossesb-deployment>
-  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_twoservers_Request_esb</depends>
-  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_twoservers_Request_gw</depends>
-</jbossesb-deployment>

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/deployment.xml (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/deployment.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/two_servers/deployment.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/deployment.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,4 @@
+<jbossesb-deployment>
+  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_twoservers_Request_esb</depends>
+  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_twoservers_Request_gw</depends>
+</jbossesb-deployment>

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/jbm-queue-service.xml	2008-04-18 10:37:34 UTC (rev 19621)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbm-queue-service.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
-  <mbean code="org.jboss.jms.server.destination.QueueService"
-    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_twoservers_Request_esb"
-    xmbean-dd="xmdesc/Queue-xmbean.xml">
-	<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-	<depends>jboss.messaging:service=PostOffice</depends>
-  </mbean>
-  <mbean code="org.jboss.jms.server.destination.QueueService"
-    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_twoservers_Request_gw"
-    xmbean-dd="xmdesc/Queue-xmbean.xml">
-    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-	<depends>jboss.messaging:service=PostOffice</depends>
-  </mbean>
-</server>

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbm-queue-service.xml (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/jbm-queue-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbm-queue-service.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbm-queue-service.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_twoservers_Request_esb"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+	<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	<depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_twoservers_Request_gw"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+    <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	<depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+</server>

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/jbmq-queue-service.xml	2008-04-18 10:37:34 UTC (rev 19621)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbmq-queue-service.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
-  <mbean code="org.jboss.mq.server.jmx.Queue"
-    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_twoservers_Request_esb">
-    <depends optional-attribute-name="DestinationManager">
-      jboss.mq:service=DestinationManager
-    </depends>
-  </mbean>
-  <mbean code="org.jboss.mq.server.jmx.Queue"
-    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_twoservers_Request_gw">
-    <depends optional-attribute-name="DestinationManager">
-      jboss.mq:service=DestinationManager
-    </depends>
-  </mbean>
-</server>

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbmq-queue-service.xml (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/jbmq-queue-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbmq-queue-service.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbmq-queue-service.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_twoservers_Request_esb">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+  </mbean>
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_twoservers_Request_gw">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+  </mbean>
+</server>

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jboss-esb.xml.first
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/jboss-esb.xml.first	2008-04-18 10:37:34 UTC (rev 19621)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jboss-esb.xml.first	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,57 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
-
-    <providers>
-          <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
-                        jndi-URL="jnp://127.0.0.1:1199" jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
-                        jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
-                      
-              <jms-bus busid="quickstartGwChannel">
-                  <jms-message-filter
-                      dest-type="QUEUE"
-                      dest-name="queue/quickstart_twoservers_Request_gw"
-                   />
-              </jms-bus>
-              <jms-bus busid="quickstartEsbChannel">
-                  <jms-message-filter
-                      dest-type="QUEUE"
-                      dest-name="queue/quickstart_twoservers_Request_esb"
-                  />
-              </jms-bus>
-
-          </jms-provider>
-      </providers>
-      
-      <services>
-        <service 
-        	category="FirstServiceESB" 
-        	name="SimpleListener" 
-        	description="Hello World">
-            <listeners>
-                <jms-listener name="JMS-Gateway"
-                    busidref="quickstartGwChannel"
-                    maxThreads="1"
-                    is-gateway="true"
-                />
-                <jms-listener name="helloWorld"
-                              busidref="quickstartEsbChannel"
-                              maxThreads="1"
-                />
-            </listeners>
-			<actions mep="OneWay">
-                <action name="appenderAction" class="org.jboss.soa.esb.samples.quickstart.twoservers.StringAppender"/>
-				<action name="notificationAction" class="org.jboss.soa.esb.actions.Notifier">
-					<property name="okMethod" value="notifyOK" />
-					<property name="notification-details">
-						<NotificationList type="ok">
-							<target class="NotifyConsole"/>
-							<target class="NotifyQueues">
-								<queue jndiName="queue/quickstart_twoservers_Request_gw" jndi-URL="jnp://127.0.0.1:1299"/>
-							</target>
-						</NotificationList>
-					</property>
-				</action>
-			</actions>
-		</service>
-      </services>
-</jbossesb>

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jboss-esb.xml.first (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/jboss-esb.xml.first)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jboss-esb.xml.first	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jboss-esb.xml.first	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,57 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
+
+    <providers>
+          <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
+                        jndi-URL="jnp://127.0.0.1:1199" jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+                        jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
+                      
+              <jms-bus busid="quickstartGwChannel">
+                  <jms-message-filter
+                      dest-type="QUEUE"
+                      dest-name="queue/quickstart_twoservers_Request_gw"
+                   />
+              </jms-bus>
+              <jms-bus busid="quickstartEsbChannel">
+                  <jms-message-filter
+                      dest-type="QUEUE"
+                      dest-name="queue/quickstart_twoservers_Request_esb"
+                  />
+              </jms-bus>
+
+          </jms-provider>
+      </providers>
+      
+      <services>
+        <service 
+        	category="FirstServiceESB" 
+        	name="SimpleListener" 
+        	description="Hello World">
+            <listeners>
+                <jms-listener name="JMS-Gateway"
+                    busidref="quickstartGwChannel"
+                    maxThreads="1"
+                    is-gateway="true"
+                />
+                <jms-listener name="helloWorld"
+                              busidref="quickstartEsbChannel"
+                              maxThreads="1"
+                />
+            </listeners>
+			<actions mep="OneWay">
+                <action name="appenderAction" class="org.jboss.soa.esb.samples.quickstart.twoservers.StringAppender"/>
+				<action name="notificationAction" class="org.jboss.soa.esb.actions.Notifier">
+					<property name="okMethod" value="notifyOK" />
+					<property name="notification-details">
+						<NotificationList type="ok">
+							<target class="NotifyConsole"/>
+							<target class="NotifyQueues">
+								<queue jndiName="queue/quickstart_twoservers_Request_gw" jndi-URL="jnp://127.0.0.1:1299"/>
+							</target>
+						</NotificationList>
+					</property>
+				</action>
+			</actions>
+		</service>
+      </services>
+</jbossesb>

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jboss-esb.xml.second
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/jboss-esb.xml.second	2008-04-18 10:37:34 UTC (rev 19621)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jboss-esb.xml.second	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,54 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
-
-    <providers>
-          <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
-                        jndi-URL="jnp://127.0.0.1:1299" jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
-                        jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
-                      
-              <jms-bus busid="quickstartGwChannel">
-                  <jms-message-filter
-                      dest-type="QUEUE"
-                      dest-name="queue/quickstart_twoservers_Request_gw"
-                   />
-              </jms-bus>
-              <jms-bus busid="quickstartEsbChannel">
-                  <jms-message-filter
-                      dest-type="QUEUE"
-                      dest-name="queue/quickstart_twoservers_Request_esb"
-                  />
-              </jms-bus>
-
-          </jms-provider>
-      </providers>
-      
-      <services>
-        <service 
-        	category="FirstServiceESB" 
-        	name="SimpleListener" 
-        	description="Hello World">
-            <listeners>
-                <jms-listener name="JMS-Gateway"
-                    busidref="quickstartGwChannel"
-                    maxThreads="1"
-                    is-gateway="true"
-                />
-                <jms-listener name="helloWorld"
-                              busidref="quickstartEsbChannel"
-                              maxThreads="1"
-                />
-            </listeners>
-            <actions mep="OneWay">
-				<action name="notificationAction" class="org.jboss.soa.esb.actions.Notifier">
-					<property name="okMethod" value="notifyOK" />
-					<property name="notification-details">
-						<NotificationList type="ok">
-							<target class="NotifyConsole"/>
-						</NotificationList>
-					</property>
-				</action>
-            </actions>
-        </service>
-      </services>
-     
-</jbossesb>

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jboss-esb.xml.second (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/jboss-esb.xml.second)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jboss-esb.xml.second	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jboss-esb.xml.second	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,54 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
+
+    <providers>
+          <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
+                        jndi-URL="jnp://127.0.0.1:1299" jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+                        jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
+                      
+              <jms-bus busid="quickstartGwChannel">
+                  <jms-message-filter
+                      dest-type="QUEUE"
+                      dest-name="queue/quickstart_twoservers_Request_gw"
+                   />
+              </jms-bus>
+              <jms-bus busid="quickstartEsbChannel">
+                  <jms-message-filter
+                      dest-type="QUEUE"
+                      dest-name="queue/quickstart_twoservers_Request_esb"
+                  />
+              </jms-bus>
+
+          </jms-provider>
+      </providers>
+      
+      <services>
+        <service 
+        	category="FirstServiceESB" 
+        	name="SimpleListener" 
+        	description="Hello World">
+            <listeners>
+                <jms-listener name="JMS-Gateway"
+                    busidref="quickstartGwChannel"
+                    maxThreads="1"
+                    is-gateway="true"
+                />
+                <jms-listener name="helloWorld"
+                              busidref="quickstartEsbChannel"
+                              maxThreads="1"
+                />
+            </listeners>
+            <actions mep="OneWay">
+				<action name="notificationAction" class="org.jboss.soa.esb.actions.Notifier">
+					<property name="okMethod" value="notifyOK" />
+					<property name="notification-details">
+						<NotificationList type="ok">
+							<target class="NotifyConsole"/>
+						</NotificationList>
+					</property>
+				</action>
+            </actions>
+        </service>
+      </services>
+     
+</jbossesb>

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/jbossesb-properties.xml	2008-04-18 10:37:34 UTC (rev 19621)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbossesb-properties.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  JBoss, Home of Professional Open Source
-  Copyright 2006, 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) 2005-2006,
-  @author JBoss Inc.
--->
-<!-- $Id: jbossesb-unittest-properties.xml $ -->
-<!--
-  These options are described in the JBossESB manual.
-  Defaults are provided here for convenience only.
- 
-  Please read through this file prior to using the system, and consider
-  updating the specified entries.
--->
-<esb
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
-    <properties name="core">
-		<property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
-		<property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
-		<property name="org.jboss.soa.esb.persistence.connection.factory" 	value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
-    </properties>
-    <properties name="registry">      
-    	<property name="org.jboss.soa.esb.registry.queryManagerURI"     		
-    		value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>    		
-    	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"     		
-    		value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
-    	<property name="org.jboss.soa.esb.registry.implementationClass" 
-    		value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
-    	<property name="org.jboss.soa.esb.registry.factoryClass" 
-    		value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
-    	<property name="org.jboss.soa.esb.registry.user" 
-    		value="jbossesb"/>
-    	<property name="org.jboss.soa.esb.registry.password" 
-    	  value="password"/>
-    	<!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
-    	<property name="org.jboss.soa.esb.scout.proxy.transportClass" 
-    		value="org.apache.ws.scout.transport.RMITransport"/>
-    </properties>
-    <properties name="transports" depends="core">
-    	<property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
-    	<property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
-    	<property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
-    	<property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
-    </properties>
-    <properties name="connection">
-    	<property name="min-pool-size" value="5"/>
-    	<property name="max-pool=size" value="10"/>
-    	<property name="blocking-timeout-millis" value="5000"/>
-    	<property name="abandoned-connection-timeout" value="10000"/>
-    	<property name="abandoned-connection-time-interval" value="30000"/>
-    </properties>
-    <properties name="dbstore">
-		<property name="org.jboss.soa.esb.persistence.db.connection.url" 	value="jdbc:hsqldb:hsql://localhost:9001/"/>
-		<property name="org.jboss.soa.esb.persistence.db.jdbc.driver" 		value="org.hsqldb.jdbcDriver"/>
-		<property name="org.jboss.soa.esb.persistence.db.user" 			value="sa"/>
-		<property name="org.jboss.soa.esb.persistence.db.pwd" 			value=""/>		
-		<property name="org.jboss.soa.esb.persistence.db.pool.initial.size"	value="2"/>
-		<property name="org.jboss.soa.esb.persistence.db.pool.min.size"	value="2"/>
-		<property name="org.jboss.soa.esb.persistence.db.pool.max.size"	value="5"/>
-		<!--table managed by pool to test for valid connections - created by pool automatically -->
-		<property name="org.jboss.soa.esb.persistence.db.pool.test.table"	value="pooltest"/>
-		<!-- # of milliseconds to timeout waiting for a connection from pool -->
-		<property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis"	value="5000"/> 
-                <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
-    </properties>
-    <properties name="messagerouting">
-    	<property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
-    </properties>
-</esb>

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbossesb-properties.xml (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/jbossesb-properties.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbossesb-properties.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jbossesb-properties.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2006, 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) 2005-2006,
+  @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+  These options are described in the JBossESB manual.
+  Defaults are provided here for convenience only.
+ 
+  Please read through this file prior to using the system, and consider
+  updating the specified entries.
+-->
+<esb
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+    <properties name="core">
+		<property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+		<property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+		<property name="org.jboss.soa.esb.persistence.connection.factory" 	value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+    </properties>
+    <properties name="registry">      
+    	<property name="org.jboss.soa.esb.registry.queryManagerURI"     		
+    		value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>    		
+    	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"     		
+    		value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+    	<property name="org.jboss.soa.esb.registry.implementationClass" 
+    		value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.factoryClass" 
+    		value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.user" 
+    		value="jbossesb"/>
+    	<property name="org.jboss.soa.esb.registry.password" 
+    	  value="password"/>
+    	<!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+    	<property name="org.jboss.soa.esb.scout.proxy.transportClass" 
+    		value="org.apache.ws.scout.transport.RMITransport"/>
+    </properties>
+    <properties name="transports" depends="core">
+    	<property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+    	<property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+    </properties>
+    <properties name="connection">
+    	<property name="min-pool-size" value="5"/>
+    	<property name="max-pool=size" value="10"/>
+    	<property name="blocking-timeout-millis" value="5000"/>
+    	<property name="abandoned-connection-timeout" value="10000"/>
+    	<property name="abandoned-connection-time-interval" value="30000"/>
+    </properties>
+    <properties name="dbstore">
+		<property name="org.jboss.soa.esb.persistence.db.connection.url" 	value="jdbc:hsqldb:hsql://localhost:9001/"/>
+		<property name="org.jboss.soa.esb.persistence.db.jdbc.driver" 		value="org.hsqldb.jdbcDriver"/>
+		<property name="org.jboss.soa.esb.persistence.db.user" 			value="sa"/>
+		<property name="org.jboss.soa.esb.persistence.db.pwd" 			value=""/>		
+		<property name="org.jboss.soa.esb.persistence.db.pool.initial.size"	value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.min.size"	value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.max.size"	value="5"/>
+		<!--table managed by pool to test for valid connections - created by pool automatically -->
+		<property name="org.jboss.soa.esb.persistence.db.pool.test.table"	value="pooltest"/>
+		<!-- # of milliseconds to timeout waiting for a connection from pool -->
+		<property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis"	value="5000"/> 
+                <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+    </properties>
+    <properties name="messagerouting">
+    	<property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+    </properties>
+</esb>

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jndi.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/jndi.properties	2008-04-18 10:37:34 UTC (rev 19621)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jndi.properties	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,5 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-java.naming.factory.url.pkgs=org.jnp.interfaces
-

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jndi.properties (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/jndi.properties)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jndi.properties	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/jndi.properties	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/juddi.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/juddi.properties	2008-04-18 10:37:34 UTC (rev 19621)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/juddi.properties	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,69 +0,0 @@
-# jUDDI Registry Properties (used by RegistryServer)
-# see http://www.juddi.org for more information
-
-# The UDDI Operator Name
-juddi.operatorName = jUDDI.org
-
-# The i18n locale default codes
-juddi.i18n.languageCode = en
-juddi.i18n.countryCode = US
-
-# The UDDI DiscoveryURL Prefix
-juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
-
-# The UDDI Operator Contact Email Address
-juddi.operatorEmailAddress = admin at juddi.org
-
-# The maximum name size and maximum number
-# of name elements allows in several of the
-# FindXxxx and SaveXxxx UDDI functions.
-juddi.maxNameLength=255
-juddi.maxNameElementsAllowed=5
-
-# The maximum number of UDDI artifacts allowed
-# per publisher. A value of '-1' indicates any 
-# number of artifacts is valid (These values can be
-# overridden at the individual publisher level).
-juddi.maxBusinessesPerPublisher=25
-juddi.maxServicesPerBusiness=20
-juddi.maxBindingsPerService=10
-juddi.maxTModelsPerPublisher=100
-
-# jUDDI Authentication module to use
-juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
-
-# jUDDI DataStore module currently to use
-juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
-
-# use a dataSource (if set to false a direct 
-# jdbc connection will be used.
-juddi.isUseDataSource=false
-juddi.jdbcDriver=com.mysql.jdbc.Driver
-juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
-juddi.jdbcUsername=root
-juddi.jdbcPassword=admin
-# jUDDI DataSource to use
-# juddi.dataSource=java:comp/env/jdbc/MySqlDS
-
-# jUDDI UUIDGen implementation to use
-juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
-
-# jUDDI Cryptor implementation to use
-juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
- 
-# jUDDI Validator to use
-juddi.validator=org.apache.juddi.validator.DefaultValidator
-
-# jUDDI Proxy Properties (used by RegistryProxy)
-juddi.proxy.adminURL = http://localhost:8080/juddi/admin
-juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
-juddi.proxy.publishURL = http://localhost:8080/juddi/publish
-juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
-juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
-juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
-
-# JNDI settings (used by RMITransport)
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-  

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/juddi.properties (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/juddi.properties)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/two_servers/juddi.properties	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/juddi.properties	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any 
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct 
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+ 
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+  

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/lib (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/lib)

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/listener.log
===================================================================

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/listener.log (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/listener.log)
===================================================================

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/log4j.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/log4j.xml	2008-04-18 10:37:34 UTC (rev 19621)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/log4j.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  Log4j Configuration                                                  -->
-<!--                                                                       -->
-<!-- ===================================================================== -->
-
-<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
-
-<!--
-   | For more configuration infromation and examples see the Jakarta Log4j
-   | owebsite: http://jakarta.apache.org/log4j
- -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
-   <!-- ============================== -->
-   <!-- Append messages to the console -->
-   <!-- ============================== -->
-
-   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
-      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
-      <param name="Target" value="System.out"/>
-      <param name="Threshold" value="INFO"/>
-
-      <layout class="org.apache.log4j.PatternLayout">
-         <!-- The default pattern: Date Priority [Category] Message\n -->
-         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
-      </layout>
-   </appender>
-
-   <!-- ================================= -->
-   <!-- Preserve messages in a local file -->
-   <!-- ================================= -->
-
-   <!-- A size based file rolling appender -->
-   <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
-     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
-     <param name="File" value="./listener.log"/>
-     <param name="Append" value="false"/>
-     <param name="MaxFileSize" value="500KB"/>
-     <param name="MaxBackupIndex" value="1"/>
-
-     <layout class="org.apache.log4j.PatternLayout">
-       <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
-     </layout>	    
-   </appender>
-
-   <!-- ================ -->
-   <!-- Limit categories -->
-   <!-- ================ -->
-
-   <category name="org.jboss">
-      <priority value="WARN"/>
-   </category>
-   <category name="org.jboss.soa.esb">
-      <priority value="ERROR"/>
-   </category>
-   <category name="org.jboss.internal.soa.esb">
-      <priority value="ERROR"/>
-   </category>
-   <category name="org.apache">
-      <priority value="ERROR"/>
-   </category>
-   <category name="quickstart">
-      <priority value="DEBUG"/>
-   </category>
-   <!-- ======================= -->
-   <!-- Setup the Root category -->
-   <!-- ======================= -->
-
-   <root>
-      <appender-ref ref="CONSOLE"/>
-      <appender-ref ref="FILE"/>
-   </root>
-
-</log4j:configuration>

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/log4j.xml (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/log4j.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/two_servers/log4j.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/log4j.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+   | For more configuration infromation and examples see the Jakarta Log4j
+   | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <!-- ============================== -->
+   <!-- Append messages to the console -->
+   <!-- ============================== -->
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <!-- The default pattern: Date Priority [Category] Message\n -->
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <!-- ================================= -->
+   <!-- Preserve messages in a local file -->
+   <!-- ================================= -->
+
+   <!-- A size based file rolling appender -->
+   <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="File" value="./listener.log"/>
+     <param name="Append" value="false"/>
+     <param name="MaxFileSize" value="500KB"/>
+     <param name="MaxBackupIndex" value="1"/>
+
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+     </layout>	    
+   </appender>
+
+   <!-- ================ -->
+   <!-- Limit categories -->
+   <!-- ================ -->
+
+   <category name="org.jboss">
+      <priority value="WARN"/>
+   </category>
+   <category name="org.jboss.soa.esb">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.jboss.internal.soa.esb">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.apache">
+      <priority value="ERROR"/>
+   </category>
+   <category name="quickstart">
+      <priority value="DEBUG"/>
+   </category>
+   <!-- ======================= -->
+   <!-- Setup the Root category -->
+   <!-- ======================= -->
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+      <appender-ref ref="FILE"/>
+   </root>
+
+</log4j:configuration>

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/readme.txt
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/readme.txt	2008-04-18 10:37:34 UTC (rev 19621)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/readme.txt	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,27 +0,0 @@
-Overview:
-=========
-  The purpose of the two_servers quickstart sample is to demonstrate 
-  running two versions of the ESB server (or the JBoss AS).
-
-  The sample bindings depend on a sample-bindings.xml, which spells out 
-  which ports are used for different services.   Each binding depends on a port
-  profile (in this example, ports-01 and ports-02), which is then referenced
-  in the server's jboss-service.xml (see $JBOSS_HOME/server/first/conf/jboss-service.xml
-  and $JBOSS_HOME/server/second/conf/jboss-service.xml).    
-
-  This quickstart is a bit different than others in that it will not deploy .esb
-  packages to the config specified in your deployment.properties file, but will 
-  create two configs based on the server.properties file in this directory.     
-
-Running this quickstart:
-========================
-  Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
-  and a more detailed descripton of the different ways to run the quickstarts.
-
-To Run '.esb' archive mode:
-===========================
-  1. In a command terminal window in this folder ("Window1"), type 'ant setup-servers'.    Note that this will remove both the SERVER_HOME/server/first and SERVER_HOME/server/second directories, and will make a copy of the default directory in each of these locations.
-  2. In Window 1, ant deploy
-  3. In Window 2, start the first application server (./run.sh -c first)
-  4. In Window 3, start the second application server (./run.sh -c second) 
-  5. In Window 1, ant runtest

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/readme.txt (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/readme.txt)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/two_servers/readme.txt	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/readme.txt	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,27 @@
+Overview:
+=========
+  The purpose of the two_servers quickstart sample is to demonstrate 
+  running two versions of the ESB server (or the JBoss AS).
+
+  The sample bindings depend on a sample-bindings.xml, which spells out 
+  which ports are used for different services.   Each binding depends on a port
+  profile (in this example, ports-01 and ports-02), which is then referenced
+  in the server's jboss-service.xml (see $JBOSS_HOME/server/first/conf/jboss-service.xml
+  and $JBOSS_HOME/server/second/conf/jboss-service.xml).    
+
+  This quickstart is a bit different than others in that it will not deploy .esb
+  packages to the config specified in your deployment.properties file, but will 
+  create two configs based on the server.properties file in this directory.     
+
+Running this quickstart:
+========================
+  Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+  and a more detailed descripton of the different ways to run the quickstarts.
+
+To Run '.esb' archive mode:
+===========================
+  1. In a command terminal window in this folder ("Window1"), type 'ant setup-servers'.    Note that this will remove both the SERVER_HOME/server/first and SERVER_HOME/server/second directories, and will make a copy of the default directory in each of these locations.
+  2. In Window 1, ant deploy
+  3. In Window 2, start the first application server (./run.sh -c first)
+  4. In Window 3, start the second application server (./run.sh -c second) 
+  5. In Window 1, ant runtest

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/resources (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/resources)

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/resources/jboss-service.xml
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/resources/jboss-service.xml	2008-04-18 10:37:34 UTC (rev 19621)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/resources/jboss-service.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,696 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- $Id: jboss-service.xml 62434 2007-04-19 21:22:50Z dimitris at jboss.org $ -->
-
-<!-- ===================================================================== -->
-<!--  JBoss Server Configuration                                           -->
-<!-- ===================================================================== -->
-
-<server>
-
-   <!-- Load all jars from the JBOSS_DIST/server/<config>/lib directory. This
-     can be restricted to specific jars by specifying them in the archives
-     attribute.
-    -->
-   <classpath codebase="${jboss.server.lib.url:lib}" archives="*"/>
-
-   <!-- ==================================================================== -->
-   <!-- JSR-77 Single JBoss Server Management Domain                         -->
-   <!-- ==================================================================== -->
-   <mbean code="org.jboss.management.j2ee.LocalJBossServerDomain"
-      name="jboss.management.local:j2eeType=J2EEDomain,name=Manager">
-      <attribute name="MainDeployer">jboss.system:service=MainDeployer</attribute>
-      <attribute name="SARDeployer">jboss.system:service=ServiceDeployer</attribute>
-      <attribute name="EARDeployer">jboss.j2ee:service=EARDeployer</attribute>
-      <attribute name="EJBDeployer">jboss.ejb:service=EJBDeployer</attribute>
-      <attribute name="RARDeployer">jboss.jca:service=RARDeployer</attribute>
-      <attribute name="CMDeployer">jboss.jca:service=ConnectionFactoryDeployer</attribute>
-      <attribute name="WARDeployer">jboss.web:service=WebServer</attribute>
-      <attribute name="CARDeployer">jboss.j2ee:service=ClientDeployer</attribute>
-      <attribute name="MailService">jboss:service=Mail</attribute>
-      <attribute name="JMSService">jboss.mq:service=DestinationManager</attribute>
-      <attribute name="JNDIService">jboss:service=Naming</attribute>
-      <attribute name="JTAService">jboss:service=TransactionManager</attribute>
-      <attribute name="UserTransactionService">jboss:service=ClientUserTransaction</attribute>
-      <attribute name="RMI_IIOPService">jboss:service=CorbaORB</attribute>
-   </mbean>
-
-   <!-- ==================================================================== -->
-   <!-- XMBean Persistence                                                   -->
-   <!-- ==================================================================== -->
-   <mbean code="org.jboss.system.pm.AttributePersistenceService"
-      name="jboss:service=AttributePersistenceService"
-      xmbean-dd="resource:xmdesc/AttributePersistenceService-xmbean.xml">
-      <!-- the AttributePersistenceService is persistent, itself -->
-
-      <!--
-      <attribute name="AttributePersistenceManagerClass">org.jboss.system.pm.XMLAttributePersistenceManager</attribute>
-      <attribute name="AttributePersistenceManagerConfig">
-         <data-directory>data/xmbean-attrs</data-directory>
-      </attribute>
-      <attribute name="ApmDestroyOnServiceStop">false</attribute>
-      <attribute name="VersionTag"></attribute>
-      -->
-   </mbean>
-
-   <!-- ==================================================================== -->
-   <!-- Thread Pool                                                          -->
-   <!-- ==================================================================== -->
-   
-   <!-- A Thread pool service -->
-   <mbean code="org.jboss.util.threadpool.BasicThreadPool"
-      name="jboss.system:service=ThreadPool">
-      <attribute name="Name">JBoss System Threads</attribute>
-      <attribute name="ThreadGroupName">System Threads</attribute>
-      <!-- How long a thread will live without any tasks in MS -->
-      <attribute name="KeepAliveTime">60000</attribute>
-      <!-- The max number of threads in the pool -->
-      <attribute name="MaximumPoolSize">10</attribute>
-      <!-- The max number of tasks before the queue is full -->
-      <attribute name="MaximumQueueSize">1000</attribute>
-      <!-- The behavior of the pool when a task is added and the queue is full.
-      abort - a RuntimeException is thrown
-      run - the calling thread executes the task
-      wait - the calling thread blocks until the queue has room
-      discard - the task is silently discarded without being run
-      discardOldest - check to see if a task is about to complete and enque
-         the new task if possible, else run the task in the calling thread
-      -->
-      <attribute name="BlockingMode">run</attribute>
-   </mbean>
-
-   <!-- Preload all custom editors for VMs that don't use the thread
-        context class loader when searching for PropertyEditors. Uncomment
-        if your JDK 1.3.0 VM fails to find JBoss PropertyEditors.
-   <mbean code="org.jboss.varia.property.PropertyEditorManagerService"
-     name="jboss:type=Service,name=BootstrapEditors">
-     <attribute name="BootstrapEditors">
-       java.math.BigDecimal=org.jboss.util.propertyeditor.BigDecimalEditor
-       java.lang.Boolean=org.jboss.util.propertyeditor.BooleanEditor
-       java.lang.Class=org.jboss.util.propertyeditor.ClassEditor
-       java.util.Date=org.jboss.util.propertyeditor.DateEditor
-       java.io.File=org.jboss.util.propertyeditor.FileEditor
-       java.net.InetAddress=org.jboss.util.propertyeditor.InetAddressEditor
-       java.lang.Integer=org.jboss.util.propertyeditor.IntegerEditor
-       javax.management.ObjectName=org.jboss.mx.util.propertyeditor.ObjectNameEditor
-       java.util.Properties=org.jboss.util.propertyeditor.PropertiesEditor
-       [Ljava.lang.String;=org.jboss.util.propertyeditor.StringArrayEditor
-       java.net.URL=org.jboss.util.propertyeditor.URLEditor
-     </attribute>
-   </mbean>
-   -->
-
-   <!-- ==================================================================== -->
-   <!-- Log4j Initialization                                                 -->
-   <!-- ==================================================================== -->
-
-   <mbean code="org.jboss.logging.Log4jService"
-      name="jboss.system:type=Log4jService,service=Logging"
-	  xmbean-dd="resource:xmdesc/Log4jService-xmbean.xml">
-      <attribute name="ConfigurationURL">resource:jboss-log4j.xml</attribute>
-      <!-- Set the org.apache.log4j.helpers.LogLog.setQuiteMode. As of log4j1.2.8
-      this needs to be set to avoid a possible deadlock on exception at the
-      appender level. See bug#696819.
-      -->
-      <attribute name="Log4jQuietMode">true</attribute>
-      <!-- How frequently in seconds the ConfigurationURL is checked for changes -->
-      <attribute name="RefreshPeriod">60</attribute>
-   </mbean>
-
-   <!-- ==================================================================== -->
-   <!-- Active Alarm Table                                                   -->
-   <!-- ==================================================================== -->
-
-   <!--
-      | The ActiveAlarmTable service is a simple JMX notification listener
-      | that maintains a table with the received notifications (alarms).
-      | The alarms can be acknowledged through the jmx or the web console.
-      | Modify the SubscriptionList below to subscribe for any notification
-      | in the system and treat it as an alarm.
-      | The JMXNotificationAppender is a log4j Appender that can be configured
-      | in log4j.xml, that trasforms logging events to JMX notification so they
-      | can be fed back into the table. By storing the WARN or higher level logging
-      | events you can have a quick view of important system faults.
-      |
-      | The following attributes may be set:
-      |
-      | MaxTableSize (default 1000)
-      |  - set an upper limit to the number of stored alarms
-      | LogLevel (default DEBUG)
-      |  - the log level to use for received notification, can be set to NONE
-      | ServerId (default jboss)
-      |  - used to construct unique alarm ids
-      | SubscriptionList
-      |  - subscribe for the notifications to be stored in the table
-
-   <mbean code="org.jboss.monitor.services.ActiveAlarmTable"
-          name="jboss.monitor:service=ActiveAlarmTable">
-      <attribute name="SubscriptionList">
-         <subscription-list>
-            <mbean name="jboss.monitor:*">
-               <notification type="jboss.alarm"/>
-               <notification type="JBOSS_MONITOR_NOTIFICATION"/>
-            </mbean>
-            <mbean name="jboss.system:service=Logging,type=JMXNotificationAppender"/>
-         </subscription-list>
-      </attribute>
-   </mbean>
-   -->
-
-   <!-- ==================================================================== -->
-   <!-- JBoss RMI Classloader - only install when available                  -->
-   <!-- ==================================================================== -->
-   <mbean code="org.jboss.util.property.jmx.SystemPropertyClassValue"
-      name="jboss.rmi:type=RMIClassLoader">
-      <attribute name="Property">java.rmi.server.RMIClassLoaderSpi</attribute>
-      <attribute name="ClassName">org.jboss.system.JBossRMIClassLoader</attribute>
-   </mbean>
-
-   <!-- ==================================================================== -->
-   <!-- Service Binding                                                      -->
-   <!-- ==================================================================== -->
-
-   <!-- Automatically activated when generatting the clustering environment -->
-   <!-- @TESTSUITE_CLUSTER_CONFIG@ -->
-
-   <!--
-      | Binding service manager for port/host mapping. This is a sample
-      | config that demonstrates a JBoss instances with a server name 'ports-02'
-      | loading its bindings from an XML file using the ServicesStoreFactory
-      | implementation returned by the XMLServicesStoreFactory.
-      |
-      | ServerName: The unique name assigned to a JBoss server instance for
-      | lookup purposes. This allows a single ServicesStore to handle mulitiple
-      | JBoss servers.
-      |
-      | StoreURL: The URL string passed to org.jboss.services.binding.ServicesStore
-      | during initialization that specifies how to connect to the bindings store.
-      | StoreFactory: The org.jboss.services.binding.ServicesStoreFactory interface
-      | implementation to create to obtain the ServicesStore instance.
--->
-
-   <mbean code="org.jboss.services.binding.ServiceBindingManager"
-     name="jboss.system:service=ServiceBindingManager">
-     <attribute name="ServerName">@server.name@</attribute>
-     <attribute name="StoreURL">${jboss.home.url}/docs/examples/binding-manager/sample-bindings.xml</attribute>
-     <attribute name="StoreFactoryClassName">
-       org.jboss.services.binding.XMLServicesStoreFactory
-     </attribute>
-   </mbean>
-
-   <!-- ==================================================================== -->
-   <!-- Class Loading                                                        -->
-   <!-- ==================================================================== -->
-
-   <!-- A mini webserver used for dynamic and class and resource loading --> 
-   <mbean code="org.jboss.web.WebService"
-      name="jboss:service=WebService">
-      <!-- The Bind address and Port -->
-      <attribute name="BindAddress">${jboss.bind.address}</attribute>      
-      <attribute name="Port">8083</attribute>
-      <!--  The address to use for the host portion of the RMI codebase URL -->
-      <attribute name="Host">${java.rmi.server.hostname}</attribute>
-      <!-- Should non-EJB .class files be downloadable -->
-      <attribute name="DownloadServerClasses">true</attribute>
-      <!-- Should resources other than .class files be downloadable. Both
-         DownloadServerClasses and DownloadResources must be true for resources
-         to be downloadable. This is false by default because its generally a
-         bad idea as server configuration files that container security
-         information can be accessed.
-       -->
-      <attribute name="DownloadResources">false</attribute>
-
-      <!-- Use the default thread pool for dynamic class loading -->
-      <depends optional-attribute-name="ThreadPool"
-         proxy-type="attribute">jboss.system:service=ThreadPool</depends>
-   </mbean>
-
-   <!-- ==================================================================== -->
-   <!-- JNDI                                                                 -->
-   <!-- ==================================================================== -->
-
-   <!-- A simple mbean wrapper around the jndi Naming object. This
-   only handles an in memory instance. The NamingService uses this
-   as the JNDI store and exposes it remotely.
-   -->
-   <mbean code="org.jnp.server.NamingBeanImpl"
-      name="jboss:service=NamingBeanImpl"
-      xmbean-dd="resource:xmdesc/NamingBean-xmbean.xml">
-   </mbean>
-   
-   <mbean code="org.jboss.naming.NamingService"
-      name="jboss:service=Naming"
-      xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
-      <!-- The call by value mode. true if all lookups are unmarshalled using
-         the caller's TCL, false if in VM lookups return the value by reference.
-      -->
-      <attribute name="CallByValue">false</attribute>
-      <!-- The listening port for the bootstrap JNP service. Set this to -1
-         to run the NamingService without the JNP invoker listening port.
-      -->
-      <attribute name="Port">1099</attribute>
-      <!-- The bootstrap JNP server bind address. This also sets the default
-         RMI service bind address. Empty == all addresses
-      -->
-      <attribute name="BindAddress">${jboss.bind.address}</attribute>
-      <!-- The port of the RMI naming service, 0 == anonymous -->
-      <attribute name="RmiPort">1098</attribute>
-      <!-- The RMI service bind address. Empty == all addresses
-      -->
-      <attribute name="RmiBindAddress">${jboss.bind.address}</attribute>
-      <!-- The thread pool service used to control the bootstrap lookups -->
-      <depends optional-attribute-name="LookupPool"
-         proxy-type="attribute">jboss.system:service=ThreadPool</depends>
-      <!-- An example of using the unifed invoker as the transport.
-         <depends optional-attribute-name="InvokerProxyFactory"
-         proxy-type="attribute">jboss:service=proxyFactory,type=unified,target=Naming</depends>
-      -->
-      <depends optional-attribute-name="Naming"
-         proxy-type="attribute">jboss:service=NamingBeanImpl</depends>
-   </mbean>
-   
-   <mbean code="org.jboss.naming.JNDIView"
-   	name="jboss:service=JNDIView"
-   	xmbean-dd="resource:xmdesc/JNDIView-xmbean.xml">
-   	<!-- The HANamingService service name -->
-   	<attribute name="HANamingService">jboss:service=HAJNDI</attribute>
-   </mbean>
-
-   <!-- ==================================================================== -->
-   <!-- Security                                                             -->
-   <!-- ==================================================================== -->
-
-   <mbean code="org.jboss.security.plugins.SecurityConfig"
-      name="jboss.security:service=SecurityConfig">
-      <attribute name="LoginConfig">jboss.security:service=XMLLoginConfig</attribute>
-   </mbean>
-   <mbean code="org.jboss.security.auth.login.XMLLoginConfig"
-      name="jboss.security:service=XMLLoginConfig">
-      <attribute name="ConfigResource">login-config.xml</attribute>
-   </mbean>
-
-   <!-- JAAS security manager and realm mapping -->
-   <mbean code="org.jboss.security.plugins.JaasSecurityManagerService"
-      name="jboss.security:service=JaasSecurityManager">
-      <!-- A flag which indicates whether the SecurityAssociation server mode
-      is set on service creation. This is true by default since the
-      SecurityAssociation should be thread local for multi-threaded server
-      operation.
-      -->
-      <attribute name="ServerMode">true</attribute>
-      <attribute name="SecurityManagerClassName">org.jboss.security.plugins.JaasSecurityManager</attribute>
-      <attribute name="DefaultUnauthenticatedPrincipal">anonymous</attribute>
-      <!-- DefaultCacheTimeout: Specifies the default timed cache policy timeout
-      in seconds.
-      If you want to disable caching of security credentials, set this to 0 to
-      force authentication to occur every time. This has no affect if the
-      AuthenticationCacheJndiName has been changed from the default value.
-      -->
-      <attribute name="DefaultCacheTimeout">1800</attribute>
-      <!-- DefaultCacheResolution: Specifies the default timed cache policy
-      resolution in seconds. This controls the interval at which the cache
-      current timestamp is updated and should be less than the DefaultCacheTimeout
-      in order for the timeout to be meaningful. This has no affect if the
-      AuthenticationCacheJndiName has been changed from the default value.
-      -->
-      <attribute name="DefaultCacheResolution">60</attribute>
-      <!-- DeepCopySubjectMode: This set the copy mode of subjects done by the
-      security managers to be deep copies that makes copies of the subject
-      principals and credentials if they are cloneable. It should be set to
-      true if subject include mutable content that can be corrupted when
-      multiple threads have the same identity and cache flushes/logout clearing
-      the subject in one thread results in subject references affecting other
-      threads.
-      -->
-      <attribute name="DeepCopySubjectMode">false</attribute>
-   </mbean>
-
-   <!-- ==================================================================== -->
-   <!-- Transactions                                                         -->
-   <!-- ==================================================================== -->
-
-   <!-- The configurable Xid factory.  For use with Oracle, set pad to true -->
-   <mbean code="org.jboss.tm.XidFactory"
-      name="jboss:service=XidFactory">
-      <!--attribute name="Pad">true</attribute-->
-   </mbean>
-
-   <!--
-      | The fast in-memory transaction manager.
-      | Deprecated in JBossAS v4.2. Use JBossTS JTA instead.
-    - ->
-   <mbean code="org.jboss.tm.TransactionManagerService"
-      name="jboss:service=TransactionManager"
-      xmbean-dd="resource:xmdesc/TransactionManagerService-xmbean.xml">
-      <attribute name="TransactionTimeout">300</attribute>
-      <!- - set to false to disable transaction demarcation over IIOP - ->
-      <attribute name="GlobalIdsEnabled">true</attribute>
-      <depends optional-attribute-name="XidFactory">jboss:service=XidFactory</depends>
-
-      <!- - Transaction Integrity Checking - ->
-      <!- - Force a rollback if another thread is associated with the transaction at commit - ->
-      <!- - <depends optional-attribute-name="TransactionIntegrityFactory"
-               proxy-type="org.jboss.tm.integrity.TransactionIntegrityFactory">
-         <mbean code="org.jboss.tm.integrity.FailIncompleteTransaction"
-                name="jboss:service=TransactionManager,plugin=TransactionIntegrity"/>
-      </depends> - ->
-   </mbean>
-   -->
-
-   <!-- JBoss Transactions JTA -->
-   <mbean code="com.arjuna.ats.jbossatx.jta.TransactionManagerService"
-      name="jboss:service=TransactionManager">
-      <attribute name="TransactionTimeout">300</attribute>
-      <attribute name="ObjectStoreDir">${jboss.server.data.dir}/tx-object-store</attribute> 
-   </mbean>
-
-   <!--
-      | UserTransaction support.
-    -->
-   <mbean code="org.jboss.tm.usertx.server.ClientUserTransactionService"
-      name="jboss:service=ClientUserTransaction"
-      xmbean-dd="resource:xmdesc/ClientUserTransaction-xmbean.xml">
-      <depends>
-         <mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
-            name="jboss:service=proxyFactory,target=ClientUserTransactionFactory">
-            <attribute name="InvokerName">jboss:service=invoker,type=jrmp</attribute>
-            <attribute name="TargetName">jboss:service=ClientUserTransaction</attribute>
-            <attribute name="JndiName">UserTransactionSessionFactory</attribute>
-            <attribute name="ExportedInterface">org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory</attribute>
-            <attribute name="ClientInterceptors">
-               <interceptors>
-                  <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
-                  <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
-               </interceptors>
-            </attribute>
-            <depends>jboss:service=invoker,type=jrmp</depends>
-         </mbean>
-      </depends>
-      <depends optional-attribute-name="TxProxyName">
-         <mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
-            name="jboss:service=proxyFactory,target=ClientUserTransaction">
-            <attribute name="InvokerName">jboss:service=invoker,type=jrmp</attribute>
-            <attribute name="TargetName">jboss:service=ClientUserTransaction</attribute>
-            <attribute name="JndiName"></attribute>
-            <attribute name="ExportedInterface">org.jboss.tm.usertx.interfaces.UserTransactionSession</attribute>
-            <attribute name="ClientInterceptors">
-               <interceptors>
-                  <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
-                  <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
-               </interceptors>
-            </attribute>
-            <depends>jboss:service=invoker,type=jrmp</depends>
-         </mbean>
-      </depends>
-   </mbean>
-
-   <!-- ==================================================================== -->
-   <!-- Invokers to the JMX node                                             -->
-   <!-- ==================================================================== -->
-
-   <!-- Unified invoker (based on remoting) -->
-   <mbean code="org.jboss.invocation.unified.server.UnifiedInvoker"
-      name="jboss:service=invoker,type=unified">
-      <!-- To turn on strict RMI exception propagation uncomment block below -->
-      <!-- This will cause the UnifiedInvokerProxy to wrap RemoteExceptions  -->
-      <!-- within a ServerException, otherwise will throw root exception     -->
-      <!-- (not RemoteException)                                             -->
-      <!-- <attribute name="StrictRMIException">true</attribute> -->
-      <depends>jboss:service=TransactionManager</depends>
-      <depends>jboss.remoting:service=Connector,transport=socket</depends>
-   </mbean>
-
-   <!-- RMI/JRMP invoker -->
-   <mbean code="org.jboss.invocation.jrmp.server.JRMPInvoker"
-      name="jboss:service=invoker,type=jrmp">
-      <attribute name="RMIObjectPort">4444</attribute>
-      <attribute name="ServerAddress">${jboss.bind.address}</attribute>
-      <!--
-      <attribute name="RMIClientSocketFactory">custom</attribute>
-      <attribute name="RMIServerSocketFactory">custom</attribute>
-      <attribute name="RMIServerSocketAddr">custom</attribute>
-      <attribute name="SecurityDomain">ssl-domain-name</attribute>
-      -->
-      <depends>jboss:service=TransactionManager</depends>
-   </mbean>
-
-   <mbean code="org.jboss.invocation.local.LocalInvoker"
-      name="jboss:service=invoker,type=local">
-
-      <depends>jboss:service=TransactionManager</depends>
-   </mbean>
-
-   <mbean code="org.jboss.invocation.pooled.server.PooledInvoker"
-      name="jboss:service=invoker,type=pooled">
-      <attribute name="NumAcceptThreads">1</attribute>
-      <attribute name="MaxPoolSize">300</attribute>
-      <attribute name="ClientMaxPoolSize">300</attribute>
-      <attribute name="SocketTimeout">60000</attribute>
-      <attribute name="ServerBindAddress">${jboss.bind.address}</attribute>
-      <attribute name="ServerBindPort">4445</attribute>
-      <attribute name="ClientConnectAddress">${jboss.bind.address}</attribute>
-      <attribute name="ClientConnectPort">0</attribute>
-      <attribute name="ClientRetryCount">1</attribute>
-      <attribute name="EnableTcpNoDelay">false</attribute>
-
-      <!-- Customized socket factory attributes
-      <attribute name="ClientSocketFactoryName">custom.client.factory</attribute>
-      <attribute name="ServerSocketFactoryName">custom.server.factory</attribute>
-      <attribute name="SslDomain">java:/jaas/pooledInvoker</attribute>
-      -->
-      <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
-   </mbean>
-
-   <!-- ==================================================================== -->
-   <!-- Remoting services 						                                   -->
-   <!-- ==================================================================== -->
-
-   <!-- For detailed description of all these configuration attributes, please see the -->
-   <!-- JBoss Remoting User's Guide or wiki (http://labs.jboss.com/portal/jbossremoting/docs/guide/index.html) -->
-
-    <!-- The NetworkRegistry contains all the local and remote -->
-    <!-- servers that it recognizes.  The remote ones registered -->
-    <!-- are dependant on the detectors running and which domains -->
-    <!-- they are configured to identify.                         -->
-    <mbean code="org.jboss.remoting.network.NetworkRegistry"
-           name="jboss.remoting:service=NetworkRegistry"/>
-
-   <!-- The Connector is the core component of the remoting server service. -->
-   <!-- It binds the remoting invoker (transport protocol, callback configuration, -->
-   <!-- data marshalling, etc.) with the invocation handlers.  -->
-   <mbean code="org.jboss.remoting.transport.Connector"
-          name="jboss.remoting:service=Connector,transport=socket"
-          display-name="Socket transport Connector">
-
-       <!-- Can either just specify the InvokerLocator attribute and not the invoker element in the -->
-       <!-- Configuration attribute, or do the full invoker configuration in the in invoker element -->
-       <!-- of the Configuration attribute. -->
-
-       <!-- Remember that if you do use more than one param on the uri, will have to include as a CDATA, -->
-       <!-- otherwise, parser will complain. -->
-       <!-- <attribute name="InvokerLocator"><![CDATA[socket://${jboss.bind.address}:4446/?datatype=invocation]]></attribute> -->
-
-      <attribute name="Configuration">
-         <!-- Using the following <invoker> element instead of the InvokerLocator above because specific attributes needed. -->
-         <!-- If wanted to use any of the parameters below, can just add them as parameters to the url above if wanted use the InvokerLocator attribute. -->
-         <config>
-            <!-- Other than transport type and handler, none of these configurations are required (will just use defaults). -->
-            <invoker transport="socket">
-               <attribute name="dataType" isParam="true">invocation</attribute>
-               <attribute name="marshaller" isParam="true">org.jboss.invocation.unified.marshall.InvocationMarshaller</attribute>
-               <attribute name="unmarshaller" isParam="true">org.jboss.invocation.unified.marshall.InvocationUnMarshaller</attribute>
-               <!-- This will be port on which the marshall loader port runs on.  -->
-               <!-- <attribute name="loaderport" isParam="true">4447</attribute> -->
-               <!-- The following are specific to socket invoker -->
-               <!-- <attribute name="numAcceptThreads">1</attribute>-->
-               <!-- <attribute name="maxPoolSize">303</attribute>-->
-               <!-- <attribute name="clientMaxPoolSize" isParam="true">304</attribute>-->
-               <attribute name="socketTimeout" isParam="true">600000</attribute>
-               <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
-               <attribute name="serverBindPort">4446</attribute>
-               <!-- <attribute name="clientConnectAddress">216.23.33.2</attribute> -->
-               <!-- <attribute name="clientConnectPort">7777</attribute> -->
-               <attribute name="enableTcpNoDelay" isParam="true">true</attribute>
-               <!-- <attribute name="backlog">200</attribute>-->
-               <!-- The following is for callback configuration and is independant of invoker type -->
-               <!-- <attribute name="callbackMemCeiling">30</attribute>-->
-               <!-- indicates callback store by fully qualified class name -->
-               <!-- <attribute name="callbackStore">org.jboss.remoting.CallbackStore</attribute>-->
-               <!-- indicates callback store by object name -->
-               <!-- <attribute name="callbackStore">jboss.remoting:service=CallbackStore,type=Serializable</attribute> -->
-               <!-- config params for callback store.  if were declaring callback store via object name, -->
-               <!-- could have specified these config params there. -->
-               <!-- StoreFilePath indicates to which directory to write the callback objects. -->
-               <!-- The default value is the property value of 'jboss.server.data.dir' and if this is not set, -->
-               <!-- then will be 'data'. Will then append 'remoting' and the callback client's session id. -->
-               <!-- An example would be 'data\remoting\5c4o05l-9jijyx-e5b6xyph-1-e5b6xyph-2'. -->
-               <!-- <attribute name="StoreFilePath">callback</attribute>-->
-               <!-- StoreFileSuffix indicates the file suffix to use for the callback objects written to disk. -->
-               <!-- The default value for file suffix is 'ser'. -->
-               <!-- <attribute name="StoreFileSuffix">cst</attribute>-->
-            </invoker>
-
-            <!-- At least one handler is required by the connector.  If have more than one, must decalre -->
-            <!-- different subsystem values.  Otherwise, all invocations will be routed to the only one -->
-            <!-- that is declared. -->
-            <handlers>
-               <!-- can also specify handler by fully qualified classname -->
-               <handler subsystem="invoker">jboss:service=invoker,type=unified</handler>
-            </handlers>
-         </config>
-      </attribute>
-      <depends>jboss.remoting:service=NetworkRegistry</depends>
-   </mbean>
-
-
-   <!-- <mbean code="org.jboss.remoting.detection.jndi.JNDIDetector"-->
-   <!--      name="jboss.remoting:service=Detector,transport=jndi">-->
-   <!-- host to which the detector will connect to for the JNDI server. -->
-   <!-- <attribute name="Host">localhost</attribute>-->
-   <!-- port to which detector will connect to for the JNDI server. -->
-   <!-- <attribute name="Port">5555</attribute>-->
-   <!-- context factory string used when connecting to the JNDI server. -->
-   <!-- The default is org.jnp.interfaces.NamingContextFactory. -->
-   <!-- <attribute name="ContextFactory">org.acme.NamingContextFactory</attribute> -->
-   <!-- url package string to use when connecting to the JNDI server. -->
-   <!-- The default is org.jboss.naming:org.jnp.interfaces. -->
-   <!-- <attribute name="URLPackage">org.acme.naming</attribute> -->
-   <!-- Sets the number of detection iterations before manually pinging -->
-   <!-- remote server to make sure still alive. This is needed since remote server -->
-   <!-- could crash and yet still have an entry in the JNDI server, -->
-   <!-- thus making it appear that it is still there. The default value is 5. -->
-   <!-- <attribute name="CleanDetectionNumber">20</attribute>-->
-
-   <!-- Specifies the domains in which the detector will recognize -->
-   <!-- detections.  If servers are not configured to be in these -->
-   <!-- domains, they will not be added to NetworkRegistry. -->
-   <!--      <attribute name="Configuration">-->
-   <!--         <domains>-->
-   <!--            <domain>roxanne</domain>-->
-   <!--            <domain>sparky</domain>-->
-   <!--         </domains>-->
-   <!--      </attribute>-->
-   <!--   </mbean>-->
-
-
-   <!-- ==================================================================== -->
-   <!-- Monitoring and Management                                            -->
-   <!-- ==================================================================== -->
-
-   <!-- Uncomment to enable JMX monitoring of the bean cache
-   <mbean code="org.jboss.monitor.BeanCacheMonitor"
-          name="jboss.monitor:name=BeanCacheMonitor"/>
-   -->
-
-   <!-- Uncomment to enable JMX monitoring of the entity bean locking
-   <mbean code="org.jboss.monitor.EntityLockMonitor"
-          name="jboss.monitor:name=EntityLockMonitor"/>
-   -->
-
-   <!-- ==================================================================== -->
-   <!-- An MBean that is a registry for JDBC type-mapping metadata           -->
-   <!-- ==================================================================== -->
-
-   <mbean code="org.jboss.ejb.plugins.cmp.jdbc.metadata.MetaDataLibrary"
-      name="jboss.jdbc:service=metadata"/>
-
-   <!-- ==================================================================== -->
-   <!-- Deployment Scanning                                                  -->
-   <!-- ==================================================================== -->
-
-   <!-- An mbean for hot deployment/undeployment of archives.
-   -->
-   <mbean code="org.jboss.deployment.scanner.URLDeploymentScanner"
-      name="jboss.deployment:type=DeploymentScanner,flavor=URL">
-
-      <!-- Uncomment (and comment/remove version below) to enable usage of the
-        DeploymentCache
-      <depends optional-attribute-name="Deployer">jboss.deployment:type=DeploymentCache</depends>
-      -->
-      <depends optional-attribute-name="Deployer">jboss.system:service=MainDeployer</depends>
-
-      <!-- The URLComparator can be used to specify a deployment ordering
-           for deployments found in a scanned directory.  The class specified
-           must be an implementation of java.util.Comparator, it must be able
-           to compare two URL objects, and it must have a no-arg constructor.
-           Two deployment comparators are shipped with JBoss:
-             - org.jboss.deployment.DeploymentSorter
-               Sorts by file extension, as follows:
-                 "sar", "service.xml", "rar", "jar", "war", "wsr", "ear", "zip",
-                 "*"
-             - org.jboss.deployment.scanner.PrefixDeploymentSorter
-               If the name portion of the url begins with 1 or more digits, those
-               digits are converted to an int (ignoring leading zeroes), and
-               files are deployed in that order.  Files that do not start with
-               any digits will be deployed first, and they will be sorted by
-               extension as above with DeploymentSorter.
-      -->
-      <attribute name="URLComparator">org.jboss.deployment.DeploymentSorter</attribute>
-
-      <!--
-      <attribute name="URLComparator">org.jboss.deployment.scanner.PrefixDeploymentSorter</attribute>
-      -->
-
-      <!-- The FilterInstance specifies a URLLister.URLFilter for scanned
-           directories. This DeploymentFilter is initialized with the given
-           prefixes, suffixes and matches that define which URLs should be
-           ignored.
-      -->
-      <attribute name="FilterInstance"
-         attributeClass="org.jboss.deployment.scanner.DeploymentFilter"
-         serialDataType="javaBean">
-         <!-- Files starting with theses strings are ignored -->
-         <property name="prefixes">#,%,\,,.,_$</property>
-         <!-- Files ending with theses strings are ignored -->
-         <property name="suffixes">#,$,%,~,\,v,.BAK,.bak,.old,.orig,.tmp,.rej,.sh</property>
-         <!-- Files matching with theses strings are ignored -->
-         <property name="matches">.make.state,.nse_depinfo,CVS,CVS.admin,RCS,RCSLOG,SCCS,TAGS,core,tags</property>
-      </attribute>
-
-      <!-- Frequency in milliseconds to rescan the URLs for changes -->
-      <attribute name="ScanPeriod">5000</attribute>
-
-      <!-- A flag to disable the scans -->
-      <attribute name="ScanEnabled">true</attribute>
-
-      <!-- URLs are comma separated and resolve relative to the server home URL
-         unless the given path is absolute. If the URL ends in "/" it is
-         considered a collection and scanned, otherwise it is simply deployed;
-         this follows RFC2518 convention and allows discrimination between
-         collections and directories that are simply unpacked archives.
-
-         URLs may be local (file:) or remote (http:). Scanning is supported
-         for remote URLs but unpacked deployment units are not.
-
-         Example URLs:
-            deploy/
-                 scans ${jboss.server.url}/deploy/, which is local or remote
-                 depending on the URL used to boot the server
-            ${jboss.server.home}/deploy/
-                 scans ${jboss.server.home)/deploy, which is always local
-            file:/var/opt/myapp.ear
-                 deploy myapp.ear from a local location
-            file:/var/opt/apps/
-                 scans the specified directory
-            http://www.test.com/netboot/myapp.ear
-                 deploys myapp.ear from a remote location
-            http://www.test.com/netboot/apps/
-                 scans the specified WebDAV location
-       -->
-      <attribute name="URLs">
-         deploy/
-      </attribute>
-
-      <!-- Indicates if the scanner should recursively scan directories that
-      contain no "." in their names. This can be used to group applications
-      and services that must be deployed and that have the same
-      logical function in the same directory i.e.
-        deploy/JMX/
-        deploy/JMS/
-        ...
-      -->
-      <attribute name="RecursiveSearch">True</attribute>
-
-   </mbean>
-
-</server>

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/resources/jboss-service.xml (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/resources/jboss-service.xml)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/two_servers/resources/jboss-service.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/resources/jboss-service.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,696 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id: jboss-service.xml 62434 2007-04-19 21:22:50Z dimitris at jboss.org $ -->
+
+<!-- ===================================================================== -->
+<!--  JBoss Server Configuration                                           -->
+<!-- ===================================================================== -->
+
+<server>
+
+   <!-- Load all jars from the JBOSS_DIST/server/<config>/lib directory. This
+     can be restricted to specific jars by specifying them in the archives
+     attribute.
+    -->
+   <classpath codebase="${jboss.server.lib.url:lib}" archives="*"/>
+
+   <!-- ==================================================================== -->
+   <!-- JSR-77 Single JBoss Server Management Domain                         -->
+   <!-- ==================================================================== -->
+   <mbean code="org.jboss.management.j2ee.LocalJBossServerDomain"
+      name="jboss.management.local:j2eeType=J2EEDomain,name=Manager">
+      <attribute name="MainDeployer">jboss.system:service=MainDeployer</attribute>
+      <attribute name="SARDeployer">jboss.system:service=ServiceDeployer</attribute>
+      <attribute name="EARDeployer">jboss.j2ee:service=EARDeployer</attribute>
+      <attribute name="EJBDeployer">jboss.ejb:service=EJBDeployer</attribute>
+      <attribute name="RARDeployer">jboss.jca:service=RARDeployer</attribute>
+      <attribute name="CMDeployer">jboss.jca:service=ConnectionFactoryDeployer</attribute>
+      <attribute name="WARDeployer">jboss.web:service=WebServer</attribute>
+      <attribute name="CARDeployer">jboss.j2ee:service=ClientDeployer</attribute>
+      <attribute name="MailService">jboss:service=Mail</attribute>
+      <attribute name="JMSService">jboss.mq:service=DestinationManager</attribute>
+      <attribute name="JNDIService">jboss:service=Naming</attribute>
+      <attribute name="JTAService">jboss:service=TransactionManager</attribute>
+      <attribute name="UserTransactionService">jboss:service=ClientUserTransaction</attribute>
+      <attribute name="RMI_IIOPService">jboss:service=CorbaORB</attribute>
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- XMBean Persistence                                                   -->
+   <!-- ==================================================================== -->
+   <mbean code="org.jboss.system.pm.AttributePersistenceService"
+      name="jboss:service=AttributePersistenceService"
+      xmbean-dd="resource:xmdesc/AttributePersistenceService-xmbean.xml">
+      <!-- the AttributePersistenceService is persistent, itself -->
+
+      <!--
+      <attribute name="AttributePersistenceManagerClass">org.jboss.system.pm.XMLAttributePersistenceManager</attribute>
+      <attribute name="AttributePersistenceManagerConfig">
+         <data-directory>data/xmbean-attrs</data-directory>
+      </attribute>
+      <attribute name="ApmDestroyOnServiceStop">false</attribute>
+      <attribute name="VersionTag"></attribute>
+      -->
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- Thread Pool                                                          -->
+   <!-- ==================================================================== -->
+   
+   <!-- A Thread pool service -->
+   <mbean code="org.jboss.util.threadpool.BasicThreadPool"
+      name="jboss.system:service=ThreadPool">
+      <attribute name="Name">JBoss System Threads</attribute>
+      <attribute name="ThreadGroupName">System Threads</attribute>
+      <!-- How long a thread will live without any tasks in MS -->
+      <attribute name="KeepAliveTime">60000</attribute>
+      <!-- The max number of threads in the pool -->
+      <attribute name="MaximumPoolSize">10</attribute>
+      <!-- The max number of tasks before the queue is full -->
+      <attribute name="MaximumQueueSize">1000</attribute>
+      <!-- The behavior of the pool when a task is added and the queue is full.
+      abort - a RuntimeException is thrown
+      run - the calling thread executes the task
+      wait - the calling thread blocks until the queue has room
+      discard - the task is silently discarded without being run
+      discardOldest - check to see if a task is about to complete and enque
+         the new task if possible, else run the task in the calling thread
+      -->
+      <attribute name="BlockingMode">run</attribute>
+   </mbean>
+
+   <!-- Preload all custom editors for VMs that don't use the thread
+        context class loader when searching for PropertyEditors. Uncomment
+        if your JDK 1.3.0 VM fails to find JBoss PropertyEditors.
+   <mbean code="org.jboss.varia.property.PropertyEditorManagerService"
+     name="jboss:type=Service,name=BootstrapEditors">
+     <attribute name="BootstrapEditors">
+       java.math.BigDecimal=org.jboss.util.propertyeditor.BigDecimalEditor
+       java.lang.Boolean=org.jboss.util.propertyeditor.BooleanEditor
+       java.lang.Class=org.jboss.util.propertyeditor.ClassEditor
+       java.util.Date=org.jboss.util.propertyeditor.DateEditor
+       java.io.File=org.jboss.util.propertyeditor.FileEditor
+       java.net.InetAddress=org.jboss.util.propertyeditor.InetAddressEditor
+       java.lang.Integer=org.jboss.util.propertyeditor.IntegerEditor
+       javax.management.ObjectName=org.jboss.mx.util.propertyeditor.ObjectNameEditor
+       java.util.Properties=org.jboss.util.propertyeditor.PropertiesEditor
+       [Ljava.lang.String;=org.jboss.util.propertyeditor.StringArrayEditor
+       java.net.URL=org.jboss.util.propertyeditor.URLEditor
+     </attribute>
+   </mbean>
+   -->
+
+   <!-- ==================================================================== -->
+   <!-- Log4j Initialization                                                 -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.logging.Log4jService"
+      name="jboss.system:type=Log4jService,service=Logging"
+	  xmbean-dd="resource:xmdesc/Log4jService-xmbean.xml">
+      <attribute name="ConfigurationURL">resource:jboss-log4j.xml</attribute>
+      <!-- Set the org.apache.log4j.helpers.LogLog.setQuiteMode. As of log4j1.2.8
+      this needs to be set to avoid a possible deadlock on exception at the
+      appender level. See bug#696819.
+      -->
+      <attribute name="Log4jQuietMode">true</attribute>
+      <!-- How frequently in seconds the ConfigurationURL is checked for changes -->
+      <attribute name="RefreshPeriod">60</attribute>
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- Active Alarm Table                                                   -->
+   <!-- ==================================================================== -->
+
+   <!--
+      | The ActiveAlarmTable service is a simple JMX notification listener
+      | that maintains a table with the received notifications (alarms).
+      | The alarms can be acknowledged through the jmx or the web console.
+      | Modify the SubscriptionList below to subscribe for any notification
+      | in the system and treat it as an alarm.
+      | The JMXNotificationAppender is a log4j Appender that can be configured
+      | in log4j.xml, that trasforms logging events to JMX notification so they
+      | can be fed back into the table. By storing the WARN or higher level logging
+      | events you can have a quick view of important system faults.
+      |
+      | The following attributes may be set:
+      |
+      | MaxTableSize (default 1000)
+      |  - set an upper limit to the number of stored alarms
+      | LogLevel (default DEBUG)
+      |  - the log level to use for received notification, can be set to NONE
+      | ServerId (default jboss)
+      |  - used to construct unique alarm ids
+      | SubscriptionList
+      |  - subscribe for the notifications to be stored in the table
+
+   <mbean code="org.jboss.monitor.services.ActiveAlarmTable"
+          name="jboss.monitor:service=ActiveAlarmTable">
+      <attribute name="SubscriptionList">
+         <subscription-list>
+            <mbean name="jboss.monitor:*">
+               <notification type="jboss.alarm"/>
+               <notification type="JBOSS_MONITOR_NOTIFICATION"/>
+            </mbean>
+            <mbean name="jboss.system:service=Logging,type=JMXNotificationAppender"/>
+         </subscription-list>
+      </attribute>
+   </mbean>
+   -->
+
+   <!-- ==================================================================== -->
+   <!-- JBoss RMI Classloader - only install when available                  -->
+   <!-- ==================================================================== -->
+   <mbean code="org.jboss.util.property.jmx.SystemPropertyClassValue"
+      name="jboss.rmi:type=RMIClassLoader">
+      <attribute name="Property">java.rmi.server.RMIClassLoaderSpi</attribute>
+      <attribute name="ClassName">org.jboss.system.JBossRMIClassLoader</attribute>
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- Service Binding                                                      -->
+   <!-- ==================================================================== -->
+
+   <!-- Automatically activated when generatting the clustering environment -->
+   <!-- @TESTSUITE_CLUSTER_CONFIG@ -->
+
+   <!--
+      | Binding service manager for port/host mapping. This is a sample
+      | config that demonstrates a JBoss instances with a server name 'ports-02'
+      | loading its bindings from an XML file using the ServicesStoreFactory
+      | implementation returned by the XMLServicesStoreFactory.
+      |
+      | ServerName: The unique name assigned to a JBoss server instance for
+      | lookup purposes. This allows a single ServicesStore to handle mulitiple
+      | JBoss servers.
+      |
+      | StoreURL: The URL string passed to org.jboss.services.binding.ServicesStore
+      | during initialization that specifies how to connect to the bindings store.
+      | StoreFactory: The org.jboss.services.binding.ServicesStoreFactory interface
+      | implementation to create to obtain the ServicesStore instance.
+-->
+
+   <mbean code="org.jboss.services.binding.ServiceBindingManager"
+     name="jboss.system:service=ServiceBindingManager">
+     <attribute name="ServerName">@server.name@</attribute>
+     <attribute name="StoreURL">${jboss.home.url}/docs/examples/binding-manager/sample-bindings.xml</attribute>
+     <attribute name="StoreFactoryClassName">
+       org.jboss.services.binding.XMLServicesStoreFactory
+     </attribute>
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- Class Loading                                                        -->
+   <!-- ==================================================================== -->
+
+   <!-- A mini webserver used for dynamic and class and resource loading --> 
+   <mbean code="org.jboss.web.WebService"
+      name="jboss:service=WebService">
+      <!-- The Bind address and Port -->
+      <attribute name="BindAddress">${jboss.bind.address}</attribute>      
+      <attribute name="Port">8083</attribute>
+      <!--  The address to use for the host portion of the RMI codebase URL -->
+      <attribute name="Host">${java.rmi.server.hostname}</attribute>
+      <!-- Should non-EJB .class files be downloadable -->
+      <attribute name="DownloadServerClasses">true</attribute>
+      <!-- Should resources other than .class files be downloadable. Both
+         DownloadServerClasses and DownloadResources must be true for resources
+         to be downloadable. This is false by default because its generally a
+         bad idea as server configuration files that container security
+         information can be accessed.
+       -->
+      <attribute name="DownloadResources">false</attribute>
+
+      <!-- Use the default thread pool for dynamic class loading -->
+      <depends optional-attribute-name="ThreadPool"
+         proxy-type="attribute">jboss.system:service=ThreadPool</depends>
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- JNDI                                                                 -->
+   <!-- ==================================================================== -->
+
+   <!-- A simple mbean wrapper around the jndi Naming object. This
+   only handles an in memory instance. The NamingService uses this
+   as the JNDI store and exposes it remotely.
+   -->
+   <mbean code="org.jnp.server.NamingBeanImpl"
+      name="jboss:service=NamingBeanImpl"
+      xmbean-dd="resource:xmdesc/NamingBean-xmbean.xml">
+   </mbean>
+   
+   <mbean code="org.jboss.naming.NamingService"
+      name="jboss:service=Naming"
+      xmbean-dd="resource:xmdesc/NamingService-xmbean.xml">
+      <!-- The call by value mode. true if all lookups are unmarshalled using
+         the caller's TCL, false if in VM lookups return the value by reference.
+      -->
+      <attribute name="CallByValue">false</attribute>
+      <!-- The listening port for the bootstrap JNP service. Set this to -1
+         to run the NamingService without the JNP invoker listening port.
+      -->
+      <attribute name="Port">1099</attribute>
+      <!-- The bootstrap JNP server bind address. This also sets the default
+         RMI service bind address. Empty == all addresses
+      -->
+      <attribute name="BindAddress">${jboss.bind.address}</attribute>
+      <!-- The port of the RMI naming service, 0 == anonymous -->
+      <attribute name="RmiPort">1098</attribute>
+      <!-- The RMI service bind address. Empty == all addresses
+      -->
+      <attribute name="RmiBindAddress">${jboss.bind.address}</attribute>
+      <!-- The thread pool service used to control the bootstrap lookups -->
+      <depends optional-attribute-name="LookupPool"
+         proxy-type="attribute">jboss.system:service=ThreadPool</depends>
+      <!-- An example of using the unifed invoker as the transport.
+         <depends optional-attribute-name="InvokerProxyFactory"
+         proxy-type="attribute">jboss:service=proxyFactory,type=unified,target=Naming</depends>
+      -->
+      <depends optional-attribute-name="Naming"
+         proxy-type="attribute">jboss:service=NamingBeanImpl</depends>
+   </mbean>
+   
+   <mbean code="org.jboss.naming.JNDIView"
+   	name="jboss:service=JNDIView"
+   	xmbean-dd="resource:xmdesc/JNDIView-xmbean.xml">
+   	<!-- The HANamingService service name -->
+   	<attribute name="HANamingService">jboss:service=HAJNDI</attribute>
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- Security                                                             -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.security.plugins.SecurityConfig"
+      name="jboss.security:service=SecurityConfig">
+      <attribute name="LoginConfig">jboss.security:service=XMLLoginConfig</attribute>
+   </mbean>
+   <mbean code="org.jboss.security.auth.login.XMLLoginConfig"
+      name="jboss.security:service=XMLLoginConfig">
+      <attribute name="ConfigResource">login-config.xml</attribute>
+   </mbean>
+
+   <!-- JAAS security manager and realm mapping -->
+   <mbean code="org.jboss.security.plugins.JaasSecurityManagerService"
+      name="jboss.security:service=JaasSecurityManager">
+      <!-- A flag which indicates whether the SecurityAssociation server mode
+      is set on service creation. This is true by default since the
+      SecurityAssociation should be thread local for multi-threaded server
+      operation.
+      -->
+      <attribute name="ServerMode">true</attribute>
+      <attribute name="SecurityManagerClassName">org.jboss.security.plugins.JaasSecurityManager</attribute>
+      <attribute name="DefaultUnauthenticatedPrincipal">anonymous</attribute>
+      <!-- DefaultCacheTimeout: Specifies the default timed cache policy timeout
+      in seconds.
+      If you want to disable caching of security credentials, set this to 0 to
+      force authentication to occur every time. This has no affect if the
+      AuthenticationCacheJndiName has been changed from the default value.
+      -->
+      <attribute name="DefaultCacheTimeout">1800</attribute>
+      <!-- DefaultCacheResolution: Specifies the default timed cache policy
+      resolution in seconds. This controls the interval at which the cache
+      current timestamp is updated and should be less than the DefaultCacheTimeout
+      in order for the timeout to be meaningful. This has no affect if the
+      AuthenticationCacheJndiName has been changed from the default value.
+      -->
+      <attribute name="DefaultCacheResolution">60</attribute>
+      <!-- DeepCopySubjectMode: This set the copy mode of subjects done by the
+      security managers to be deep copies that makes copies of the subject
+      principals and credentials if they are cloneable. It should be set to
+      true if subject include mutable content that can be corrupted when
+      multiple threads have the same identity and cache flushes/logout clearing
+      the subject in one thread results in subject references affecting other
+      threads.
+      -->
+      <attribute name="DeepCopySubjectMode">false</attribute>
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- Transactions                                                         -->
+   <!-- ==================================================================== -->
+
+   <!-- The configurable Xid factory.  For use with Oracle, set pad to true -->
+   <mbean code="org.jboss.tm.XidFactory"
+      name="jboss:service=XidFactory">
+      <!--attribute name="Pad">true</attribute-->
+   </mbean>
+
+   <!--
+      | The fast in-memory transaction manager.
+      | Deprecated in JBossAS v4.2. Use JBossTS JTA instead.
+    - ->
+   <mbean code="org.jboss.tm.TransactionManagerService"
+      name="jboss:service=TransactionManager"
+      xmbean-dd="resource:xmdesc/TransactionManagerService-xmbean.xml">
+      <attribute name="TransactionTimeout">300</attribute>
+      <!- - set to false to disable transaction demarcation over IIOP - ->
+      <attribute name="GlobalIdsEnabled">true</attribute>
+      <depends optional-attribute-name="XidFactory">jboss:service=XidFactory</depends>
+
+      <!- - Transaction Integrity Checking - ->
+      <!- - Force a rollback if another thread is associated with the transaction at commit - ->
+      <!- - <depends optional-attribute-name="TransactionIntegrityFactory"
+               proxy-type="org.jboss.tm.integrity.TransactionIntegrityFactory">
+         <mbean code="org.jboss.tm.integrity.FailIncompleteTransaction"
+                name="jboss:service=TransactionManager,plugin=TransactionIntegrity"/>
+      </depends> - ->
+   </mbean>
+   -->
+
+   <!-- JBoss Transactions JTA -->
+   <mbean code="com.arjuna.ats.jbossatx.jta.TransactionManagerService"
+      name="jboss:service=TransactionManager">
+      <attribute name="TransactionTimeout">300</attribute>
+      <attribute name="ObjectStoreDir">${jboss.server.data.dir}/tx-object-store</attribute> 
+   </mbean>
+
+   <!--
+      | UserTransaction support.
+    -->
+   <mbean code="org.jboss.tm.usertx.server.ClientUserTransactionService"
+      name="jboss:service=ClientUserTransaction"
+      xmbean-dd="resource:xmdesc/ClientUserTransaction-xmbean.xml">
+      <depends>
+         <mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
+            name="jboss:service=proxyFactory,target=ClientUserTransactionFactory">
+            <attribute name="InvokerName">jboss:service=invoker,type=jrmp</attribute>
+            <attribute name="TargetName">jboss:service=ClientUserTransaction</attribute>
+            <attribute name="JndiName">UserTransactionSessionFactory</attribute>
+            <attribute name="ExportedInterface">org.jboss.tm.usertx.interfaces.UserTransactionSessionFactory</attribute>
+            <attribute name="ClientInterceptors">
+               <interceptors>
+                  <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
+                  <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
+               </interceptors>
+            </attribute>
+            <depends>jboss:service=invoker,type=jrmp</depends>
+         </mbean>
+      </depends>
+      <depends optional-attribute-name="TxProxyName">
+         <mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory"
+            name="jboss:service=proxyFactory,target=ClientUserTransaction">
+            <attribute name="InvokerName">jboss:service=invoker,type=jrmp</attribute>
+            <attribute name="TargetName">jboss:service=ClientUserTransaction</attribute>
+            <attribute name="JndiName"></attribute>
+            <attribute name="ExportedInterface">org.jboss.tm.usertx.interfaces.UserTransactionSession</attribute>
+            <attribute name="ClientInterceptors">
+               <interceptors>
+                  <interceptor>org.jboss.proxy.ClientMethodInterceptor</interceptor>
+                  <interceptor>org.jboss.invocation.InvokerInterceptor</interceptor>
+               </interceptors>
+            </attribute>
+            <depends>jboss:service=invoker,type=jrmp</depends>
+         </mbean>
+      </depends>
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- Invokers to the JMX node                                             -->
+   <!-- ==================================================================== -->
+
+   <!-- Unified invoker (based on remoting) -->
+   <mbean code="org.jboss.invocation.unified.server.UnifiedInvoker"
+      name="jboss:service=invoker,type=unified">
+      <!-- To turn on strict RMI exception propagation uncomment block below -->
+      <!-- This will cause the UnifiedInvokerProxy to wrap RemoteExceptions  -->
+      <!-- within a ServerException, otherwise will throw root exception     -->
+      <!-- (not RemoteException)                                             -->
+      <!-- <attribute name="StrictRMIException">true</attribute> -->
+      <depends>jboss:service=TransactionManager</depends>
+      <depends>jboss.remoting:service=Connector,transport=socket</depends>
+   </mbean>
+
+   <!-- RMI/JRMP invoker -->
+   <mbean code="org.jboss.invocation.jrmp.server.JRMPInvoker"
+      name="jboss:service=invoker,type=jrmp">
+      <attribute name="RMIObjectPort">4444</attribute>
+      <attribute name="ServerAddress">${jboss.bind.address}</attribute>
+      <!--
+      <attribute name="RMIClientSocketFactory">custom</attribute>
+      <attribute name="RMIServerSocketFactory">custom</attribute>
+      <attribute name="RMIServerSocketAddr">custom</attribute>
+      <attribute name="SecurityDomain">ssl-domain-name</attribute>
+      -->
+      <depends>jboss:service=TransactionManager</depends>
+   </mbean>
+
+   <mbean code="org.jboss.invocation.local.LocalInvoker"
+      name="jboss:service=invoker,type=local">
+
+      <depends>jboss:service=TransactionManager</depends>
+   </mbean>
+
+   <mbean code="org.jboss.invocation.pooled.server.PooledInvoker"
+      name="jboss:service=invoker,type=pooled">
+      <attribute name="NumAcceptThreads">1</attribute>
+      <attribute name="MaxPoolSize">300</attribute>
+      <attribute name="ClientMaxPoolSize">300</attribute>
+      <attribute name="SocketTimeout">60000</attribute>
+      <attribute name="ServerBindAddress">${jboss.bind.address}</attribute>
+      <attribute name="ServerBindPort">4445</attribute>
+      <attribute name="ClientConnectAddress">${jboss.bind.address}</attribute>
+      <attribute name="ClientConnectPort">0</attribute>
+      <attribute name="ClientRetryCount">1</attribute>
+      <attribute name="EnableTcpNoDelay">false</attribute>
+
+      <!-- Customized socket factory attributes
+      <attribute name="ClientSocketFactoryName">custom.client.factory</attribute>
+      <attribute name="ServerSocketFactoryName">custom.server.factory</attribute>
+      <attribute name="SslDomain">java:/jaas/pooledInvoker</attribute>
+      -->
+      <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
+   </mbean>
+
+   <!-- ==================================================================== -->
+   <!-- Remoting services 						                                   -->
+   <!-- ==================================================================== -->
+
+   <!-- For detailed description of all these configuration attributes, please see the -->
+   <!-- JBoss Remoting User's Guide or wiki (http://labs.jboss.com/portal/jbossremoting/docs/guide/index.html) -->
+
+    <!-- The NetworkRegistry contains all the local and remote -->
+    <!-- servers that it recognizes.  The remote ones registered -->
+    <!-- are dependant on the detectors running and which domains -->
+    <!-- they are configured to identify.                         -->
+    <mbean code="org.jboss.remoting.network.NetworkRegistry"
+           name="jboss.remoting:service=NetworkRegistry"/>
+
+   <!-- The Connector is the core component of the remoting server service. -->
+   <!-- It binds the remoting invoker (transport protocol, callback configuration, -->
+   <!-- data marshalling, etc.) with the invocation handlers.  -->
+   <mbean code="org.jboss.remoting.transport.Connector"
+          name="jboss.remoting:service=Connector,transport=socket"
+          display-name="Socket transport Connector">
+
+       <!-- Can either just specify the InvokerLocator attribute and not the invoker element in the -->
+       <!-- Configuration attribute, or do the full invoker configuration in the in invoker element -->
+       <!-- of the Configuration attribute. -->
+
+       <!-- Remember that if you do use more than one param on the uri, will have to include as a CDATA, -->
+       <!-- otherwise, parser will complain. -->
+       <!-- <attribute name="InvokerLocator"><![CDATA[socket://${jboss.bind.address}:4446/?datatype=invocation]]></attribute> -->
+
+      <attribute name="Configuration">
+         <!-- Using the following <invoker> element instead of the InvokerLocator above because specific attributes needed. -->
+         <!-- If wanted to use any of the parameters below, can just add them as parameters to the url above if wanted use the InvokerLocator attribute. -->
+         <config>
+            <!-- Other than transport type and handler, none of these configurations are required (will just use defaults). -->
+            <invoker transport="socket">
+               <attribute name="dataType" isParam="true">invocation</attribute>
+               <attribute name="marshaller" isParam="true">org.jboss.invocation.unified.marshall.InvocationMarshaller</attribute>
+               <attribute name="unmarshaller" isParam="true">org.jboss.invocation.unified.marshall.InvocationUnMarshaller</attribute>
+               <!-- This will be port on which the marshall loader port runs on.  -->
+               <!-- <attribute name="loaderport" isParam="true">4447</attribute> -->
+               <!-- The following are specific to socket invoker -->
+               <!-- <attribute name="numAcceptThreads">1</attribute>-->
+               <!-- <attribute name="maxPoolSize">303</attribute>-->
+               <!-- <attribute name="clientMaxPoolSize" isParam="true">304</attribute>-->
+               <attribute name="socketTimeout" isParam="true">600000</attribute>
+               <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
+               <attribute name="serverBindPort">4446</attribute>
+               <!-- <attribute name="clientConnectAddress">216.23.33.2</attribute> -->
+               <!-- <attribute name="clientConnectPort">7777</attribute> -->
+               <attribute name="enableTcpNoDelay" isParam="true">true</attribute>
+               <!-- <attribute name="backlog">200</attribute>-->
+               <!-- The following is for callback configuration and is independant of invoker type -->
+               <!-- <attribute name="callbackMemCeiling">30</attribute>-->
+               <!-- indicates callback store by fully qualified class name -->
+               <!-- <attribute name="callbackStore">org.jboss.remoting.CallbackStore</attribute>-->
+               <!-- indicates callback store by object name -->
+               <!-- <attribute name="callbackStore">jboss.remoting:service=CallbackStore,type=Serializable</attribute> -->
+               <!-- config params for callback store.  if were declaring callback store via object name, -->
+               <!-- could have specified these config params there. -->
+               <!-- StoreFilePath indicates to which directory to write the callback objects. -->
+               <!-- The default value is the property value of 'jboss.server.data.dir' and if this is not set, -->
+               <!-- then will be 'data'. Will then append 'remoting' and the callback client's session id. -->
+               <!-- An example would be 'data\remoting\5c4o05l-9jijyx-e5b6xyph-1-e5b6xyph-2'. -->
+               <!-- <attribute name="StoreFilePath">callback</attribute>-->
+               <!-- StoreFileSuffix indicates the file suffix to use for the callback objects written to disk. -->
+               <!-- The default value for file suffix is 'ser'. -->
+               <!-- <attribute name="StoreFileSuffix">cst</attribute>-->
+            </invoker>
+
+            <!-- At least one handler is required by the connector.  If have more than one, must decalre -->
+            <!-- different subsystem values.  Otherwise, all invocations will be routed to the only one -->
+            <!-- that is declared. -->
+            <handlers>
+               <!-- can also specify handler by fully qualified classname -->
+               <handler subsystem="invoker">jboss:service=invoker,type=unified</handler>
+            </handlers>
+         </config>
+      </attribute>
+      <depends>jboss.remoting:service=NetworkRegistry</depends>
+   </mbean>
+
+
+   <!-- <mbean code="org.jboss.remoting.detection.jndi.JNDIDetector"-->
+   <!--      name="jboss.remoting:service=Detector,transport=jndi">-->
+   <!-- host to which the detector will connect to for the JNDI server. -->
+   <!-- <attribute name="Host">localhost</attribute>-->
+   <!-- port to which detector will connect to for the JNDI server. -->
+   <!-- <attribute name="Port">5555</attribute>-->
+   <!-- context factory string used when connecting to the JNDI server. -->
+   <!-- The default is org.jnp.interfaces.NamingContextFactory. -->
+   <!-- <attribute name="ContextFactory">org.acme.NamingContextFactory</attribute> -->
+   <!-- url package string to use when connecting to the JNDI server. -->
+   <!-- The default is org.jboss.naming:org.jnp.interfaces. -->
+   <!-- <attribute name="URLPackage">org.acme.naming</attribute> -->
+   <!-- Sets the number of detection iterations before manually pinging -->
+   <!-- remote server to make sure still alive. This is needed since remote server -->
+   <!-- could crash and yet still have an entry in the JNDI server, -->
+   <!-- thus making it appear that it is still there. The default value is 5. -->
+   <!-- <attribute name="CleanDetectionNumber">20</attribute>-->
+
+   <!-- Specifies the domains in which the detector will recognize -->
+   <!-- detections.  If servers are not configured to be in these -->
+   <!-- domains, they will not be added to NetworkRegistry. -->
+   <!--      <attribute name="Configuration">-->
+   <!--         <domains>-->
+   <!--            <domain>roxanne</domain>-->
+   <!--            <domain>sparky</domain>-->
+   <!--         </domains>-->
+   <!--      </attribute>-->
+   <!--   </mbean>-->
+
+
+   <!-- ==================================================================== -->
+   <!-- Monitoring and Management                                            -->
+   <!-- ==================================================================== -->
+
+   <!-- Uncomment to enable JMX monitoring of the bean cache
+   <mbean code="org.jboss.monitor.BeanCacheMonitor"
+          name="jboss.monitor:name=BeanCacheMonitor"/>
+   -->
+
+   <!-- Uncomment to enable JMX monitoring of the entity bean locking
+   <mbean code="org.jboss.monitor.EntityLockMonitor"
+          name="jboss.monitor:name=EntityLockMonitor"/>
+   -->
+
+   <!-- ==================================================================== -->
+   <!-- An MBean that is a registry for JDBC type-mapping metadata           -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.ejb.plugins.cmp.jdbc.metadata.MetaDataLibrary"
+      name="jboss.jdbc:service=metadata"/>
+
+   <!-- ==================================================================== -->
+   <!-- Deployment Scanning                                                  -->
+   <!-- ==================================================================== -->
+
+   <!-- An mbean for hot deployment/undeployment of archives.
+   -->
+   <mbean code="org.jboss.deployment.scanner.URLDeploymentScanner"
+      name="jboss.deployment:type=DeploymentScanner,flavor=URL">
+
+      <!-- Uncomment (and comment/remove version below) to enable usage of the
+        DeploymentCache
+      <depends optional-attribute-name="Deployer">jboss.deployment:type=DeploymentCache</depends>
+      -->
+      <depends optional-attribute-name="Deployer">jboss.system:service=MainDeployer</depends>
+
+      <!-- The URLComparator can be used to specify a deployment ordering
+           for deployments found in a scanned directory.  The class specified
+           must be an implementation of java.util.Comparator, it must be able
+           to compare two URL objects, and it must have a no-arg constructor.
+           Two deployment comparators are shipped with JBoss:
+             - org.jboss.deployment.DeploymentSorter
+               Sorts by file extension, as follows:
+                 "sar", "service.xml", "rar", "jar", "war", "wsr", "ear", "zip",
+                 "*"
+             - org.jboss.deployment.scanner.PrefixDeploymentSorter
+               If the name portion of the url begins with 1 or more digits, those
+               digits are converted to an int (ignoring leading zeroes), and
+               files are deployed in that order.  Files that do not start with
+               any digits will be deployed first, and they will be sorted by
+               extension as above with DeploymentSorter.
+      -->
+      <attribute name="URLComparator">org.jboss.deployment.DeploymentSorter</attribute>
+
+      <!--
+      <attribute name="URLComparator">org.jboss.deployment.scanner.PrefixDeploymentSorter</attribute>
+      -->
+
+      <!-- The FilterInstance specifies a URLLister.URLFilter for scanned
+           directories. This DeploymentFilter is initialized with the given
+           prefixes, suffixes and matches that define which URLs should be
+           ignored.
+      -->
+      <attribute name="FilterInstance"
+         attributeClass="org.jboss.deployment.scanner.DeploymentFilter"
+         serialDataType="javaBean">
+         <!-- Files starting with theses strings are ignored -->
+         <property name="prefixes">#,%,\,,.,_$</property>
+         <!-- Files ending with theses strings are ignored -->
+         <property name="suffixes">#,$,%,~,\,v,.BAK,.bak,.old,.orig,.tmp,.rej,.sh</property>
+         <!-- Files matching with theses strings are ignored -->
+         <property name="matches">.make.state,.nse_depinfo,CVS,CVS.admin,RCS,RCSLOG,SCCS,TAGS,core,tags</property>
+      </attribute>
+
+      <!-- Frequency in milliseconds to rescan the URLs for changes -->
+      <attribute name="ScanPeriod">5000</attribute>
+
+      <!-- A flag to disable the scans -->
+      <attribute name="ScanEnabled">true</attribute>
+
+      <!-- URLs are comma separated and resolve relative to the server home URL
+         unless the given path is absolute. If the URL ends in "/" it is
+         considered a collection and scanned, otherwise it is simply deployed;
+         this follows RFC2518 convention and allows discrimination between
+         collections and directories that are simply unpacked archives.
+
+         URLs may be local (file:) or remote (http:). Scanning is supported
+         for remote URLs but unpacked deployment units are not.
+
+         Example URLs:
+            deploy/
+                 scans ${jboss.server.url}/deploy/, which is local or remote
+                 depending on the URL used to boot the server
+            ${jboss.server.home}/deploy/
+                 scans ${jboss.server.home)/deploy, which is always local
+            file:/var/opt/myapp.ear
+                 deploy myapp.ear from a local location
+            file:/var/opt/apps/
+                 scans the specified directory
+            http://www.test.com/netboot/myapp.ear
+                 deploys myapp.ear from a remote location
+            http://www.test.com/netboot/apps/
+                 scans the specified WebDAV location
+       -->
+      <attribute name="URLs">
+         deploy/
+      </attribute>
+
+      <!-- Indicates if the scanner should recursively scan directories that
+      contain no "." in their names. This can be used to group applications
+      and services that must be deployed and that have the same
+      logical function in the same directory i.e.
+        deploy/JMX/
+        deploy/JMS/
+        ...
+      -->
+      <attribute name="RecursiveSearch">True</attribute>
+
+   </mbean>
+
+</server>

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/server.properties
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/server.properties	2008-04-18 10:37:34 UTC (rev 19621)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/server.properties	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,5 +0,0 @@
-org.jboss.esb.twoservers.home=/Users/tcunning/src/esb/branch/product/build/jbossesb-server-4.2.1GA
-#org.jboss.esb.twoservers.home=/opt/jbossesb-server-4.2.1GA
-org.jboss.esb.twoservers.orig.config=default
-org.jboss.esb.twoservers.dest.first=first
-org.jboss.esb.twoservers.dest.second=second

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/server.properties (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/server.properties)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/two_servers/server.properties	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/server.properties	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,5 @@
+org.jboss.esb.twoservers.home=/Users/tcunning/src/esb/branch/product/build/jbossesb-server-4.2.1GA
+#org.jboss.esb.twoservers.home=/opt/jbossesb-server-4.2.1GA
+org.jboss.esb.twoservers.orig.config=default
+org.jboss.esb.twoservers.dest.first=first
+org.jboss.esb.twoservers.dest.second=second

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/src)

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/src/org)

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/src/org/jboss)

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/src/org/jboss/soa)

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb)

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples)

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart)

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers)

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/MyJMSListenerAction.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/MyJMSListenerAction.java	2008-04-18 10:37:34 UTC (rev 19621)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/MyJMSListenerAction.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, 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) 2005-2006,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstart.twoservers;
-
-import org.jboss.soa.esb.actions.AbstractActionLifecycle;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-public class MyJMSListenerAction extends AbstractActionLifecycle
-{
-    
-  protected ConfigTree	_config;
-	  
-  public MyJMSListenerAction(ConfigTree config) { _config = config; } 
-
-  
-  public Message displayMessage(Message message) throws Exception{
-		
-		  System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");		  		  
-		  System.out.println("Body: " + message.getBody().get()) ;
-		  System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
-		  return message; 
-        		
-	}
-    
-	
-}

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/MyJMSListenerAction.java (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/MyJMSListenerAction.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/MyJMSListenerAction.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/MyJMSListenerAction.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.twoservers;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class MyJMSListenerAction extends AbstractActionLifecycle
+{
+    
+  protected ConfigTree	_config;
+	  
+  public MyJMSListenerAction(ConfigTree config) { _config = config; } 
+
+  
+  public Message displayMessage(Message message) throws Exception{
+		
+		  System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");		  		  
+		  System.out.println("Body: " + message.getBody().get()) ;
+		  System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+		  return message; 
+        		
+	}
+    
+	
+}

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/StringAppender.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/StringAppender.java	2008-04-18 10:37:34 UTC (rev 19621)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/StringAppender.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, 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) 2005-2006,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstart.twoservers;
-
-import org.jboss.soa.esb.actions.AbstractActionLifecycle;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-public class StringAppender extends AbstractActionLifecycle
-{
-    
-  protected ConfigTree	_config;
-	  
-  public StringAppender(ConfigTree config) { _config = config; } 
-
-  
-  public Message process(Message message) throws Exception{
-	String appendString = (String) message.getBody().get();
-	appendString = "===== " + appendString + "=====";
-	message.getBody().add(appendString);		
-	return message; 
-  }
-}

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/StringAppender.java (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/StringAppender.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/StringAppender.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/StringAppender.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.twoservers;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class StringAppender extends AbstractActionLifecycle
+{
+    
+  protected ConfigTree	_config;
+	  
+  public StringAppender(ConfigTree config) { _config = config; } 
+
+  
+  public Message process(Message message) throws Exception{
+	String appendString = (String) message.getBody().get();
+	appendString = "===== " + appendString + "=====";
+	message.getBody().add(appendString);		
+	return message; 
+  }
+}

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test)

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/SendEsbMessage.java	2008-04-18 10:37:34 UTC (rev 19621)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/SendEsbMessage.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.soa.esb.samples.quickstart.twoservers.test;
-
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.client.ServiceInvoker;
-
-/**
- * Standalone class with to send ESB messages to a 'known' [category,name].
- * <p/> arg0 - service category
- * <br/>arg1 - service name
- * <br/>arg2 - Text of message to send
- * 
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @since Version 4.0
- *
- */
-public class SendEsbMessage 
-{
-    public static void main(String args[]) throws Exception
-    {
-//      Setting the ConnectionFactory such that it will use scout
-        System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
-        
-    	if (args.length < 3)
-    	{
-    		System.out.println("Usage SendEsbMessage <category> <name> <text to send>");
-    	}
-    	
-    	Message esbMessage = MessageFactory.getInstance().getMessage();
-
-    	esbMessage.getBody().add(args[2]);
-    	
-        new ServiceInvoker(args[0], args[1]).deliverAsync(esbMessage);
-    	
-    }
-    
-}

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/SendEsbMessage.java (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/SendEsbMessage.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/SendEsbMessage.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/SendEsbMessage.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.soa.esb.samples.quickstart.twoservers.test;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.client.ServiceInvoker;
+
+/**
+ * Standalone class with to send ESB messages to a 'known' [category,name].
+ * <p/> arg0 - service category
+ * <br/>arg1 - service name
+ * <br/>arg2 - Text of message to send
+ * 
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @since Version 4.0
+ *
+ */
+public class SendEsbMessage 
+{
+    public static void main(String args[]) throws Exception
+    {
+//      Setting the ConnectionFactory such that it will use scout
+        System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
+        
+    	if (args.length < 3)
+    	{
+    		System.out.println("Usage SendEsbMessage <category> <name> <text to send>");
+    	}
+    	
+    	Message esbMessage = MessageFactory.getInstance().getMessage();
+
+    	esbMessage.getBody().add(args[2]);
+    	
+        new ServiceInvoker(args[0], args[1]).deliverAsync(esbMessage);
+    	
+    }
+    
+}

Deleted: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/SendJMSMessage.java
===================================================================
--- labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/SendJMSMessage.java	2008-04-18 10:37:34 UTC (rev 19621)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/SendJMSMessage.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, 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) 2005-2006,
- * @author JBoss Inc.
- */
-package org.jboss.soa.esb.samples.quickstart.twoservers.test;
-
-import java.util.Properties;
-
-import javax.jms.JMSException;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-public class SendJMSMessage {
-    QueueConnection conn;
-    QueueSession session;
-    Queue que;
-    
-    
-    public void setupConnection() throws JMSException, NamingException
-    {
-        Properties properties1 = new Properties();
-		properties1.put(Context.INITIAL_CONTEXT_FACTORY,
-				"org.jnp.interfaces.NamingContextFactory");
-		properties1.put(Context.URL_PKG_PREFIXES,
-				"org.jboss.naming:org.jnp.interfaces");
-		properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1199");
-		InitialContext iniCtx = new InitialContext(properties1);
-
-    	Object tmp = iniCtx.lookup("ConnectionFactory");
-    	QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
-    	conn = qcf.createQueueConnection();
-    	que = (Queue) iniCtx.lookup("queue/quickstart_twoservers_Request_gw");
-    	session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
-    	conn.start();
-    	System.out.println("Connection Started");
-    }
-    
-    public void stop() throws JMSException 
-    { 
-        conn.stop();
-        session.close();
-        conn.close();
-    }
-    
-    public void sendAMessage(String msg) throws JMSException {
-    	
-        QueueSender send = session.createSender(que);        
-        ObjectMessage tm = session.createObjectMessage(msg);
-        
-        send.send(tm);        
-        send.close();
-    }
-       
-    
-    public static void main(String args[]) throws Exception
-    {        	    	
-    	SendJMSMessage sm = new SendJMSMessage();
-    	sm.setupConnection();
-    	sm.sendAMessage(args[0]); 
-    	sm.stop();
-    	
-    }
-    
-}

Copied: labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/SendJMSMessage.java (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/SendJMSMessage.java)
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/SendJMSMessage.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/samples/quickstarts/two_servers/src/org/jboss/soa/esb/samples/quickstart/twoservers/test/SendJMSMessage.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.twoservers.test;
+
+import java.util.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+public class SendJMSMessage {
+    QueueConnection conn;
+    QueueSession session;
+    Queue que;
+    
+    
+    public void setupConnection() throws JMSException, NamingException
+    {
+        Properties properties1 = new Properties();
+		properties1.put(Context.INITIAL_CONTEXT_FACTORY,
+				"org.jnp.interfaces.NamingContextFactory");
+		properties1.put(Context.URL_PKG_PREFIXES,
+				"org.jboss.naming:org.jnp.interfaces");
+		properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1199");
+		InitialContext iniCtx = new InitialContext(properties1);
+
+    	Object tmp = iniCtx.lookup("ConnectionFactory");
+    	QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+    	conn = qcf.createQueueConnection();
+    	que = (Queue) iniCtx.lookup("queue/quickstart_twoservers_Request_gw");
+    	session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+    	conn.start();
+    	System.out.println("Connection Started");
+    }
+    
+    public void stop() throws JMSException 
+    { 
+        conn.stop();
+        session.close();
+        conn.close();
+    }
+    
+    public void sendAMessage(String msg) throws JMSException {
+    	
+        QueueSender send = session.createSender(que);        
+        ObjectMessage tm = session.createObjectMessage(msg);
+        
+        send.send(tm);        
+        send.close();
+    }
+       
+    
+    public static void main(String args[]) throws Exception
+    {        	    	
+    	SendJMSMessage sm = new SendJMSMessage();
+    	sm.setupConnection();
+    	sm.sendAMessage(args[0]); 
+    	sm.stop();
+    	
+    }
+    
+}

Modified: labs/jbossesb/trunk/product/services/jbossesb/src/main/java/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStoreImpl.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbossesb/src/main/java/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStoreImpl.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/services/jbossesb/src/main/java/org/jboss/internal/soa/esb/persistence/format/db/DBMessageStoreImpl.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -365,13 +365,23 @@
         boolean error=false;
 
         Connection con = null;
+        
         try
         {
             con = mgr.getConnection();
             con.setAutoCommit(false);
             con.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
-            
-            
+        }
+        catch (final SQLException e)
+        {
+            if (logger.isDebugEnabled()) {
+        	logger.debug("Deadlocks may occur under normal processing.");
+        	logger.debug(e.getMessage(), e);
+            }
+        } 
+           
+        try
+        {
             Message message=select(uuid, con);
             
             if (message!=null && delete(uuid, RedeliverStore.CLASSIFICATION_RDLVR, con)==1) {
@@ -411,12 +421,10 @@
                 }
             }
         }
-        catch (SQLException e)
+        catch (final SQLException e)
         {
-            if (logger.isDebugEnabled()) {
-                logger.debug("Deadlocks may occur under normal processing");
-                logger.debug(e.getMessage(), e);
-            }
+            logger.warn("DBMessageStoreImpl caught exception "+e+". Will force transaction to rollback.");
+            
             error=true;
         } 
         finally

Modified: labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouter.java
===================================================================
--- labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouter.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/services/jbrules/src/main/java/org/jboss/internal/soa/esb/services/routing/cbr/JBossRulesRouter.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -217,7 +217,7 @@
 	{
 		// read in the rules
 		logger.debug("Going to read the rule: " + rulesFile);
-		InputStream inputStreamDrl = ClassUtil.getResourceAsStream("/" + rulesFile, JBossRulesRouter.class);
+		InputStream inputStreamDrl = ClassUtil.getResourceAsStream(rulesFile.charAt(0) == '/' ? rulesFile : "/" + rulesFile, JBossRulesRouter.class);
 		if (inputStreamDrl == null)
 		{
 			logger.error("Could not find rulesFile: " + rulesFile);
@@ -239,7 +239,7 @@
                         else
                         {
                                 logger.debug("Going to read the language: " + ruleLanguage);
-                                InputStream inputStreamDsl = ClassUtil.getResourceAsStream("/" + ruleLanguage, JBossRulesRouter.class);
+                                InputStream inputStreamDsl = ClassUtil.getResourceAsStream(ruleLanguage.charAt(0) == '/' ? ruleLanguage : "/" + ruleLanguage, JBossRulesRouter.class);
                                 if (inputStreamDsl == null)
                                 {
                                         logger.error("Could not find ruleLanguage: " + rulesFile);
@@ -284,7 +284,7 @@
 			throws IOException
 	{
 		logger.debug("Going to hash the rule: " + rulesFile);
-		InputStream inputStreamDrl = ClassUtil.getResourceAsStream("/" + rulesFile, JBossRulesRouter.class);
+		InputStream inputStreamDrl = ClassUtil.getResourceAsStream(rulesFile.charAt(0) == '/' ? rulesFile : "/" + rulesFile, JBossRulesRouter.class);
 		if (inputStreamDrl == null)
 		{
 			logger.error("Could not find rulesFile: " + rulesFile);
@@ -305,7 +305,7 @@
                     if (ruleLanguage != null)
                     {
                             logger.debug("Going to hash the language: " + ruleLanguage);
-                            InputStream inputStreamDsl = ClassUtil.getResourceAsStream("/" + ruleLanguage, JBossRulesRouter.class);
+                            InputStream inputStreamDsl = ClassUtil.getResourceAsStream(ruleLanguage.charAt(0) == '/' ? ruleLanguage : "/" + ruleLanguage, JBossRulesRouter.class);
                             if (inputStreamDsl == null)
                             {
                                     logger.error("Could not find language: " + ruleLanguage);

Modified: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPClient.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -97,7 +97,7 @@
  *          <a href="http://www.ognl.org/">OGNL</a></li> framework.  More on the use of OGNL below.
  *      <li><b>Option 2</b>: With a set of String based key-value pairs(&lt;String, Object&gt;), where the
  *          key is an OGNL expression identifying the SOAP parameter to be populated with
- *          the key's value.  More on the use of OGNL below.
+ *          the key's value. More on the use of OGNL below.
  *      </li>
  * </ol>
  * As stated above, <a href="http://www.ognl.org/">OGNL</a> is the mechanism we use for selecting
@@ -189,7 +189,9 @@
  *          <a href="http://xstream.codehaus.org">XStream</a> toolkit.
  *      <li><b>Option 2</b>: As a set of String based key-value pairs(&lt;String, String&gt;), where the
  *          key is an OGNL expression identifying the SOAP response element and the value is a String
- *          representing the value from the SOAP message.
+ *          representing the value from the SOAP message.   This option should only be used for simple
+ *          responses.  If your response contains collections etc, this option is not viable.  You need
+ *          to use option 1.
  *      </li>
  *      <li><b>Option 3</b>: If Options 1 or 2 are not specified in the action configuration, the raw SOAP
  *          response message (String) is attached to the message.

Modified: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPProcessor.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPProcessor.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/SOAPProcessor.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -77,14 +77,21 @@
  * </div>
  *
  * <h3>Action Configuration</h3>
- * The &lt;action ... /&gt; configuration for this action is very straightforward.  The action just takes one
- * property value, which is the name of the JBossWS endpoint it's exposing (invoking).
+ * The &lt;action ... /&gt; configuration for this action is very straightforward.  The action requires only one
+ * mandatory property value, which is the "jbossws-endpoint" property.  This property names the JBossWS endpoint
+ * that the SOAPProcessor is exposing (invoking).
  *
  * <pre>
  * &lt;action name="ShippingProcessor" class="org.jboss.soa.esb.actions.soap.SOAPProcessor"&gt;
  *     &lt;property name="<b>jbossws-endpoint</b>" value="<b>ABI_Shipping</b>"/&gt;
+ *     &lt;property name="<b>rewrite-endpoint-url</b>" value="true/false"/&gt; &lt;-- Optional. Default "true". --&gt;
  * &lt;/action&gt;
  * </pre>
+ *
+ * The optional "rewrite-endpoint-url" property is there to support load balancing on HTTP endpoints,
+ * in which case the Webservice endpoint container will have been configured to set the HTTP(S) endpoint address
+ * in the WSDL to that of the Load Balancer.  The "rewrite-endpoint-url" property can be used to turn off HTTP endpoint
+ * address rewriting in situations such as this.  It has no effect for non-HTTP protocols.
  * 
  * <h3>Quickstarts</h3>
  * A number of quickstarts that demonstrate how to use this action are available in the JBossESB
@@ -97,6 +104,7 @@
 public class SOAPProcessor extends AbstractActionPipelineProcessor {
 
     public static final String JBOSSWS_ENDPOINT = "jbossws-endpoint";
+    public static final String REWRITE_ENDPOINT_URL = "rewrite-endpoint-url";
 
     private static ThreadLocal<Message> messageTL = new ThreadLocal<Message>();
     private String jbossws_endpoint;

Modified: labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WebserviceContractPublisher.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WebserviceContractPublisher.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/services/soap/src/main/java/org/jboss/soa/esb/actions/soap/WebserviceContractPublisher.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -54,6 +54,7 @@
 
     private static Logger logger = Logger.getLogger(WebserviceContractPublisher.class);    
     private String endpointName;
+    private boolean rewriteEndpointUrl = true;
     private Smooks transformer;
 
     /**
@@ -67,8 +68,10 @@
         for(PropertyDocument.Property property : properties) {
             if(property.getName().equals(SOAPProcessor.JBOSSWS_ENDPOINT)) {
                 endpointName = property.getValue();
-                break;
             }
+            if(property.getName().equals(SOAPProcessor.REWRITE_ENDPOINT_URL)) {
+                rewriteEndpointUrl = !property.getValue().equals("false");
+            }
         }
 
         if(endpointName == null) {
@@ -149,10 +152,15 @@
      * @param wsdl WSDL input.
      * @param epr The SOAP endpoint from the ESB perspective.
      * @param targetServiceCat
-     *@param targetServiceName
+     * @param targetServiceName
      * @param targetProtocol @return The updated WSDL.
      */
     protected String updateWsdl(String wsdl, EPR epr, String targetServiceCat, String targetServiceName, String targetProtocol) throws SAXException, IOException, ConfigurationException {
+        if(!rewriteEndpointUrl && targetProtocol.startsWith("http")) {
+            // return the wsdl unchanged...
+            return wsdl;
+        }
+
         URI endpointURI = URI.create(epr.getAddr().getAddress());
         StringWriter writer = new StringWriter();
         ExecutionContext execContext = transformer.createExecutionContext();

Modified: labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/JBossWSAdapterContractPublisherUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/JBossWSAdapterContractPublisherUnitTest.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/JBossWSAdapterContractPublisherUnitTest.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -19,18 +19,19 @@
  */
 package org.jboss.soa.esb.actions.soap;
 
-import java.io.IOException;
-import java.net.URI;
-
 import junit.framework.TestCase;
-
 import org.apache.log4j.Logger;
 import org.jboss.internal.soa.esb.util.StreamUtils;
 import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.ActionDocument;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.PropertyDocument;
 import org.jboss.soa.esb.testutils.StringUtils;
-import org.jboss.soa.esb.addressing.EPR;
 import org.xml.sax.SAXException;
 
+import java.io.IOException;
+import java.net.URI;
+
 /**
  * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
  */
@@ -48,4 +49,50 @@
         log.debug(wsdlOut);
         assertTrue("WSDL Update failed.  \n\n*** Expected:\n\n" + wsdlOutExpected + "\n\n*** Got:\n\n" + wsdlOut, StringUtils.equalsIgnoreLinebreaks(wsdlOutExpected, wsdlOut, false));
     }
+
+    public void test_http_rewrite() throws ConfigurationException, IOException, SAXException {
+        WebserviceContractPublisher publisher = new WebserviceContractPublisher();
+        String wsdlIn = new String(StreamUtils.readStream(getClass().getResourceAsStream("test-in.wsdl")));
+        String wsdlOutExpected = new String(StreamUtils.readStream(getClass().getResourceAsStream("test-out-expected-http-rewrite.wsdl")));
+        EPR epr = new EPR(URI.create("http://x.y.x:8989/"));
+
+        publisher.setActionConfig(buildActionConfig(true));
+
+        publisher.initializeTransform();
+        String wsdlOut = publisher.updateWsdl(wsdlIn, epr, "myServiceCat", "myServiceName", "http");
+        log.debug(wsdlOut);
+        assertTrue("WSDL Update failed.  \n\n*** Expected:\n\n" + wsdlOutExpected + "\n\n*** Got:\n\n" + wsdlOut, StringUtils.equalsIgnoreLinebreaks(wsdlOutExpected, wsdlOut, false));
+    }
+
+    public void test_http_norewrite() throws ConfigurationException, IOException, SAXException {
+        WebserviceContractPublisher publisher = new WebserviceContractPublisher();
+        String wsdlIn = new String(StreamUtils.readStream(getClass().getResourceAsStream("test-in.wsdl")));
+        String wsdlOutExpected = new String(StreamUtils.readStream(getClass().getResourceAsStream("test-in.wsdl"))); // expected same as input wsdl
+        EPR epr = new EPR(URI.create("http://x.y.x:8989/"));
+
+        publisher.setActionConfig(buildActionConfig(false));
+        
+        publisher.initializeTransform();
+        String wsdlOut = publisher.updateWsdl(wsdlIn, epr, "myServiceCat", "myServiceName", "http");
+        log.debug(wsdlOut);
+        assertTrue("WSDL Update failed.  \n\n*** Expected:\n\n" + wsdlOutExpected + "\n\n*** Got:\n\n" + wsdlOut, StringUtils.equalsIgnoreLinebreaks(wsdlOutExpected, wsdlOut, false));
+    }
+
+    private ActionDocument.Action buildActionConfig(boolean rewriteUrls) {
+        ActionDocument.Action action = ActionDocument.Action.Factory.newInstance();
+        PropertyDocument.Property[] properties = new PropertyDocument.Property[2];
+
+        properties[0] = newConfigProperty(SOAPProcessor.JBOSSWS_ENDPOINT, "BlahEndpoint");
+        properties[1] = newConfigProperty(SOAPProcessor.REWRITE_ENDPOINT_URL, Boolean.toString(rewriteUrls));
+        action.setPropertyArray(properties);
+
+        return action;
+    }
+
+    private PropertyDocument.Property newConfigProperty(String name, String value) {
+        PropertyDocument.Property property = PropertyDocument.Property.Factory.newInstance();
+        property.setName(name);
+        property.setValue(value);
+        return property;
+    }
 }

Copied: labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/test-out-expected-http-rewrite.wsdl (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/test-out-expected-http-rewrite.wsdl)
===================================================================
--- labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/test-out-expected-http-rewrite.wsdl	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/soap/src/test/java/org/jboss/soa/esb/actions/soap/test-out-expected-http-rewrite.wsdl	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,55 @@
+<definitions name="GoodbyeWorldWSService" targetNamespace="http://webservice_war1/goodbyeworld" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://webservice_war1/goodbyeworld" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+    <import location="http://127.0.0.1:8080/contract/contract.jsp?wsdl&amp;resource=MTOMEndpoint_PortType61314.wsdl&amp;serviceCat=myServiceCat&amp;serviceName=myServiceName&amp;protocol=http" namespace="http://org.jboss.ws/xop/doclit"/>
+    <types/>
+    <message name="GoodbyeWorldWS_sayGoodbyeWithoutResponse">
+        <part name="String_1" type="xsd:string"/>
+
+    </message>
+    <message name="GoodbyeWorldWS_sayGoodbye">
+        <part name="String_1" type="xsd:string"/>
+    </message>
+    <message name="GoodbyeWorldWS_sayGoodbyeWithoutResponseResponse"/>
+    <message name="GoodbyeWorldWS_sayGoodbyeResponse">
+        <part name="result" type="xsd:string"/>
+    </message>
+    <portType name="GoodbyeWorldWS">
+
+        <operation name="sayGoodbye" parameterOrder="String_1">
+            <input message="tns:GoodbyeWorldWS_sayGoodbye"/>
+            <output message="tns:GoodbyeWorldWS_sayGoodbyeResponse"/>
+        </operation>
+        <operation name="sayGoodbyeWithoutResponse" parameterOrder="String_1">
+            <input message="tns:GoodbyeWorldWS_sayGoodbyeWithoutResponse"/>
+            <output message="tns:GoodbyeWorldWS_sayGoodbyeWithoutResponseResponse"/>
+        </operation>
+    </portType>
+
+    <binding name="GoodbyeWorldWSBinding" type="tns:GoodbyeWorldWS">
+        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <operation name="sayGoodbye">
+            <soap:operation soapAction=""/>
+            <input>
+                <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
+            </input>
+            <output>
+                <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
+
+            </output>
+        </operation>
+        <operation name="sayGoodbyeWithoutResponse">
+            <soap:operation soapAction=""/>
+            <input>
+                <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
+            </input>
+            <output>
+                <soap:body namespace="http://webservice_war1/goodbyeworld" use="literal"/>
+
+            </output>
+        </operation>
+    </binding>
+    <service name="GoodbyeWorldWSService">
+        <port binding="tns:GoodbyeWorldWSBinding" name="GoodbyeWorldWSPort">
+            <soap:address location="http://x.y.x:8989/"/>
+        </port>
+    </service>
+</definitions>

Modified: labs/jbossesb/trunk/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java
===================================================================
--- labs/jbossesb/trunk/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/services/soapui-client/src/main/java/org/jboss/soa/esb/services/soapui/SoapUIClientService.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -64,6 +64,7 @@
     private DocumentBuilderFactory docBuilderFactory ;
     private Map<String, Smooks> smooksCache;
     private ESBProperties properties;
+    private static final String CLONED_POSTFIX = " - cloned";
 
     /**
      * Public default constructor.
@@ -211,7 +212,17 @@
 
                 collectionSize = calculateCollectionSize(ognl, params);
 
-                if(collectionSize < 1) {
+                if(collectionSize == -1) {
+                    // It's a collection, but has no entries that match the OGNL expression for this element...
+                    if(clonePoint == element) {
+                        // If the clonePoint is the element itself, we remove it... we're done with it...
+                        clonePoint.getParentNode().removeChild(clonePoint);
+                    } else {
+                        // If the clonePoint is not the element itself (it's a child element), leave it
+                        // and check it again when we get to it...
+                        resetClonePoint(clonePoint);
+                    }
+                } else if(collectionSize == 0) {
                     // It's a collection, but has no entries, remove it...
                     clonePoint.getParentNode().removeChild(clonePoint);
                 } else if(collectionSize == 1) {
@@ -273,6 +284,7 @@
             return maxIndex + 1;
         }
 
+        // It's a collection, but nothing in this message for it collection...
         return -1;
     }
 
@@ -282,7 +294,7 @@
         // Is it this element...
         comment = getCommentBefore(element);
         if(comment != null && comment.getTextContent().endsWith(SOAPUI_CLONE_COMMENT)) {
-            comment.setTextContent(comment.getTextContent() + " - cloned");
+            comment.setTextContent(comment.getTextContent() + CLONED_POSTFIX);
             return element;
         }
 
@@ -291,7 +303,7 @@
         if(firstChildElement != null) {
             comment = getCommentBefore(firstChildElement);
             if(comment != null && comment.getTextContent().endsWith(SOAPUI_CLONE_COMMENT)) {
-                comment.setTextContent(comment.getTextContent() + " - cloned");
+                comment.setTextContent(comment.getTextContent() + CLONED_POSTFIX);
                 return firstChildElement;
             }
         }
@@ -299,6 +311,21 @@
         return null;
     }
 
+    private void resetClonePoint(Element clonePoint) {
+        Comment comment = getCommentBefore(clonePoint);
+
+        if(comment == null) {
+            throw new IllegalStateException("Call to reset a 'clonePoint' that doesn't have a comment before it.");
+        }
+
+        String commentText = comment.getTextContent();
+        if(!commentText.endsWith(CLONED_POSTFIX)) {
+            throw new IllegalStateException("Call to reset a 'clonePoint' that doesn't have a proper clone comment before it.");
+        }
+
+        comment.setTextContent(commentText.substring(0, commentText.length() - CLONED_POSTFIX.length()));
+    }
+
     private Comment getCommentBefore(Element element) {
         Node sibling = element.getPreviousSibling();
 

Modified: labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/SoapUIClientServiceMBeanUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/SoapUIClientServiceMBeanUnitTest.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/SoapUIClientServiceMBeanUnitTest.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -151,6 +151,45 @@
         assertTrue("Generated SOAP message not as expected. See orderprocessing/expected_01.xml.  Generated message: \n" + message, compareCharStreams(getClass().getResourceAsStream("orderprocessing/expected_01.xml"), new ByteArrayInputStream(message.getBytes())));
     }
 
+    public void test_has_collections_02_JBESB_1329() throws IOException, SAXException, ConfigurationException {
+        File wsdlFile = new File(WSDL_LOCATAION + "/orderprocessing/OrderProcessing_JBESB-1329.wsdl");
+        SoapUIClientService mbean = new SoapUIClientService();
+        Map params = new HashMap();
+        ArrayList<LineItem> lineItems = new ArrayList<LineItem>();
+
+        properties.setProperty(HttpClientFactory.TARGET_HOST_URL, wsdlFile.toURI().toString());
+
+        Order order = new Order();
+        ProcessOrderRequest request = new ProcessOrderRequest(order);
+        order.setId(123L);
+        order.setShipTo("Skeagh Bridge");
+        order.setLineItems(lineItems);
+
+        LineItem lineItem;
+
+        lineItem = new LineItem();
+        lineItems.add(lineItem);
+        lineItem.setId(456L);
+        lineItem.setName("item1");
+        lineItem.setPrice(10.99f);
+
+        lineItem = new LineItem();
+        lineItems.add(lineItem);
+        lineItem.setId(890L);
+        lineItem.setName("item2");
+        lineItem.setPrice(12.11f);
+
+        lineItem = new LineItem();
+        lineItems.add(lineItem);
+        lineItem.setId(321L);
+        lineItem.setName("item3");
+        lineItem.setPrice(76.34f);
+
+        params.put("processOrder", request);
+        String message = mbean.buildRequest(wsdlFile.toURI().toString(), "processOrder", params, properties, null, null);
+        assertTrue("Generated SOAP message not as expected. See orderprocessing/expected_01_JBESB-1329.xml.  Generated message: \n" + message, compareCharStreams(getClass().getResourceAsStream("orderprocessing/expected_01_JBESB-1329.xml"), new ByteArrayInputStream(message.getBytes())));
+    }
+
     public void test_has_collections_03() throws IOException, SAXException, ConfigurationException {
         File wsdlFile = new File(WSDL_LOCATAION + "/orderprocessing/OrderProcessing.wsdl");
         SoapUIClientService mbean = new SoapUIClientService();
@@ -172,6 +211,27 @@
         assertTrue("Generated SOAP message not as expected. See orderprocessing/expected_02.xml.  Generated message: \n" + message, compareCharStreams(getClass().getResourceAsStream("orderprocessing/expected_02.xml"), new ByteArrayInputStream(message.getBytes())));
     }
 
+    public void test_has_collections_03_JBESB_1329() throws IOException, SAXException, ConfigurationException {
+        File wsdlFile = new File(WSDL_LOCATAION + "/orderprocessing/OrderProcessing_JBESB-1329.wsdl");
+        SoapUIClientService mbean = new SoapUIClientService();
+        Map params = new HashMap();
+        ArrayList<LineItem> lineItems = new ArrayList<LineItem>();
+
+        properties.setProperty(HttpClientFactory.TARGET_HOST_URL, wsdlFile.toURI().toString());
+
+        Order order = new Order();
+        ProcessOrderRequest request = new ProcessOrderRequest(order);
+        order.setId(123L);
+        order.setShipTo("Skeagh Bridge");
+        order.setLineItems(lineItems);
+
+        // No line Items....
+
+        params.put("processOrder", request);
+        String message = mbean.buildRequest(wsdlFile.toURI().toString(), "processOrder", params, properties, null, null);
+        assertTrue("Generated SOAP message not as expected. See orderprocessing/expected_02_JBESB-1329.xml.  Generated message: \n" + message, compareCharStreams(getClass().getResourceAsStream("orderprocessing/expected_02_JBESB-1329.xml"), new ByteArrayInputStream(message.getBytes())));
+    }
+
     public void test_has_collections_04() throws IOException, SAXException, ConfigurationException {
         File wsdlFile = new File(WSDL_LOCATAION + "/orderprocessing/OrderProcessing.wsdl");
         SoapUIClientService mbean = new SoapUIClientService();
@@ -196,6 +256,30 @@
         assertTrue("Generated SOAP message not as expected. See orderprocessing/expected_01.xml.  Generated message: \n" + message, compareCharStreams(getClass().getResourceAsStream("orderprocessing/expected_01.xml"), new ByteArrayInputStream(message.getBytes())));
     }
 
+    public void test_has_collections_04_JBESB_1329() throws IOException, SAXException, ConfigurationException {
+        File wsdlFile = new File(WSDL_LOCATAION + "/orderprocessing/OrderProcessing_JBESB-1329.wsdl");
+        SoapUIClientService mbean = new SoapUIClientService();
+        Map params = new HashMap();
+
+        properties.setProperty(HttpClientFactory.TARGET_HOST_URL, wsdlFile.toURI().toString());
+
+        params.put("processOrder.order.id", 123L);
+        params.put("processOrder.order.shipTo", "Skeagh Bridge");
+
+        params.put("processOrder.order.lineItems[0].id", 456L);
+        params.put("processOrder.order.lineItems[0].name", "item1");
+        params.put("processOrder.order.lineItems[0].price", 10.99f);
+        params.put("processOrder.order.lineItems[1].id", 890L);
+        params.put("processOrder.order.lineItems[1].name", "item2");
+        params.put("processOrder.order.lineItems[1].price", 12.11f);
+        params.put("processOrder.order.lineItems[2].id", 321L);
+        params.put("processOrder.order.lineItems[2].name", "item3");
+        params.put("processOrder.order.lineItems[2].price", 76.34f);
+
+        String message = mbean.buildRequest(wsdlFile.toURI().toString(), "processOrder", params, properties, null, null);
+        assertTrue("Generated SOAP message not as expected. See orderprocessing/expected_01_JBESB-1329.xml.  Generated message: \n" + message, compareCharStreams(getClass().getResourceAsStream("orderprocessing/expected_01_JBESB-1329.xml"), new ByteArrayInputStream(message.getBytes())));
+    }
+
     public void test_has_collections_05() throws IOException, SAXException, ConfigurationException {
         File wsdlFile = new File(WSDL_LOCATAION + "/orderprocessing/OrderProcessing.wsdl");
         SoapUIClientService mbean = new SoapUIClientService();

Copied: labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/OrderProcessingSchema_JBESB-1329.xsd (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/OrderProcessingSchema_JBESB-1329.xsd)
===================================================================
--- labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/OrderProcessingSchema_JBESB-1329.xsd	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/OrderProcessingSchema_JBESB-1329.xsd	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema version="1.0" targetNamespace="http://endpoint/" xmlns:tns="http://endpoint/"
+           xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+    <xs:element name="processOrder" type="tns:processOrder"/>
+
+    <xs:element name="processOrderResponse" type="tns:processOrderResponse"/>
+
+    <xs:complexType name="processOrder">
+        <xs:sequence>
+            <xs:element name="order" type="tns:order" minOccurs="0"/>
+        </xs:sequence>
+
+    </xs:complexType>
+
+    <xs:complexType name="order">
+        <xs:sequence>
+            <xs:element name="lineItems" type="tns:lineItem" nillable="true" maxOccurs="unbounded" minOccurs="0"/>
+            <xs:element name="id" type="xs:long" minOccurs="0"/>
+            <xs:element name="shipTo" type="xs:string" minOccurs="0"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="lineItem">
+        <xs:sequence>
+            <xs:element name="id" type="xs:long" minOccurs="0"/>
+            <xs:element name="name" type="xs:string" minOccurs="0"/>
+            <xs:element name="price" type="xs:float" minOccurs="0"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="processOrderResponse">
+
+        <xs:sequence>
+            <xs:element name="return" type="tns:orderStatus" minOccurs="0"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="orderStatus">
+        <xs:sequence>
+            <xs:element name="comment" type="xs:string" minOccurs="0"/>
+            <xs:element name="id" type="xs:long" minOccurs="0"/>
+
+            <xs:element name="returnCode" type="xs:int"/>
+        </xs:sequence>
+    </xs:complexType>
+</xs:schema>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/OrderProcessing_JBESB-1329.wsdl (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/OrderProcessing_JBESB-1329.wsdl)
===================================================================
--- labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/OrderProcessing_JBESB-1329.wsdl	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/OrderProcessing_JBESB-1329.wsdl	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://endpoint/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://endpoint/" name="OrderProcessingService">
+  <types>
+    <xsd:schema>
+      <xsd:import namespace="http://endpoint/" schemaLocation="OrderProcessingSchema_JBESB-1329.xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"/>
+    </xsd:schema>
+  </types>
+  <message name="processOrder">
+    <part name="parameters" element="tns:processOrder"/>
+  </message>
+
+  <message name="processOrderResponse">
+    <part name="parameters" element="tns:processOrderResponse"/>
+  </message>
+  <portType name="OrderProcessing">
+    <operation name="processOrder">
+      <input message="tns:processOrder"/>
+      <output message="tns:processOrderResponse"/>
+    </operation>
+  </portType>
+
+  <binding name="OrderProcessingPortBinding" type="tns:OrderProcessing">
+    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+    <operation name="processOrder">
+      <soap:operation soapAction=""/>
+      <input>
+        <soap:body use="literal"/>
+      </input>
+      <output>
+        <soap:body use="literal"/>
+
+      </output>
+    </operation>
+  </binding>
+  <service name="OrderProcessingService">
+    <port name="OrderProcessingPort" binding="tns:OrderProcessingPortBinding">
+      <soap:address location="http://tfennelly:8080/order-processing/OrderProcessingService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"/>
+    </port>
+  </service>
+</definitions>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/expected_01_JBESB-1329.xml (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/expected_01_JBESB-1329.xml)
===================================================================
--- labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/expected_01_JBESB-1329.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/expected_01_JBESB-1329.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,37 @@
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:end="http://endpoint/">
+   <soapenv:Header/>
+   <soapenv:Body>
+      <end:processOrder>
+         <!--Optional:-->
+         <order>
+            <!--Zero or more repetitions: - cloned-->
+            <lineItems>
+               <!--Optional:-->
+               <id>456</id>
+               <!--Optional:-->
+               <name>item1</name>
+               <!--Optional:-->
+               <price>10.99</price>
+            </lineItems>
+            <!--Optional:-->
+            <lineItems>
+               <!--Optional:-->
+               <id>890</id>
+               <!--Optional:-->
+               <name>item2</name>
+               <!--Optional:-->
+               <price>12.11</price>
+            </lineItems><lineItems>
+               <!--Optional:-->
+               <id>321</id>
+               <!--Optional:-->
+               <name>item3</name>
+               <!--Optional:-->
+               <price>76.34</price>
+            </lineItems><id>123</id>
+            <!--Optional:-->
+            <shipTo>Skeagh Bridge</shipTo>
+         </order>
+      </end:processOrder>
+   </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/expected_02_JBESB-1329.xml (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/expected_02_JBESB-1329.xml)
===================================================================
--- labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/expected_02_JBESB-1329.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/services/soapui-client/src/test/java/org/jboss/soa/esb/services/soapui/orderprocessing/expected_02_JBESB-1329.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,16 @@
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:end="http://endpoint/">
+   <soapenv:Header/>
+   <soapenv:Body>
+      <end:processOrder>
+         <!--Optional:-->
+         <order>
+            <!--Zero or more repetitions: - cloned-->
+
+            <!--Optional:-->
+            <id>123</id>
+            <!--Optional:-->
+            <shipTo>Skeagh Bridge</shipTo>
+         </order>
+      </end:processOrder>
+   </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file

Modified: labs/jbossesb/trunk/product/tools/console/management/build.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/build.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/product/tools/console/management/build.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -21,6 +21,10 @@
 			value="${esb.root.dir}/server/default/deploy/jbossesb.sar/lib">
 			<available type="dir" file="${esb.root.dir}/server/default/deploy/jbossesb.sar/lib"/>
 		</condition>	
+		<condition property="esb.lib.dir"
+                         value="${esb.root.dir}/server/all/deploy/jbossesb.sar/lib">
+                         <available type="dir" file="${esb.root.dir}/server/all/deploy/jbossesb.sar/lib"/>
+                </condition>
 		<condition property="server.lib.dir"
 			value="../../../server/default/lib">
                         <available type="dir" file="../../../server/default/lib"

Copied: labs/jbossesb/trunk/qa/base-cp.xml (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/qa/base-cp.xml)
===================================================================
--- labs/jbossesb/trunk/qa/base-cp.xml	                        (rev 0)
+++ labs/jbossesb/trunk/qa/base-cp.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,65 @@
+<project name="base-cp">
+	<!--
+	  This file extracts the common classpath configuration from the junit/quickstarts directories.
+	  There are other sections of those build.xml files than can be consolidated in future.
+	-->
+	
+	<!--
+	  When updating this file please bear in mind the following
+	  - make sure jbossall-client.jar is last.
+	  - make sure jaxr-api-1.0rc1.jar precedes jboss-j2ee.jar.
+	  - Restrict jar files to those known to be required.
+	-->
+	<property name="org.jboss.esb.server.server"
+		location="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}" />
+	<dirname property="pwd" file="${ant.file.base-cp}" />
+	<path id="base.cp">
+		<pathelement location="${product.dir}/lib/ext/jaxr-api-1.0rc1.jar" />
+		<fileset dir="${org.jboss.esb.server.server}/lib" includes="jboss-remoting.jar jboss-j2ee.jar" /> <!-- Required for JMS Client Code. -->
+		<fileset dir="${org.jboss.esb.server.home}/client" includes="jboss-messaging-client.jar" /> <!-- Required for JMS Client Code. -->
+		<fileset dir="${org.jboss.esb.server.server}/lib"
+			includes="hibernate3.jar commons-collections.jar hsqldb.jar" /> <!-- Required for jbpm Client Code. -->
+		<fileset dir="${org.jboss.esb.server.server}/lib" includes="bsh.jar" /> <!-- Required for scripting Client Code. -->
+		<fileset dir="${org.jboss.esb.server.home}/lib/endorsed"
+			includes="*.jar" /> <!-- Required for JMS Client Code. -->
+		<fileset
+			dir="${org.jboss.esb.server.server}/deploy/jboss-aop-jdk50.deployer"
+			includes="jboss-aop-jdk50.jar" /> <!-- Required for JMS Client Code. -->
+		<fileset dir="${org.jboss.esb.server.home}/client" includes="javassist.jar trove.jar" /> <!-- Required for JMS Client Code. -->
+		<fileset dir="${org.jboss.esb.server.home}/client" includes="hibernate-client.jar" /> <!-- Required for jbpm Client Code. -->
+		<fileset dir="${org.jboss.esb.server.server}/deploy/jbossesb.sar/lib"
+			includes="*.jar" />
+		<!-- jbossesb config -->
+		<fileset dir="${org.jboss.esb.server.server}/deploy/jbossesb.esb"
+			includes="*.jar" />
+		<!-- jbpm config -->
+		<fileset dir="${org.jboss.esb.server.server}/deploy/jbpm.esb"
+			includes="*.jar" />
+		<pathelement location="${org.jboss.esb.server.server}/lib/cglib.jar" />
+		<!-- smooks config -->
+		<fileset dir="${org.jboss.esb.server.server}/deploy/smooks.esb"
+			includes="*.jar" />
+		<!-- jbrules config -->
+		<fileset dir="${org.jboss.esb.server.server}/deploy/jbrules.esb"
+			includes="*.jar" />
+		<!-- spring config -->
+		<fileset dir="${org.jboss.esb.server.server}/deploy/spring.esb"
+			includes="*.jar" />
+		<!-- soap config -->
+		<fileset dir="${org.jboss.esb.server.server}/deploy/soap.esb"
+			includes="*.jar" />
+		<fileset dir="${org.jboss.esb.server.server}/lib" includes="activation.jar, mail.jar, jboss-ejb3x.jar" />
+		<!-- general libs -->
+		<pathelement location="${org.jboss.esb.server.home}/lib/commons-logging.jar" />
+		<pathelement location="${org.jboss.esb.server.home}/lib/commons-codec.jar" />
+		<pathelement location="${org.jboss.esb.server.home}/lib/jboss-system.jar" />
+		<pathelement location="${org.jboss.esb.server.home}/lib/jboss-xml-binding.jar" />
+		<pathelement location="${org.jboss.esb.server.server}/lib/log4j.jar" />
+		<fileset dir="${product.dir}/lib/ext">
+			<include name="emma*.jar" />
+		</fileset>
+		<fileset dir="${qa.lib}/ext" includes="*.jar" />
+		<pathelement location="${org.jboss.esb.server.home}/client/jbossall-client.jar" />
+		<pathelement location="${pwd}" />
+	</path>
+</project>
\ No newline at end of file

Modified: labs/jbossesb/trunk/qa/build.xml
===================================================================
--- labs/jbossesb/trunk/qa/build.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/qa/build.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -23,6 +23,10 @@
                 <propertyref  regex="soa.test.*"/>
         </propertyset>
 
+	<propertyset id="org.jboss.esb.server">
+		<propertyref regex="org.jboss.esb.server.*"/>	
+	</propertyset>
+
 	<property name="junit.jar" location="lib/ext/junit-4.1.jar"/>
 	<macrodef name="runant">
 		<attribute name="target"/>
@@ -34,6 +38,7 @@
 			    fork="true" failonerror="@{failonerror}"
 				resultproperty="@{resultproperty}">
 				<syspropertyset refid="soa.props"/>
+				<syspropertyset refid="org.jboss.esb.server"/>
 				<sysproperty key="ant.home" value="${ant.home}"/>
 				<sysproperty key="ant.library.dir" value="${ant.library.dir}"/>
 	            		<sysproperty key="org.jboss.esb.properties" value="${org.jboss.esb.properties}"/>
@@ -87,6 +92,10 @@
         <ant dir="junit" target="test" />
     </target>
 
+    <target name="quickstarts" depends="esb.init" description="Run Quickstart based QA tests.">
+		<ant dir="quickstarts" target="ci-test"/>	
+    </target>
+
 	<target name="test.junit" depends="esb.init" description="Run JUnit based QA tests.">
 		<ant dir="junit" target="test" />
 		<ant dir="quickstarts" target="all-test" />

Modified: labs/jbossesb/trunk/qa/junit/build.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/build.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/qa/junit/build.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,8 +1,7 @@
 <?xml version="1.0"?>
 <project name="JUnit" default="test" basedir=".">
-
+   <property name="product.dir" location="../../product"/>
    <property name="product.build" location="../../product/build"/>
-   <property name="product.lib" location="${product.build}/jbossesb/lib"/>
    <property name="coverage" location="${product.build}/tests/coverage"/>
    <property name="qa.build" location="../build"/>
    <property name="qa.build.lib" location="../build/lib"/>
@@ -22,20 +21,8 @@
 
    <property file="${org.jboss.esb.properties}"/>
 
-   <path id="base.cp">
-      <fileset dir="${product.lib}/ext"
-               excludes="*.jar" includes="jaxr-api*.jar,scout*.jar,juddi*.jar"/>
-      <fileset dir="${qa.lib}/ext" includes="*.jar"/>
-      <fileset dir="${product.lib}/ext" includes="*.jar"/>
-      <fileset dir="${product.lib}/jbpm.esb" includes="*.jar"/>
-      <pathelement location="../"/>
-   </path>
+   <import file="../base-cp.xml"/>
 
-   <path id="qa.junit.cp">
-      <path refid="base.cp"/>
-      <fileset dir="${product.lib}" includes="*.jar"/>
-   </path>
-
    <path id="qa.junit.emma.cp">
       <fileset dir="${coverage}/all" includes="jbossesb-instr-all.jar"/>
       <path refid="base.cp"/>
@@ -46,10 +33,9 @@
 
    <target name="compile">
       <echo message="Running JUnit based QA tests..."/>
-
       <!-- Build the tests... -->
       <mkdir dir="${qa.junit.classes}"/>
-      <javac srcdir="${qa.junit.src}" destdir="${qa.junit.classes}" classpathref="qa.junit.cp" debug="on"/>
+      <javac srcdir="${qa.junit.src}" destdir="${qa.junit.classes}" classpathref="base.cp" debug="on"/>
    </target>
 
    <target name="compile-versioned">
@@ -57,7 +43,6 @@
 
       <path id="qa.junit.versioned.cp">
          <path refid="base.cp"/>
-         <fileset dir="${product.lib}" includes="*.jar"/>
          <pathelement location="${qa.junit.classes}"/>
       </path>
 
@@ -162,6 +147,7 @@
              haltonfailure="false"
              fork="true">
 
+	 <sysproperty key="org.jboss.esb.jmsimpl" value="${org.jboss.soa.esb.qa.jmsprovider}"/>
          <sysproperty key="jbosstest.deploy.dir" value="${qa.build.lib}"/>
          <sysproperty key="jbosstest.threadcount" value="${jbosstest.threadcount}"/>
          <sysproperty key="jbosstest.iterationcount" value="${jbosstest.iterationcount}"/>
@@ -174,7 +160,7 @@
 
          <classpath>
             <pathelement location="${qa.junit.classes}"/>
-            <path refid="qa.junit.cp"/>
+            <path refid="base.cp"/>
             <pathelement location="${qa.junit.src}"/>
             <!-- jndi.properties and other client prop files -->
             <pathelement location="${qa.junit.resources}/server"/>
@@ -234,14 +220,16 @@
                <exclude name="${tests.exclude}"/>
             </fileset>
          </batchtest>
+
          <classpath>
             <pathelement location="${qa.junit.classes}"/>
-            <path refid="qa.junit.cp"/>
+            <path refid="base.cp"/>
             <pathelement location="${qa.junit.src}"/>
          	<pathelement location="${qa.junit.resources}/server"/>
          </classpath>
          <jvmarg value="-Xmx${qa.junit.memory}"/>
 
+         <sysproperty key="org.jboss.esb.jmsimpl" value="${org.jboss.soa.esb.qa.jmsprovider}"/>
       	 <sysproperty key="jbosstest.deploy.dir" value="${qa.build.lib}"/>
          <sysproperty key="jbosstest.threadcount" value="${jbosstest.threadcount}"/>
          <sysproperty key="jbosstest.iterationcount" value="${jbosstest.iterationcount}"/>

Modified: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/epr/LogicalEPRUnitTest.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/epr/LogicalEPRUnitTest.java	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/epr/LogicalEPRUnitTest.java	2008-04-18 14:22:42 UTC (rev 19625)
@@ -87,10 +87,13 @@
 
     public static Test suite() throws Exception {
         DeploymentArchive deployment = new DeploymentArchive("LogicalEPRUnitTest.esb");
-
+        String jmsImpl = System.getProperty("org.jboss.esb.jmsimpl");
+	if (jmsImpl == null) {
+		jmsImpl = "jbm";	
+	}
         deployment.addEntry("META-INF/jboss-esb.xml", LogicalEPRUnitTest.class.getResourceAsStream("jboss-esb.xml"));
         deployment.addEntry("META-INF/deployment.xml", LogicalEPRUnitTest.class.getResourceAsStream("deployment.xml"));
-        deployment.addEntry("jms-service.xml", LogicalEPRUnitTest.class.getResourceAsStream("jms-service.xml"));
+        deployment.addEntry(jmsImpl + "-queue-service.xml", LogicalEPRUnitTest.class.getResourceAsStream(jmsImpl + "-service.xml"));
         deployment.addEntry(ServiceInvokerAction.class);
         deployment.addEntry(Service2Action.class);
         deployment.addEntry(Service3Action1.class);

Copied: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/epr/jbm-service.xml (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/qa/junit/src/org/jboss/soa/esb/epr/jbm-service.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/epr/jbm-service.xml	                        (rev 0)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/epr/jbm-service.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+
+    <mbean code="org.jboss.jms.server.destination.QueueService"
+           name="jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service1_gtw"
+           xmbean-dd="xmdesc/Queue-xmbean.xml">
+        <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+        <depends>jboss.messaging:service=PostOffice</depends>
+    </mbean>
+
+    <mbean code="org.jboss.jms.server.destination.QueueService"
+           name="jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service1"
+           xmbean-dd="xmdesc/Queue-xmbean.xml">
+        <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+        <depends>jboss.messaging:service=PostOffice</depends>
+    </mbean>
+
+    <mbean code="org.jboss.jms.server.destination.QueueService"
+           name="jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service2"
+           xmbean-dd="xmdesc/Queue-xmbean.xml">
+        <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+        <depends>jboss.messaging:service=PostOffice</depends>
+    </mbean>
+
+    <mbean code="org.jboss.jms.server.destination.QueueService"
+           name="jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service3"
+           xmbean-dd="xmdesc/Queue-xmbean.xml">
+        <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+        <depends>jboss.messaging:service=PostOffice</depends>
+    </mbean>
+
+    <mbean code="org.jboss.jms.server.destination.QueueService"
+           name="jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service4"
+           xmbean-dd="xmdesc/Queue-xmbean.xml">
+        <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+        <depends>jboss.messaging:service=PostOffice</depends>
+    </mbean>
+
+</server>
\ No newline at end of file

Copied: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/epr/jbmq-service.xml (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/qa/junit/src/org/jboss/soa/esb/epr/jbmq-service.xml)
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/epr/jbmq-service.xml	                        (rev 0)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/epr/jbmq-service.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+    <mbean code="org.jboss.mq.server.jmx.Queue"
+           name="jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service1_gtw">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+    </mbean>
+    <mbean code="org.jboss.mq.server.jmx.Queue"
+           name="jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service1">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+    </mbean>
+    <mbean code="org.jboss.mq.server.jmx.Queue"
+           name="jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service2">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+    </mbean>
+    <mbean code="org.jboss.mq.server.jmx.Queue"
+           name="jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service3">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+    </mbean>
+    <mbean code="org.jboss.mq.server.jmx.Queue"
+           name="jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service4">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+    </mbean>
+</server>

Deleted: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/epr/jms-service.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/epr/jms-service.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/epr/jms-service.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
-
-    <mbean code="org.jboss.jms.server.destination.QueueService"
-           name="jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service1_gtw"
-           xmbean-dd="xmdesc/Queue-xmbean.xml">
-        <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-        <depends>jboss.messaging:service=PostOffice</depends>
-    </mbean>
-
-    <mbean code="org.jboss.jms.server.destination.QueueService"
-           name="jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service1"
-           xmbean-dd="xmdesc/Queue-xmbean.xml">
-        <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-        <depends>jboss.messaging:service=PostOffice</depends>
-    </mbean>
-
-    <mbean code="org.jboss.jms.server.destination.QueueService"
-           name="jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service2"
-           xmbean-dd="xmdesc/Queue-xmbean.xml">
-        <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-        <depends>jboss.messaging:service=PostOffice</depends>
-    </mbean>
-
-    <mbean code="org.jboss.jms.server.destination.QueueService"
-           name="jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service3"
-           xmbean-dd="xmdesc/Queue-xmbean.xml">
-        <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-        <depends>jboss.messaging:service=PostOffice</depends>
-    </mbean>
-
-    <mbean code="org.jboss.jms.server.destination.QueueService"
-           name="jboss.esb.qa.junit.destination:service=Queue,name=LogicalEPRUnitTest_service4"
-           xmbean-dd="xmdesc/Queue-xmbean.xml">
-        <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-        <depends>jboss.messaging:service=PostOffice</depends>
-    </mbean>
-
-</server>
\ No newline at end of file

Deleted: labs/jbossesb/trunk/qa/lib/ext/javassist.jar
===================================================================
(Binary files differ)

Deleted: labs/jbossesb/trunk/qa/lib/ext/jboss-aop-jdk50.jar
===================================================================
(Binary files differ)

Deleted: labs/jbossesb/trunk/qa/lib/ext/jboss-messaging-client.jar
===================================================================
(Binary files differ)

Copied: labs/jbossesb/trunk/qa/lib/ext/test-util.jar (from rev 19621, labs/jbossesb/tags/JBESB_4_2_1_GA_CP2_2/qa/lib/ext/test-util.jar)
===================================================================
(Binary files differ)

Deleted: labs/jbossesb/trunk/qa/lib/ext/trove.jar
===================================================================
(Binary files differ)

Modified: labs/jbossesb/trunk/qa/quickstarts/build.xml
===================================================================
--- labs/jbossesb/trunk/qa/quickstarts/build.xml	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/qa/quickstarts/build.xml	2008-04-18 14:22:42 UTC (rev 19625)
@@ -4,8 +4,6 @@
 
    <property name="product.dir" location="../../product"/>
    <property name="product.build" location="${product.dir}/build"/>
-   <property name="product.lib" location="${product.build}/jbossesb/lib"/>
-   <property name="product.lib.ext" location="${product.lib}/ext"/>
    <property name="org.jboss.esb.test.quickstarts.dir" location="${product.build}/jbossesb/samples/quickstarts"/>
    <property name="coverage" location="${product.build}/tests/coverage"/>
    <property name="qa.dir" location=".."/>
@@ -26,7 +24,10 @@
 
    <property name="org.jboss.soa.esb.paramsRepository.file.root" location="src"/>
 
-   <property name="junit.jar" location="${product.lib.ext}/junit-4.1.jar"/>
+   <property name="junit.jar" location="${product.dir}/lib/ext/junit-4.1.jar"/>
+   
+   <import file="../base-cp.xml"/>
+   
    <macrodef name="runant">
       <attribute name="target"/>
       <attribute name="failonerror" default="true"/>
@@ -48,12 +49,6 @@
       </sequential>
    </macrodef>
 
-   <path id="base.cp">
-      <fileset dir="${qa.lib}/ext" includes="*.jar"/>
-      <fileset dir="${product.lib}/ext" includes="*.jar"/>
-      <pathelement location="${qa.dir}/"/>
-   </path>
-
    <path id="qa.quickstarts.cp">
       <fileset dir="${product.dir}/services/jbossesb/build">
     	 <include name="**/*.jar"/> 
@@ -94,16 +89,16 @@
 	 <include name="business_rules_service/build/classes"/>
 	 <include name="custom_action/build/classes"/>
 	 <include name="deadletter/build/classes"/>
-         <include name="dynamic_router/build/classes"/>
+	 <include name="dynamic_router/build/classes"/>
 	 <include name="exceptions_faults/build/classes"/>
   	 <include name="fun_cbr/build/classes"/>
 	 <include name="groovy_gateway/build/classes"/>
-         <include name="helloworld/build/classes"/>
-         <include name="helloworld_action/build/classes"/>
-         <include name="helloworld_db_registration/build/classes"/>
-         <include name="helloworld_file_action/build/classes"/>
+     <include name="helloworld/build/classes"/>
+     <include name="helloworld_action/build/classes"/>
+     <include name="helloworld_db_registration/build/classes"/>
+     <include name="helloworld_file_action/build/classes"/>
 	 <include name="helloworld_file_notifier/build/classes"/>
-         <include name="helloworld_sql_action/build/classes"/>
+     <include name="helloworld_sql_action/build/classes"/>
 	 <include name="jms_secured/build/classes"/>
 	 <include name="jms_topic/build/classes"/>
 	 <include name="load_generator/build/classes"/>
@@ -111,29 +106,26 @@
 	 <include name="messagefilter/build/classes"/>
 	 <include name="messagestore/build/classes"/>
 	 <include name="native_client/build/classes"/>
-         <include name="recipient_list/build/classes"/>
+     <include name="recipient_list/build/classes"/>
 	 <include name="scheduled_services/build/classes"/>
 	 <include name="scripting_groovy/build/classes"/>
-         <include name="simple_cbr/build/classes"/>
+     <include name="simple_cbr/build/classes"/>
 	 <include name="spring_aop/build/classes"/>
 	 <include name="spring_helloworld/build/classes"/>
 	 <include name="spring_jpetstore/build/classes"/>
-         <include name="static_router/build/classes"/>
-         <include name="transform_CSV2XML/build/classes"/>
-         <include name="transform_EDI2XML_Groovy_XSLT/build/classes"/>
-         <include name="transform_XML2POJO/build/classes"/>
-         <include name="transform_XML2XML_date_manipulation/build/classes"/>
-         <include name="transform_XML2XML_simple/build/classes"/>
+     <include name="static_router/build/classes"/>
+     <include name="transform_CSV2XML/build/classes"/>
+     <include name="transform_EDI2XML_Groovy_XSLT/build/classes"/>
+     <include name="transform_XML2POJO/build/classes"/>
+     <include name="transform_XML2XML_date_manipulation/build/classes"/>
+     <include name="transform_XML2XML_simple/build/classes"/>
 	 <include name="webservice_consumer1/build/classes"/>
 	 <include name="webservice_consumer2/build/classes"/>
 	 <include name="webservice_producer/build/classes"/>
 	 <include name="wiretap/build/classes"/>
       </dirset>
-   	
-      <fileset dir="${product.lib.ext}" includes="*.jar"/>
-      <fileset dir="${product.lib}" includes="*.jar"/>
       <pathelement location="${qa.quickstarts.resources}"/>
-      <path refid="base.cp"/>
+	  <path refid="base.cp"/>
    </path>
 
    <path id="qa.quickstarts.emma.cp">
@@ -257,9 +249,6 @@
       <exec-quickstart quickstart="helloworld_sql_action" target="prepare-deployment"/>
       <exec-quickstart quickstart="jms_secured" target="prepare-deployment"/>
       <exec-quickstart quickstart="jms_topic" target="prepare-deployment"/>
-	<!--
-      <exec-quickstart quickstart="load_generator" target="prepare-deployment"/>
-	-->
       <exec-quickstart quickstart="messagefilter" target="prepare-deployment"/>
       <exec-quickstart quickstart="messagestore" target="prepare-deployment"/>
       <exec-quickstart quickstart="native_client" target="prepare-deployment"/>
@@ -372,12 +361,13 @@
 	       <exclude name="**/SpringJPetStoreTest.java"/>
                <exclude name="**/HelloWorldSQLActionTest.java"/>
 	       <exclude name="**/BPMOrchestration1Test.java"/>
-	       <!-- The following quickstart is broken -->
+	       <!-- The following quickstart is broken -->
 	       <exclude name="**/BPMOrchestration3Test.java"/>
 	       <exclude name="**/HelloWorldFileNotifierTest.java"/>
                <exclude name="**/RecipientlistTest.java"/>
 	       <exclude name="**/ExceptionsFaultsTest.java"/>
                <exclude name="**/DynamicRouterTest.java"/>
+
 	       <!-- The Groovy Gateway test requires testing UI -->
 	       <exclude name="**/GroovyGatewayTest.java"/>
 	       <exclude name="**/LoadGeneratorTest.java"/>

Modified: labs/jbossesb/trunk/qa/test.properties
===================================================================
--- labs/jbossesb/trunk/qa/test.properties	2008-04-18 13:48:19 UTC (rev 19624)
+++ labs/jbossesb/trunk/qa/test.properties	2008-04-18 14:22:42 UTC (rev 19625)
@@ -6,3 +6,12 @@
 
 org.jboss.soa.esb.jndi.server.type=jboss
 org.jboss.soa.esb.jndi.server.url=localhost
+
+####
+# Set these options to run the tests against a SOA/JBoss AS container
+####
+#soa.test.no-prepare=true
+#org.jboss.esb.server.home=/opt/jboss-soa-p.4.2.0/jboss-as
+#org.jboss.esb.test.server.config=all
+#org.jboss.esb.server.config=all
+




More information about the jboss-svn-commits mailing list