[jboss-cvs] JBoss Messaging SVN: r2571 - in trunk: docs and 13 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Apr 11 12:38:25 EDT 2007


Author: timfox
Date: 2007-04-11 12:38:25 -0400 (Wed, 11 Apr 2007)
New Revision: 2571

Added:
   trunk/src/main/org/jboss/messaging/util/ObjectInputStreamWithClassLoader.java
   trunk/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/
   trunk/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/FailingClient.java
   trunk/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/SimultaneousFailureTest.java
   trunk/tests/src/org/jboss/test/messaging/jms/message/SomeObject.java
Removed:
   trunk/src/main/org/jboss/jms/util/ThreadContextClassLoaderChanger.java
   trunk/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/FailingClient.java
   trunk/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/SimultaneousFailureTest.java
Modified:
   trunk/build-thirdparty.xml
   trunk/docs/README.html
   trunk/src/main/org/jboss/jms/client/JBossConnection.java
   trunk/src/main/org/jboss/jms/client/JBossConnectionConsumer.java
   trunk/src/main/org/jboss/jms/client/JBossConnectionFactory.java
   trunk/src/main/org/jboss/jms/client/JBossMessageProducer.java
   trunk/src/main/org/jboss/jms/client/JBossQueueBrowser.java
   trunk/src/main/org/jboss/jms/client/JBossSession.java
   trunk/src/main/org/jboss/jms/client/container/ConsumerAspect.java
   trunk/src/main/org/jboss/jms/client/container/SessionAspect.java
   trunk/src/main/org/jboss/jms/server/ServerPeer.java
   trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
   trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
   trunk/src/main/org/jboss/messaging/util/StreamUtils.java
   trunk/tests/build.xml
   trunk/tests/src/org/jboss/test/messaging/jms/DuplicateClientIDTest.java
   trunk/tests/src/org/jboss/test/messaging/jms/JMSTest.java
   trunk/tests/src/org/jboss/test/messaging/jms/RemotingConnectionConfigurationTest.java
   trunk/tests/src/org/jboss/test/messaging/jms/message/ObjectMessageTest.java
   trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/RMITestServer.java
   trunk/util/release-admin.xml
Log:
Merge from 1_2_0_SP into TRUNK



Modified: trunk/build-thirdparty.xml
===================================================================
--- trunk/build-thirdparty.xml	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/build-thirdparty.xml	2007-04-11 16:38:25 UTC (rev 2571)
@@ -92,7 +92,7 @@
       <componentref name="jboss/common-logging-spi" version="2.0.2.GA"/>
       <componentref name="jboss/aop" version="1.5.3.GA"/>
       <componentref name="jboss/serialization" version="1.0.3.GA"/>
-      <componentref name="jboss/remoting" version="2.2.0.Beta1"/>
+      <componentref name="jboss/remoting" version="2.2.0.GA"/>
       <componentref name="jboss/jbossts" version="4.2.2.GA"/>
       <componentref name="jboss/test14" version="1.0.0.GA"/>
       <componentref name="jboss/jbossretro-rt" version="1.0.4.GA"/>

Modified: trunk/docs/README.html
===================================================================
--- trunk/docs/README.html	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/docs/README.html	2007-04-11 16:38:25 UTC (rev 2571)
@@ -6,10 +6,9 @@
   <title>JBoss Messaging Release Notes</title>
 </head>
 <body>
-<h1><br>
-JBoss Messaging 1.2.0.GA Release Notes</h1>
+
 <br>
-March 01 2007<br>
+March 28 2007<br>
 <br>
 <br>
 JBoss
@@ -26,6 +25,28 @@
 and <a href="./docs/userguide/pdf/JBossMessagingUsersGuide.pdf">PDF</a>
 formats.&nbsp; The guide is also available on-line at&nbsp; <a
  href="http://labs.jboss.com/portal/jbossmessaging/docs/index.html">http://labs.jboss.com/portal/jbossmessaging/docs/index.html</a><br>
+
+<h1><br>
+Release Notes - JBoss Messaging - Version 1.2.0.SP1
+</h1>
+    
+<h2>Bug</h2>
+<ul>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBMESSAGING-922'>JBMESSAGING-922</a>] - JBossConnection::setExceptionListener needs to set ClassLoader</li>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBMESSAGING-924'>JBMESSAGING-924</a>] - ObjectMessage.getObject() should deserialize using context classloader</li>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBMESSAGING-928'>JBMESSAGING-928</a>] - Server hangs if client is abruptedly killed</li>
+</ul>
+                            
+<h2>Task</h2>
+<ul>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBMESSAGING-254'>JBMESSAGING-254</a>] - Remove ThreadContextClassLoaderChanger</li>
+<li>[<a href='http://jira.jboss.com/jira/browse/JBMESSAGING-920'>JBMESSAGING-920</a>] - Memory Leaks when opening/closing connections</li>
+</ul>
+
+
+
+<h1><br>
+JBoss Messaging 1.2.0.GA Release Notes</h1>
 <br>
 <span style="font-weight: bold;"></span>
 <h2>Summary of Changes<br>

Modified: trunk/src/main/org/jboss/jms/client/JBossConnection.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/JBossConnection.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/src/main/org/jboss/jms/client/JBossConnection.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -49,7 +49,6 @@
 import org.jboss.jms.client.state.ConnectionState;
 import org.jboss.jms.delegate.ConnectionDelegate;
 import org.jboss.jms.delegate.SessionDelegate;
-import org.jboss.jms.util.ThreadContextClassLoaderChanger;
 
 /**
  * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
@@ -94,34 +93,12 @@
 
    public String getClientID() throws JMSException
    {
-      ThreadContextClassLoaderChanger tccc = new ThreadContextClassLoaderChanger();
-
-      try
-      {
-         tccc.set(getClass().getClassLoader());
-
-         return delegate.getClientID();
-      }
-      finally
-      {
-         tccc.restore();
-      }
+      return delegate.getClientID();
    }
 
    public void setClientID(String clientID) throws JMSException
    {
-      ThreadContextClassLoaderChanger tccc = new ThreadContextClassLoaderChanger();
-
-      try
-      {
-         tccc.set(getClass().getClassLoader());
-
-         delegate.setClientID(clientID);
-      }
-      finally
-      {
-         tccc.restore();
-      }
+      delegate.setClientID(clientID);
    }
 
    public ConnectionMetaData getMetaData() throws JMSException
@@ -289,20 +266,9 @@
          acknowledgeMode = Session.SESSION_TRANSACTED;
       }
 
-      ThreadContextClassLoaderChanger tccc = new ThreadContextClassLoaderChanger();
-
-      try
-      {
-         tccc.set(getClass().getClassLoader());
-
-         SessionDelegate sessionDelegate =
-            delegate.createSessionDelegate(transacted, acknowledgeMode, isXA);
-         return new JBossSession(sessionDelegate, type);
-      }
-      finally
-      {
-         tccc.restore();
-      }
+      SessionDelegate sessionDelegate =
+         delegate.createSessionDelegate(transacted, acknowledgeMode, isXA);
+      return new JBossSession(sessionDelegate, type);
    }
 
    // Temporarily commented out as it seems to produce random test failures

Modified: trunk/src/main/org/jboss/jms/client/JBossConnectionConsumer.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/JBossConnectionConsumer.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/src/main/org/jboss/jms/client/JBossConnectionConsumer.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -40,7 +40,6 @@
 import org.jboss.jms.destination.JBossDestination;
 import org.jboss.jms.message.MessageProxy;
 import org.jboss.jms.util.MessageQueueNameHelper;
-import org.jboss.jms.util.ThreadContextClassLoaderChanger;
 import org.jboss.logging.Logger;
 
 import EDU.oswego.cs.dl.util.concurrent.SynchronizedInt;
@@ -117,23 +116,12 @@
          this.maxMessages = 1;
       }
 
-      ThreadContextClassLoaderChanger tccc = new ThreadContextClassLoaderChanger();
+      // Create a consumer. The MessageCallbackhandler knows we are a connection consumer so will
+      // not call pre or postDeliver so messages won't be acked, or stored in session/tx.
+      sess = conn.createSessionDelegate(false, Session.CLIENT_ACKNOWLEDGE, false);
 
-      try
-      {
-         tccc.set(getClass().getClassLoader());
+      cons = sess.createConsumerDelegate(dest, messageSelector, false, subName, true);
 
-         // Create a consumer. The MessageCallbackhandler knows we are a connection consumer so will
-         // not call pre or postDeliver so messages won't be acked, or stored in session/tx.
-         sess = conn.createSessionDelegate(false, Session.CLIENT_ACKNOWLEDGE, false);
-
-         cons = sess.createConsumerDelegate(dest, messageSelector, false, subName, true);
-      }
-      finally
-      {
-         tccc.restore();
-      }
-
       ConsumerState state = (ConsumerState)((DelegateSupport)cons).getState();
 
       this.consumerID = state.getConsumerID();      

Modified: trunk/src/main/org/jboss/jms/client/JBossConnectionFactory.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/JBossConnectionFactory.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/src/main/org/jboss/jms/client/JBossConnectionFactory.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -42,7 +42,6 @@
 import org.jboss.jms.delegate.ConnectionFactoryDelegate;
 import org.jboss.jms.referenceable.SerializableObjectRefAddr;
 import org.jboss.jms.server.endpoint.CreateConnectionResult;
-import org.jboss.jms.util.ThreadContextClassLoaderChanger;
 import org.jboss.logging.Logger;
 
 /**
@@ -188,35 +187,24 @@
                                                       boolean isXA, int type)
       throws JMSException
    {
-      ThreadContextClassLoaderChanger tccc = new ThreadContextClassLoaderChanger();
-      
       try
       {
-         tccc.set(getClass().getClassLoader());
-
-         try
-         {
-            ClientAOPStackLoader.getInstance().load(delegate);
-         }
-         catch(Exception e)
-         {
-            // Need to log message since no guarantee that client will log it
-            final String msg = "Failed to download and/or install client side AOP stack";
-            log.error(msg, e);
-            throw new RuntimeException(msg, e);
-         }
-   
-         // The version used by the connection is the minimum of the server version for the
-         // connection factory and the client code version
-         
-         CreateConnectionResult res = delegate.createConnectionDelegate(username, password, -1);        
-         
-         return new JBossConnection(res.getDelegate(), type);
+         ClientAOPStackLoader.getInstance().load(delegate);
       }
-      finally
+      catch(Exception e)
       {
-         tccc.restore();
+         // Need to log message since no guarantee that client will log it
+         final String msg = "Failed to download and/or install client side AOP stack";
+         log.error(msg, e);
+         throw new RuntimeException(msg, e);
       }
+
+      // The version used by the connection is the minimum of the server version for the
+      // connection factory and the client code version
+
+      CreateConnectionResult res = delegate.createConnectionDelegate(username, password, -1);
+
+      return new JBossConnection(res.getDelegate(), type);
    }
    
    // Private --------------------------------------------------------------------------------------

Modified: trunk/src/main/org/jboss/jms/client/JBossMessageProducer.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/JBossMessageProducer.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/src/main/org/jboss/jms/client/JBossMessageProducer.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -35,7 +35,6 @@
 
 import org.jboss.jms.delegate.ProducerDelegate;
 import org.jboss.jms.destination.JBossDestination;
-import org.jboss.jms.util.ThreadContextClassLoaderChanger;
 import org.jboss.logging.Logger;
 
 /**
@@ -162,18 +161,7 @@
          throw new InvalidDestinationException("Not a JBossDestination:" + destination);
       }
 
-      ThreadContextClassLoaderChanger tccc = new ThreadContextClassLoaderChanger();
-
-      try
-      {
-         tccc.set(getClass().getClassLoader());
-
-         delegate.send((JBossDestination)destination, m, deliveryMode, priority, timeToLive);
-      }
-      finally
-      {
-         tccc.restore();
-      }      
+      delegate.send((JBossDestination)destination, m, deliveryMode, priority, timeToLive);
    }
 
 

Modified: trunk/src/main/org/jboss/jms/client/JBossQueueBrowser.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/JBossQueueBrowser.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/src/main/org/jboss/jms/client/JBossQueueBrowser.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -29,7 +29,6 @@
 import java.util.Enumeration;
 
 import org.jboss.jms.delegate.BrowserDelegate;
-import org.jboss.jms.util.ThreadContextClassLoaderChanger;
 
 /**
  * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
@@ -69,18 +68,7 @@
 
    public Enumeration getEnumeration() throws JMSException
    {
-      ThreadContextClassLoaderChanger tccc = new ThreadContextClassLoaderChanger();
-
-      try
-      {
-         tccc.set(getClass().getClassLoader());
-         delegate.reset();
-      }
-      finally
-      {
-         tccc.restore();
-      }
-      
+      delegate.reset();
       return new BrowserEnumeration();
    }
 

Modified: trunk/src/main/org/jboss/jms/client/JBossSession.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/JBossSession.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/src/main/org/jboss/jms/client/JBossSession.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -65,7 +65,6 @@
 import org.jboss.jms.destination.JBossTemporaryTopic;
 import org.jboss.jms.destination.JBossTopic;
 import org.jboss.jms.message.MessageProxy;
-import org.jboss.jms.util.ThreadContextClassLoaderChanger;
 import org.jboss.logging.Logger;
 
 /**
@@ -191,18 +190,7 @@
    {
       if (log.isTraceEnabled()) { log.trace("setMessageListener(" + listener + ") called"); }
 
-      ThreadContextClassLoaderChanger tccc = new ThreadContextClassLoaderChanger();
-
-      try
-      {
-         tccc.set(getClass().getClassLoader());
-
-         delegate.setMessageListener(listener);
-      }
-      finally
-      {
-         tccc.restore();
-      }
+      delegate.setMessageListener(listener);
    }
 
    public void run()
@@ -218,19 +206,8 @@
          throw new InvalidDestinationException("Not a JBossDestination:" + d);
       }
            
-      ThreadContextClassLoaderChanger tccc = new ThreadContextClassLoaderChanger();
-
-      try
-      {
-         tccc.set(getClass().getClassLoader());
-
-         ProducerDelegate producerDelegate = delegate.createProducerDelegate((JBossDestination)d);
-         return new JBossMessageProducer(producerDelegate);
-      }
-      finally
-      {
-         tccc.restore();
-      }
+      ProducerDelegate producerDelegate = delegate.createProducerDelegate((JBossDestination)d);
+      return new JBossMessageProducer(producerDelegate);
    }
 
   public MessageConsumer createConsumer(Destination d) throws JMSException
@@ -257,21 +234,10 @@
 
       log.debug("attempting to create consumer for destination:" + d + (messageSelector == null ? "" : ", messageSelector: " + messageSelector) + (noLocal ? ", noLocal = true" : ""));
 
-      ThreadContextClassLoaderChanger tccc = new ThreadContextClassLoaderChanger();
+      ConsumerDelegate cd = delegate.
+         createConsumerDelegate((JBossDestination)d, messageSelector, noLocal, null, false);
 
-      try
-      {
-         tccc.set(getClass().getClassLoader());
-
-         ConsumerDelegate cd = delegate.
-            createConsumerDelegate((JBossDestination)d, messageSelector, noLocal, null, false);
-         
-         return new JBossMessageConsumer(cd);
-      }
-      finally
-      {
-         tccc.restore();
-      }
+      return new JBossMessageConsumer(cd);
    }
 
    public Queue createQueue(String queueName) throws JMSException
@@ -310,21 +276,10 @@
          throw new InvalidDestinationException("Not a JBossTopic:" + topic);
       }
 
-      ThreadContextClassLoaderChanger tccc = new ThreadContextClassLoaderChanger();
+      ConsumerDelegate cd =
+         delegate.createConsumerDelegate((JBossTopic)topic, null, false, name, false);
 
-      try
-      {
-         tccc.set(getClass().getClassLoader());
-
-         ConsumerDelegate cd =
-            delegate.createConsumerDelegate((JBossTopic)topic, null, false, name, false);
-
-         return new JBossMessageConsumer(cd);
-      }
-      finally
-      {
-         tccc.restore();
-      }
+      return new JBossMessageConsumer(cd);
    }
 
    public TopicSubscriber createDurableSubscriber(Topic topic,
@@ -382,21 +337,10 @@
          messageSelector = null;
       }
 
-      ThreadContextClassLoaderChanger tccc = new ThreadContextClassLoaderChanger();
+      BrowserDelegate del =
+         delegate.createBrowserDelegate((JBossQueue)queue, messageSelector);
 
-      try
-      {
-         tccc.set(getClass().getClassLoader());
-
-         BrowserDelegate del =
-            delegate.createBrowserDelegate((JBossQueue)queue, messageSelector);
-         
-         return new JBossQueueBrowser(queue, messageSelector, del);
-      }
-      finally
-      {
-         tccc.restore();
-      }
+      return new JBossQueueBrowser(queue, messageSelector, del);
    }
 
    public TemporaryQueue createTemporaryQueue() throws JMSException

Modified: trunk/src/main/org/jboss/jms/client/container/ConsumerAspect.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/container/ConsumerAspect.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/src/main/org/jboss/jms/client/container/ConsumerAspect.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -145,7 +145,7 @@
    {
       MethodInvocation mi = (MethodInvocation)invocation;
       Object[] args = mi.getArguments();
-      long timeout = args == null ? 0 : ((Long)args[0]).longValue();
+      long timeout = (args == null || args.length==0) ? 0 : ((Long)args[0]).longValue();
       
       return getMessageCallbackHandler(invocation).receive(timeout);
    }

Modified: trunk/src/main/org/jboss/jms/client/container/SessionAspect.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/container/SessionAspect.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/src/main/org/jboss/jms/client/container/SessionAspect.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -663,7 +663,7 @@
        
       MethodInvocation mi = (MethodInvocation)invocation;
       
-      if (mi.getArguments() != null)
+      if (mi.getArguments() != null && mi.getArguments().length > 0)
       {
          jbm.setObject((Serializable)mi.getArguments()[0]);
       }
@@ -683,8 +683,8 @@
       JBossTextMessage jbm = new JBossTextMessage(0);
       
       MethodInvocation mi = (MethodInvocation)invocation;
-      
-      if (mi.getArguments() != null)
+
+      if (mi.getArguments() != null && mi.getArguments().length > 0)
       {
          jbm.setText((String)mi.getArguments()[0]);
       }

Modified: trunk/src/main/org/jboss/jms/server/ServerPeer.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/ServerPeer.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/src/main/org/jboss/jms/server/ServerPeer.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -1281,7 +1281,7 @@
    private void loadServerAOPConfig() throws Exception
    {
       URL url = this.getClass().getClassLoader().getResource("aop-messaging-server.xml");
-      AspectXmlLoader.deployXML(url);
+      AspectXmlLoader.deployXML(url, this.getClass().getClassLoader());
    }
 
    private void unloadServerAOPConfig() throws Exception

Modified: trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -306,10 +306,22 @@
 
             log.debug(this + " failed to handle callback", e);
 
+            /*
+
+            TODO: http://jira.jboss.org/jira/browse/JBMESSAGING-928
+                  We need to fix the lock condition caused by handleClientFailure (the promotion of the readLock to writeLock,
+                  cause a infinite wait on read locks that will need synchronized methods...
+                  We will relay on Lease until we can fix this.
+
+                  due to a time constraint to fix a production issue on an user, I have removed this condition until we can
+                  perform this condition without a risk while we will create a testcase for this condition.
+
+                  
+
             ServerConnectionEndpoint sce = sessionEndpoint.getConnectionEndpoint();
             ConnectionManager cm = sce.getServerPeer().getConnectionManager();
 
-            cm.handleClientFailure(sce.getRemotingClientSessionID(), false);
+            cm.handleClientFailure(sce.getRemotingClientSessionID(), false); */
 
             // we're practically cut, from connection down
 

Modified: trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -834,7 +834,7 @@
       
       //Close down the executor
       executor.shutdownAfterProcessingCurrentTask();
-      
+
       deliveries.clear();
       
       sp.removeSession(new Integer(id));

Deleted: trunk/src/main/org/jboss/jms/util/ThreadContextClassLoaderChanger.java
===================================================================
--- trunk/src/main/org/jboss/jms/util/ThreadContextClassLoaderChanger.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/src/main/org/jboss/jms/util/ThreadContextClassLoaderChanger.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -1,78 +0,0 @@
-/*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, 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.jms.util;
-
-/**
- * A thread context classloader changer. This class is an abomination. It is here for experimental
- * purposes only. The way it changes the class loader (and more important, the way it stores the
- * saved thread context class loader) is inneficient and dangerous.
- *
- * TODO: Do not use it in the production version.
- *       See http://www.jboss.org/index.html?module=bb&op=viewtopic&t=74434 for an alternative solution.
- *
- * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public class ThreadContextClassLoaderChanger
-{
-   // Constants -----------------------------------------------------
-
-   // Static --------------------------------------------------------
-
-   private ClassLoader savedThreadContextClassLoader;
-
-   public void set(ClassLoader cl)
-   {
-      Thread currentThread = Thread.currentThread();
-      savedThreadContextClassLoader = currentThread.getContextClassLoader();
-      currentThread.setContextClassLoader(cl);
-   }
-
-   /**
-    * Use it from a finally block.
-    */
-   public void restore()
-   {
-      if (savedThreadContextClassLoader == null)
-      {
-         return;
-      }
-
-      Thread.currentThread().setContextClassLoader(savedThreadContextClassLoader);
-      savedThreadContextClassLoader = null;
-   }
-   // Attributes ----------------------------------------------------
-   
-   // Constructors --------------------------------------------------
-   
-   // Public --------------------------------------------------------
-
-   // Package protected ---------------------------------------------
-   
-   // Protected -----------------------------------------------------
-   
-   // Private -------------------------------------------------------
-   
-   // Inner classes -------------------------------------------------   
-}

Copied: trunk/src/main/org/jboss/messaging/util/ObjectInputStreamWithClassLoader.java (from rev 2570, branches/Branch_1_2_0_SP/src/main/org/jboss/messaging/util/ObjectInputStreamWithClassLoader.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/util/ObjectInputStreamWithClassLoader.java	                        (rev 0)
+++ trunk/src/main/org/jboss/messaging/util/ObjectInputStreamWithClassLoader.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -0,0 +1,86 @@
+/*
+   * JBoss, Home of Professional Open Source
+   * Copyright 2005, 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.messaging.util;
+
+import java.io.ObjectInputStream;
+import java.io.InputStream;
+import java.io.IOException;
+import java.io.ObjectStreamClass;
+
+/**
+ * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ * @version <tt>$Revision$</tt>
+ * 
+ * $Id$
+ */
+public class ObjectInputStreamWithClassLoader extends ObjectInputStream
+{
+
+   // Constants ------------------------------------------------------------------------------------
+
+   // Attributes -----------------------------------------------------------------------------------
+
+   // Static ---------------------------------------------------------------------------------------
+
+   // Constructors ---------------------------------------------------------------------------------
+
+   public ObjectInputStreamWithClassLoader(InputStream in)
+      throws IOException
+   {
+      super(in);
+   }
+
+   // Public ---------------------------------------------------------------------------------------
+
+   // Package protected ----------------------------------------------------------------------------
+
+   // Protected ------------------------------------------------------------------------------------
+
+   protected Class resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException
+   {
+      String name = desc.getName();
+      ClassLoader loader = Thread.currentThread().getContextClassLoader();
+      try
+      {
+         Class clazz = loader.loadClass(name);
+         // sanity check only.. if a classLoader can't find a clazz, it will throw an exception
+         if (clazz == null)
+         {
+            return super.resolveClass(desc);
+         }
+         else
+         {
+            return clazz;
+         }
+      }
+      catch (ClassNotFoundException e)
+      {
+         return super.resolveClass(desc);
+      }
+   }
+
+   // Private --------------------------------------------------------------------------------------
+
+   // Inner classes --------------------------------------------------------------------------------
+
+}

Modified: trunk/src/main/org/jboss/messaging/util/StreamUtils.java
===================================================================
--- trunk/src/main/org/jboss/messaging/util/StreamUtils.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/src/main/org/jboss/messaging/util/StreamUtils.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -162,14 +162,14 @@
             ObjectInputStream ois;
             if (useJBossSerialization)
             {
-               ois = new JBossObjectInputStream(in);
+               ois = new JBossObjectInputStream(in, Thread.currentThread().getContextClassLoader());
             }
             else
             {
-               ois = new ObjectInputStream(in);
+               ois = new ObjectInputStreamWithClassLoader(in);
             }
                         
-            value = (Serializable)ois.readObject();
+            value = ois.readObject();
             break;
          }              
          default :

Modified: trunk/tests/build.xml
===================================================================
--- trunk/tests/build.xml	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/tests/build.xml	2007-04-11 16:38:25 UTC (rev 2571)
@@ -300,6 +300,27 @@
       </java>
    </target>
 
+   <!-- Starts an all config already when starting the rmi server (used on crash tests) -->
+   <target name="start-rmi-server-with-allconfig" depends="init"
+           description="Starts an all config already when starting the rmi server (used on crash tests)">
+
+      <java classname="org.jboss.test.messaging.tools.jmx.rmi.RMITestServer" fork="true" spawn="true">
+         <sysproperty key="module.output" value="${tests.output}"/>
+         <sysproperty key="test.logfile.suffix" value="${remote.server.test.logfile.suffix}"/>
+         <sysproperty key="test.bind.address" value="${test.bind.address}"/>
+         <sysproperty key="test.database" value="${functional.tests.database}"/>
+         <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
+         <sysproperty key="test.remoting" value="${test.remoting}"/>
+         <sysproperty key="java.net.preferIPv4Stack" value="true"/>
+         <sysproperty key="objectstore.dir" value="${objectstore.dir}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=rmiserver"/>
+         -->
+         <arg value="-startAll"/>
+         <classpath refid="test.execution.classpath"/>
+      </java>
+   </target>
+
    <target name="start-rmi-server-clustering" depends="init"
            description="Starts the RMI server used by clustering tests">
 
@@ -844,6 +865,95 @@
 
    </target>
 
+
+   <!-- Temporary crash debug -->
+   <target name="crash-tmp1" depends="tests-jar, prepare-testdirs, clear-test-logs">
+      <java classname="org.jboss.test.messaging.tools.jmx.rmi.RMITestServer" fork="true">
+         <sysproperty key="module.output" value="${tests.output}"/>
+         <sysproperty key="test.logfile.suffix" value="tmp-server"/>
+         <sysproperty key="test.bind.address" value="${test.bind.address}"/>
+         <sysproperty key="test.database" value="${functional.tests.database}"/>
+         <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
+         <sysproperty key="test.remoting" value="${test.remoting}"/>
+         <sysproperty key="java.net.preferIPv4Stack" value="true"/>
+         <sysproperty key="objectstore.dir" value="${objectstore.dir}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=rmiserver"/>
+         -->
+         <arg value="-startAll"/>
+         <classpath refid="test.execution.classpath"/>
+      </java>
+   </target>
+
+   <!-- Temporary crash debug -->
+   <target name="crash-tmp2" depends="tests-jar, prepare-testdirs">
+
+      <java classname="org.jboss.test.messaging.jms.crash.simultaneousfailure.FailingClient" >
+         <sysproperty key="module.output" value="${tests.output}"/>
+         <sysproperty key="test.logfile.suffix" value="crash-client"/>
+         <sysproperty key="test.bind.address" value="${test.bind.address}"/>
+         <sysproperty key="test.database" value="${functional.tests.database}"/>
+         <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
+         <sysproperty key="test.remoting" value="${test.remoting}"/>
+         <sysproperty key="remote" value="true"/>
+         <sysproperty key="java.net.preferIPv4Stack" value="true"/>
+         <sysproperty key="objectstore.dir" value="${objectstore.dir}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=rmiserver"/>
+         -->
+         <classpath refid="test.execution.classpath"/>
+      </java>
+   </target>
+
+
+
+   <!-- Temporary crash debug -->
+   <target name="crash-tmp3" depends="tests-jar, prepare-testdirs">
+      <antcall target="crash-test">
+         <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.simultaneousfailure.SimultaneousFailureTest"/>
+      </antcall>
+
+   </target>
+
+   <!-- This test is disabled until we can implement http://jira.jboss.org/jira/browse/JBMESSAGING-928 properly -->
+   <target name="simultaneous-crash" depends="tests-jar, prepare-testdirs, clear-test-logs">
+      <antcall target="stop-rmi-server"/>
+
+      <antcall target="start-rmi-server-with-allconfig">
+         <param name="remote.server.test.logfile.suffix" value="multiple-crash"/>
+      </antcall>
+
+      <sleep seconds="20"/>
+
+
+      <java classname="org.jboss.test.messaging.jms.crash.simultaneousfailure.FailingClient" fork="true" spawn="true">
+         <sysproperty key="module.output" value="${tests.output}"/>
+         <sysproperty key="test.logfile.suffix" value="crash-client"/>
+         <sysproperty key="test.bind.address" value="${test.bind.address}"/>
+         <sysproperty key="test.database" value="${functional.tests.database}"/>
+         <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
+         <sysproperty key="test.remoting" value="${test.remoting}"/>
+         <sysproperty key="remote" value="true"/>
+         <sysproperty key="java.net.preferIPv4Stack" value="true"/>
+         <sysproperty key="objectstore.dir" value="${objectstore.dir}"/>
+         <!--
+         <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=rmiserver"/>
+         -->
+         <classpath refid="test.execution.classpath"/>
+      </java>
+
+      <antcall target="crash-test">
+         <param name="crash.test.name" value="org.jboss.test.messaging.jms.crash.simultaneousfailure.SimultaneousFailureTest"/>
+      </antcall>
+
+
+
+
+      <sleep seconds="120"/>
+
+      <antcall target="stop-rmi-server"/>
+   </target>
+
    <target name="crash-tests" depends="tests-jar, prepare-testdirs, clear-test-logs"
       description="Runs crash tests">
 

Modified: trunk/tests/src/org/jboss/test/messaging/jms/DuplicateClientIDTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/DuplicateClientIDTest.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/tests/src/org/jboss/test/messaging/jms/DuplicateClientIDTest.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -82,6 +82,18 @@
          if (c2 != null) c2.close();
       }
 
+      // This clause was added for http://jira.jboss.org/jira/browse/JBMESSAGING-932
+      // If opening a new connection after closing the previous one... this should work
+      try
+      {
+         c1 = cf.createConnection();
+         c1.setClientID("Duplicated");
+      }
+      finally
+      {
+         if (c1 != null) c1.close();
+      }
+
    }
 
    //http://jira.jboss.com/jira/browse/JBMESSAGING-816
@@ -123,6 +135,24 @@
             c2.close();
          }
       }
+
+      // This clause was added for http://jira.jboss.org/jira/browse/JBMESSAGING-932
+      // If opening a new connection after closing the previous one... this should work
+      try
+      {
+         c1 = cf.createConnection("dilbert", "dogbert");
+         assertNotNull(c1);
+         assertNotNull(c1.getClientID());
+      }
+      finally
+      {
+         if (c1 != null)
+         {
+            c1.close();
+         }
+      }
+
+
    }
 
    public void testNotDuplicateClientID() throws Exception

Modified: trunk/tests/src/org/jboss/test/messaging/jms/JMSTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/JMSTest.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/tests/src/org/jboss/test/messaging/jms/JMSTest.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -127,6 +127,42 @@
       conn.close();
    }
 
+   public void test_CreateTextMessageNull() throws Exception
+   {
+      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
+
+      Queue queue = (Queue)ic.lookup("/queue/JMSTestQueue");
+
+      Connection conn = cf.createConnection();
+
+      Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+      MessageProducer prod = session.createProducer(queue);
+      prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+
+      TextMessage m = session.createTextMessage();
+
+      m.setText("message one");
+
+      prod.send(m);
+
+      conn.close();
+
+      conn = cf.createConnection();
+
+      session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+
+      MessageConsumer cons = session.createConsumer(queue);
+
+      conn.start();
+
+      TextMessage rm = (TextMessage)cons.receive();
+
+      assertEquals("message one", rm.getText());
+
+      conn.close();
+   }
+
    public void test_Persistent_NonTransactional() throws Exception
    {
       ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");

Modified: trunk/tests/src/org/jboss/test/messaging/jms/RemotingConnectionConfigurationTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/RemotingConnectionConfigurationTest.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/tests/src/org/jboss/test/messaging/jms/RemotingConnectionConfigurationTest.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -24,6 +24,7 @@
 import java.lang.reflect.Field;
 import java.net.InetAddress;
 import java.util.Map;
+import java.util.HashSet;
 
 import javax.jms.ConnectionFactory;
 import javax.naming.InitialContext;
@@ -185,7 +186,8 @@
             Map callbackConnectors = (Map)field.get(client);
 
             InvokerCallbackHandler callbackHandler = remotingConnection.getCallbackManager();
-            Connector connector = (Connector)callbackConnectors.get(callbackHandler);
+            HashSet map = (HashSet) callbackConnectors.get(callbackHandler);
+            Connector connector = (Connector)map.iterator().next();
             locator = new InvokerLocator(connector.getInvokerLocator());
             assertEquals(address, locator.getHost());
             assertEquals(freePort, locator.getPort());

Copied: trunk/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure (from rev 2570, branches/Branch_1_2_0_SP/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure)

Deleted: trunk/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/FailingClient.java
===================================================================
--- branches/Branch_1_2_0_SP/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/FailingClient.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/FailingClient.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -1,240 +0,0 @@
-/*
-   * JBoss, Home of Professional Open Source
-   * Copyright 2005, 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.test.messaging.jms.crash.simultaneousfailure;
-
-import org.jboss.test.messaging.tools.ServerManagement;
-import org.jboss.logging.Logger;
-import javax.naming.InitialContext;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.Connection;
-import javax.jms.Session;
-import javax.jms.MessageProducer;
-import javax.jms.MessageConsumer;
-import javax.jms.Topic;
-import javax.jms.TopicSubscriber;
-import javax.jms.TextMessage;
-
-/**
- * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
- * @version <tt>$Revision$</tt>
- *          <p/>
- *          $Id$
- */
-public class FailingClient
-{
-
-   // Constants ------------------------------------------------------------------------------------
-
-   // Attributes -----------------------------------------------------------------------------------
-
-   static InitialContext ic;
-
-   static Logger log = Logger.getLogger(FailingClient.class);
-
-   static ConnectionFactory cf;
-
-   static Topic destination;
-
-   static Object sem = new Object();
-
-   static boolean running = false;
-
-   // Static ---------------------------------------------------------------------------------------
-
-   public static void main(String arg[])
-   {
-      try
-      {
-         ServerManagement.create(0);
-         ServerManagement.deployTopic("Topic");
-         ic = new InitialContext(ServerManagement.getJNDIEnvironment());
-         cf = (ConnectionFactory) ic.lookup("/ConnectionFactory");
-         destination = (Topic) ic.lookup("/topic/Topic");
-
-         ProducerThread producer = new ProducerThread("ProdThread" , cf, destination);
-         producer.start();
-
-         RunningThread threads[] = new RunningThread[20];
-         for (int i = 0; i < threads.length; i++)
-         {
-            threads[i] = new RunningThread("FailingThread" + i , cf, destination);
-         }
-
-         for (int i = 0; i < threads.length; i++)
-         {
-            threads[i].start();
-         }
-
-         Thread.sleep(1000);
-
-         synchronized (sem)
-         {
-            running = true;
-            sem.notifyAll();
-         }
-
-
-         threads[0].join();
-
-      }
-      catch (Exception e)
-      {
-         log.error(e.getMessage(), e);
-      }
-
-
-   }
-
-   // Constructors ---------------------------------------------------------------------------------
-
-   // Public ---------------------------------------------------------------------------------------
-
-   // Package protected ----------------------------------------------------------------------------
-
-   // Protected ------------------------------------------------------------------------------------
-
-   // Private --------------------------------------------------------------------------------------
-
-   // Inner classes --------------------------------------------------------------------------------
-
-   static class RunningThread extends Thread
-   {
-
-      ConnectionFactory cf;
-
-      Topic destination;
-
-      static Logger log = Logger.getLogger(RunningThread.class);
-
-      public RunningThread(String name, ConnectionFactory cf, Topic destination)
-      {
-         super(name);
-         this.cf = cf;
-         this.destination = destination;
-      }
-
-      public RunningThread(ConnectionFactory cf, Topic destination)
-      {
-         super();
-         this.cf = cf;
-         this.destination = destination;
-      }
-
-      public void run()
-      {
-         try
-         {
-            synchronized (sem)
-            {
-               if (!running)
-               {
-                  sem.wait();
-               }
-            }
-            log.info("Destination - " + destination);
-
-            while (true)
-            {
-               Connection conn = null;
-               conn = cf.createConnection();
-               conn.setClientID(Thread.currentThread().getName());
-               Session sess = conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
-               TopicSubscriber subscriber = sess.createDurableSubscriber(destination,
-                  "subscription " + Thread.currentThread().getName());
-               conn.start();
-
-               log.info("Another iteration");
-               for (int i=0;i<10;i++)
-               {
-                  TextMessage tst = (TextMessage)subscriber.receive(10000);
-                  log.info(Thread.currentThread().getName() + " received " + tst.getText());
-               }
-               conn.close();
-
-            }
-         }
-         catch (Exception e)
-         {
-            log.error(e.getMessage(), e);
-         }
-      }
-   }
-
-   static class ProducerThread extends Thread
-   {
-
-      ConnectionFactory cf;
-
-      Topic destination;
-
-      static Logger log = Logger.getLogger(RunningThread.class);
-
-      public ProducerThread(String name, ConnectionFactory cf, Topic destination)
-      {
-         super(name);
-         this.cf = cf;
-         this.destination = destination;
-      }
-
-      public ProducerThread(ConnectionFactory cf, Topic destination)
-      {
-         super();
-         this.cf = cf;
-         this.destination = destination;
-      }
-
-      public void run()
-      {
-         try
-         {
-            synchronized (sem)
-            {
-               if (!running)
-               {
-                  sem.wait();
-               }
-            }
-            log.info("Destination - " + destination);
-
-            Connection conn = null;
-            conn = cf.createConnection();
-            conn.setClientID(Thread.currentThread().getName());
-            Session sess = conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
-            MessageProducer prod = sess.createProducer(destination);
-            conn.start();
-
-            int i=0;
-
-            while (true)
-            {
-               prod.send(sess.createTextMessage("Test " + i++));
-            }
-         }
-         catch (Exception e)
-         {
-            log.error(e.getMessage(), e);
-         }
-      }
-   }
-}

Copied: trunk/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/FailingClient.java (from rev 2570, branches/Branch_1_2_0_SP/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/FailingClient.java)
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/FailingClient.java	                        (rev 0)
+++ trunk/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/FailingClient.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -0,0 +1,240 @@
+/*
+   * JBoss, Home of Professional Open Source
+   * Copyright 2005, 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.test.messaging.jms.crash.simultaneousfailure;
+
+import org.jboss.test.messaging.tools.ServerManagement;
+import org.jboss.logging.Logger;
+import javax.naming.InitialContext;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.Connection;
+import javax.jms.Session;
+import javax.jms.MessageProducer;
+import javax.jms.MessageConsumer;
+import javax.jms.Topic;
+import javax.jms.TopicSubscriber;
+import javax.jms.TextMessage;
+
+/**
+ * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ * @version <tt>$Revision$</tt>
+ *          <p/>
+ *          $Id$
+ */
+public class FailingClient
+{
+
+   // Constants ------------------------------------------------------------------------------------
+
+   // Attributes -----------------------------------------------------------------------------------
+
+   static InitialContext ic;
+
+   static Logger log = Logger.getLogger(FailingClient.class);
+
+   static ConnectionFactory cf;
+
+   static Topic destination;
+
+   static Object sem = new Object();
+
+   static boolean running = false;
+
+   // Static ---------------------------------------------------------------------------------------
+
+   public static void main(String arg[])
+   {
+      try
+      {
+         ServerManagement.create(0);
+         ServerManagement.deployTopic("Topic");
+         ic = new InitialContext(ServerManagement.getJNDIEnvironment());
+         cf = (ConnectionFactory) ic.lookup("/ConnectionFactory");
+         destination = (Topic) ic.lookup("/topic/Topic");
+
+         ProducerThread producer = new ProducerThread("ProdThread" , cf, destination);
+         producer.start();
+
+         RunningThread threads[] = new RunningThread[20];
+         for (int i = 0; i < threads.length; i++)
+         {
+            threads[i] = new RunningThread("FailingThread" + i , cf, destination);
+         }
+
+         for (int i = 0; i < threads.length; i++)
+         {
+            threads[i].start();
+         }
+
+         Thread.sleep(1000);
+
+         synchronized (sem)
+         {
+            running = true;
+            sem.notifyAll();
+         }
+
+
+         threads[0].join();
+
+      }
+      catch (Exception e)
+      {
+         log.error(e.getMessage(), e);
+      }
+
+
+   }
+
+   // Constructors ---------------------------------------------------------------------------------
+
+   // Public ---------------------------------------------------------------------------------------
+
+   // Package protected ----------------------------------------------------------------------------
+
+   // Protected ------------------------------------------------------------------------------------
+
+   // Private --------------------------------------------------------------------------------------
+
+   // Inner classes --------------------------------------------------------------------------------
+
+   static class RunningThread extends Thread
+   {
+
+      ConnectionFactory cf;
+
+      Topic destination;
+
+      static Logger log = Logger.getLogger(RunningThread.class);
+
+      public RunningThread(String name, ConnectionFactory cf, Topic destination)
+      {
+         super(name);
+         this.cf = cf;
+         this.destination = destination;
+      }
+
+      public RunningThread(ConnectionFactory cf, Topic destination)
+      {
+         super();
+         this.cf = cf;
+         this.destination = destination;
+      }
+
+      public void run()
+      {
+         try
+         {
+            synchronized (sem)
+            {
+               if (!running)
+               {
+                  sem.wait();
+               }
+            }
+            log.info("Destination - " + destination);
+
+            while (true)
+            {
+               Connection conn = null;
+               conn = cf.createConnection();
+               conn.setClientID(Thread.currentThread().getName());
+               Session sess = conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
+               TopicSubscriber subscriber = sess.createDurableSubscriber(destination,
+                  "subscription " + Thread.currentThread().getName());
+               conn.start();
+
+               log.info("Another iteration");
+               for (int i=0;i<10;i++)
+               {
+                  TextMessage tst = (TextMessage)subscriber.receive(10000);
+                  log.info(Thread.currentThread().getName() + " received " + tst.getText());
+               }
+               conn.close();
+
+            }
+         }
+         catch (Exception e)
+         {
+            log.error(e.getMessage(), e);
+         }
+      }
+   }
+
+   static class ProducerThread extends Thread
+   {
+
+      ConnectionFactory cf;
+
+      Topic destination;
+
+      static Logger log = Logger.getLogger(RunningThread.class);
+
+      public ProducerThread(String name, ConnectionFactory cf, Topic destination)
+      {
+         super(name);
+         this.cf = cf;
+         this.destination = destination;
+      }
+
+      public ProducerThread(ConnectionFactory cf, Topic destination)
+      {
+         super();
+         this.cf = cf;
+         this.destination = destination;
+      }
+
+      public void run()
+      {
+         try
+         {
+            synchronized (sem)
+            {
+               if (!running)
+               {
+                  sem.wait();
+               }
+            }
+            log.info("Destination - " + destination);
+
+            Connection conn = null;
+            conn = cf.createConnection();
+            conn.setClientID(Thread.currentThread().getName());
+            Session sess = conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
+            MessageProducer prod = sess.createProducer(destination);
+            conn.start();
+
+            int i=0;
+
+            while (true)
+            {
+               prod.send(sess.createTextMessage("Test " + i++));
+            }
+         }
+         catch (Exception e)
+         {
+            log.error(e.getMessage(), e);
+         }
+      }
+   }
+}

Deleted: trunk/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/SimultaneousFailureTest.java
===================================================================
--- branches/Branch_1_2_0_SP/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/SimultaneousFailureTest.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/SimultaneousFailureTest.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -1,214 +0,0 @@
-/*
-   * JBoss, Home of Professional Open Source
-   * Copyright 2005, 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.test.messaging.jms.crash.simultaneousfailure;
-
-import org.jboss.test.messaging.MessagingTestCase;
-import org.jboss.test.messaging.tools.ServerManagement;
-import org.jboss.logging.Logger;
-import javax.naming.InitialContext;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.Connection;
-import javax.jms.Session;
-import javax.jms.MessageProducer;
-import javax.jms.MessageConsumer;
-import javax.jms.Message;
-import javax.jms.Topic;
-import javax.jms.TopicSubscriber;
-import javax.jms.TextMessage;
-
-/**
- * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
- * @version <tt>$Revision$</tt>
- *          $Id$
- */
-public class SimultaneousFailureTest extends MessagingTestCase
-{
-
-   // Constants ------------------------------------------------------------------------------------
-
-   // Attributes -----------------------------------------------------------------------------------
-
-
-   InitialContext ic;
-
-   static Logger log = Logger.getLogger(SimultaneousFailureTest.class);
-
-   ConnectionFactory cf;
-
-   Topic destination;
-
-   static Object sem = new Object();
-
-   static boolean running = false;
-
-   static boolean shouldStop = false;
-
-
-   // Static ---------------------------------------------------------------------------------------
-
-   // Constructors ---------------------------------------------------------------------------------
-
-   public SimultaneousFailureTest(String name)
-   {
-      super(name);
-   }
-
-   // Public ---------------------------------------------------------------------------------------
-
-
-   public void testMultipleConnections() throws Exception
-   {
-
-      RunningThread threads[] = new RunningThread[20];
-      for (int i = 0; i < 20; i++)
-      {
-         threads[i] = new RunningThread("JunitConsumer(" + i + ")", cf, destination);
-      }
-
-      for (int i = 0; i < 20; i++)
-      {
-         threads[i].start();
-      }
-
-      Thread.sleep(1000);
-
-      synchronized (sem)
-      {
-         running = true;
-         sem.notifyAll();
-      }
-
-
-      Thread.sleep(300000);
-      synchronized (sem)
-      {
-         shouldStop=true;
-      }
-
-
-      for (int i = 0; i < 20; i++)
-      {
-         threads[i].join();
-      }
-   }
-
-   // Package protected ----------------------------------------------------------------------------
-
-   // Protected ------------------------------------------------------------------------------------
-
-   protected void setUp() throws Exception
-   {
-      super.setUp();
-
-      ServerManagement.create(0);
-      //ServerManagement.deployQueue("Queue");
-      ic = new InitialContext(ServerManagement.getJNDIEnvironment());
-      cf = (ConnectionFactory) ic.lookup("/ConnectionFactory");
-      destination = (Topic) ic.lookup("/topic/Topic");
-      running = false;
-   }
-
-   protected void tearDown() throws Exception
-   {
-      super.tearDown();
-   }
-
-
-   // Private --------------------------------------------------------------------------------------
-
-   // Inner classes --------------------------------------------------------------------------------
-
-
-   static class RunningThread extends Thread
-   {
-
-      ConnectionFactory cf;
-
-      Topic destination;
-
-      static Logger log = Logger.getLogger(RunningThread.class);
-
-      public RunningThread(String name, ConnectionFactory cf, Topic destination)
-      {
-         super(name);
-         this.cf = cf;
-         this.destination = destination;
-      }
-
-      public RunningThread(ConnectionFactory cf, Topic destination)
-      {
-         super();
-         this.cf = cf;
-         this.destination = destination;
-      }
-
-      public void run()
-      {
-         try
-         {
-            synchronized (sem)
-            {
-               if (!running)
-               {
-                  sem.wait();
-               }
-            }
-            log.info("Destination - " + destination);
-
-            while (true)
-            {
-               synchronized (sem)
-               {
-                  if (shouldStop)
-                  {
-                     break;
-                  }
-               }
-               Connection conn = null;
-               conn = cf.createConnection();
-               conn.setClientID(Thread.currentThread().getName());
-               Session sess = conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
-               TopicSubscriber subscriber = sess.createDurableSubscriber(destination,
-                  "subscription " + Thread.currentThread().getName());
-               conn.start();
-
-               log.info("Another iteration");
-               for (int i=0;i<10;i++)
-               {
-                  TextMessage tst = (TextMessage)subscriber.receive(10000);
-                  log.info(Thread.currentThread().getName() + " received " + tst.getText());
-               }
-               conn.close();
-
-            }
-         }
-         catch (Exception e)
-         {
-            log.error(e.getMessage(), e);
-         }
-      }
-   }
-
-
-}

Copied: trunk/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/SimultaneousFailureTest.java (from rev 2570, branches/Branch_1_2_0_SP/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/SimultaneousFailureTest.java)
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/SimultaneousFailureTest.java	                        (rev 0)
+++ trunk/tests/src/org/jboss/test/messaging/jms/crash/simultaneousfailure/SimultaneousFailureTest.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -0,0 +1,214 @@
+/*
+   * JBoss, Home of Professional Open Source
+   * Copyright 2005, 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.test.messaging.jms.crash.simultaneousfailure;
+
+import org.jboss.test.messaging.MessagingTestCase;
+import org.jboss.test.messaging.tools.ServerManagement;
+import org.jboss.logging.Logger;
+import javax.naming.InitialContext;
+import javax.jms.ConnectionFactory;
+import javax.jms.Destination;
+import javax.jms.Connection;
+import javax.jms.Session;
+import javax.jms.MessageProducer;
+import javax.jms.MessageConsumer;
+import javax.jms.Message;
+import javax.jms.Topic;
+import javax.jms.TopicSubscriber;
+import javax.jms.TextMessage;
+
+/**
+ * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ * @version <tt>$Revision$</tt>
+ *          $Id$
+ */
+public class SimultaneousFailureTest extends MessagingTestCase
+{
+
+   // Constants ------------------------------------------------------------------------------------
+
+   // Attributes -----------------------------------------------------------------------------------
+
+
+   InitialContext ic;
+
+   static Logger log = Logger.getLogger(SimultaneousFailureTest.class);
+
+   ConnectionFactory cf;
+
+   Topic destination;
+
+   static Object sem = new Object();
+
+   static boolean running = false;
+
+   static boolean shouldStop = false;
+
+
+   // Static ---------------------------------------------------------------------------------------
+
+   // Constructors ---------------------------------------------------------------------------------
+
+   public SimultaneousFailureTest(String name)
+   {
+      super(name);
+   }
+
+   // Public ---------------------------------------------------------------------------------------
+
+
+   public void testMultipleConnections() throws Exception
+   {
+
+      RunningThread threads[] = new RunningThread[20];
+      for (int i = 0; i < 20; i++)
+      {
+         threads[i] = new RunningThread("JunitConsumer(" + i + ")", cf, destination);
+      }
+
+      for (int i = 0; i < 20; i++)
+      {
+         threads[i].start();
+      }
+
+      Thread.sleep(1000);
+
+      synchronized (sem)
+      {
+         running = true;
+         sem.notifyAll();
+      }
+
+
+      Thread.sleep(300000);
+      synchronized (sem)
+      {
+         shouldStop=true;
+      }
+
+
+      for (int i = 0; i < 20; i++)
+      {
+         threads[i].join();
+      }
+   }
+
+   // Package protected ----------------------------------------------------------------------------
+
+   // Protected ------------------------------------------------------------------------------------
+
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+
+      ServerManagement.create(0);
+      //ServerManagement.deployQueue("Queue");
+      ic = new InitialContext(ServerManagement.getJNDIEnvironment());
+      cf = (ConnectionFactory) ic.lookup("/ConnectionFactory");
+      destination = (Topic) ic.lookup("/topic/Topic");
+      running = false;
+   }
+
+   protected void tearDown() throws Exception
+   {
+      super.tearDown();
+   }
+
+
+   // Private --------------------------------------------------------------------------------------
+
+   // Inner classes --------------------------------------------------------------------------------
+
+
+   static class RunningThread extends Thread
+   {
+
+      ConnectionFactory cf;
+
+      Topic destination;
+
+      static Logger log = Logger.getLogger(RunningThread.class);
+
+      public RunningThread(String name, ConnectionFactory cf, Topic destination)
+      {
+         super(name);
+         this.cf = cf;
+         this.destination = destination;
+      }
+
+      public RunningThread(ConnectionFactory cf, Topic destination)
+      {
+         super();
+         this.cf = cf;
+         this.destination = destination;
+      }
+
+      public void run()
+      {
+         try
+         {
+            synchronized (sem)
+            {
+               if (!running)
+               {
+                  sem.wait();
+               }
+            }
+            log.info("Destination - " + destination);
+
+            while (true)
+            {
+               synchronized (sem)
+               {
+                  if (shouldStop)
+                  {
+                     break;
+                  }
+               }
+               Connection conn = null;
+               conn = cf.createConnection();
+               conn.setClientID(Thread.currentThread().getName());
+               Session sess = conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
+               TopicSubscriber subscriber = sess.createDurableSubscriber(destination,
+                  "subscription " + Thread.currentThread().getName());
+               conn.start();
+
+               log.info("Another iteration");
+               for (int i=0;i<10;i++)
+               {
+                  TextMessage tst = (TextMessage)subscriber.receive(10000);
+                  log.info(Thread.currentThread().getName() + " received " + tst.getText());
+               }
+               conn.close();
+
+            }
+         }
+         catch (Exception e)
+         {
+            log.error(e.getMessage(), e);
+         }
+      }
+   }
+
+
+}

Modified: trunk/tests/src/org/jboss/test/messaging/jms/message/ObjectMessageTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/message/ObjectMessageTest.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/tests/src/org/jboss/test/messaging/jms/message/ObjectMessageTest.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -24,33 +24,40 @@
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.ObjectMessage;
+import javax.jms.DeliveryMode;
 
 import org.jboss.test.messaging.jms.message.base.MessageTestBase;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.StringTokenizer;
 
 /**
  * A test that sends/receives object messages to the JMS provider and verifies their integrity.
  *
  * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
+ * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
  * @version <tt>$Revision$</tt>
  *
  * $Id$
  */
 public class ObjectMessageTest extends MessageTestBase
 {
-   // Constants -----------------------------------------------------
+   // Constants ------------------------------------------------------------------------------------
 
-   // Static --------------------------------------------------------
+   // Static ---------------------------------------------------------------------------------------
    
-   // Attributes ----------------------------------------------------
+   // Attributes -----------------------------------------------------------------------------------
 
-   // Constructors --------------------------------------------------
+   // Constructors ---------------------------------------------------------------------------------
 
    public ObjectMessageTest(String name)
    {
       super(name);
    }
 
-   // Public --------------------------------------------------------
+   // Public ---------------------------------------------------------------------------------------
 
    public void setUp() throws Exception
    {
@@ -64,8 +71,49 @@
       super.tearDown();
    }
 
-   // Protected -----------------------------------------------------
 
+   public void testClassLoaderIsolation() throws Exception
+   {
+
+      ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();
+      try
+      {
+         queueProd.setDeliveryMode(DeliveryMode.PERSISTENT);
+
+         ObjectMessage om = (ObjectMessage) message;
+
+         SomeObject testObject = new SomeObject(3, 7);
+
+         ClassLoader testClassLoader = newClassLoader(testObject.getClass());
+
+         om.setObject(testObject);
+
+         queueProd.send(message);
+
+         Thread.currentThread().setContextClassLoader(testClassLoader);
+
+         ObjectMessage r = (ObjectMessage) queueCons.receive();
+
+         Object testObject2 = r.getObject();
+
+         assertEquals("org.jboss.test.messaging.jms.message.SomeObject",
+            testObject2.getClass().getName());
+         assertNotSame(testObject, testObject2);
+         assertNotSame(testObject.getClass(), testObject2.getClass());
+         assertNotSame(testObject.getClass().getClassLoader(),
+            testObject2.getClass().getClassLoader());
+         assertSame(testClassLoader,
+            testObject2.getClass().getClassLoader());
+      }
+      finally
+      {
+         Thread.currentThread().setContextClassLoader(originalClassLoader);
+      }
+
+   }
+
+   // Protected ------------------------------------------------------------------------------------
+
    protected void prepareMessage(Message m) throws JMSException
    {
       super.prepareMessage(m);
@@ -82,4 +130,40 @@
       ObjectMessage om = (ObjectMessage)m;
       assertEquals("this is the serializable object", om.getObject());
    }
+
+   protected static ClassLoader newClassLoader(Class anyUserClass) throws Exception
+   {
+      URL classLocation = anyUserClass.getProtectionDomain().getCodeSource().getLocation();
+      StringTokenizer tokenString = new StringTokenizer(System.getProperty("java.class.path"),
+         File.pathSeparator);
+      String pathIgnore = System.getProperty("java.home");
+      if (pathIgnore == null)
+      {
+         pathIgnore = classLocation.toString();
+      }
+
+      ArrayList urls = new ArrayList();
+      while (tokenString.hasMoreElements())
+      {
+         String value = tokenString.nextToken();
+         URL itemLocation = new File(value).toURL();
+         if (!itemLocation.equals(classLocation) &&
+                      itemLocation.toString().indexOf(pathIgnore) >= 0)
+         {
+            //System.out.println("Location:" + itemLocation);
+            urls.add(itemLocation);
+         }
+      }
+
+      URL[] urlArray = (URL[]) urls.toArray(new URL[urls.size()]);
+
+      ClassLoader masterClassLoader = URLClassLoader.newInstance(urlArray, null);
+
+
+      ClassLoader appClassLoader = URLClassLoader.newInstance(new URL[]{classLocation},
+                                      masterClassLoader);
+
+      return appClassLoader;
+   }
+
 }

Copied: trunk/tests/src/org/jboss/test/messaging/jms/message/SomeObject.java (from rev 2570, branches/Branch_1_2_0_SP/tests/src/org/jboss/test/messaging/jms/message/SomeObject.java)
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/message/SomeObject.java	                        (rev 0)
+++ trunk/tests/src/org/jboss/test/messaging/jms/message/SomeObject.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -0,0 +1,85 @@
+/*
+   * JBoss, Home of Professional Open Source
+   * Copyright 2005, 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.test.messaging.jms.message;
+
+import java.io.Serializable;
+
+/**
+ * ObjectMessageTest needed a simple class to test ClassLoadingIsolations
+ * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ * @version <tt>$Revision$</tt>
+ *
+ *  $Id$
+ */
+public class SomeObject implements Serializable
+{
+
+   // Constants ------------------------------------------------------------------------------------
+
+   // Attributes -----------------------------------------------------------------------------------
+
+   int i;
+   int j;
+
+   // Static ---------------------------------------------------------------------------------------
+
+   // Constructors ---------------------------------------------------------------------------------
+
+   public SomeObject(int i, int j)
+   {
+      this.i=i;
+      this.j=j;
+   }
+
+   // Public ---------------------------------------------------------------------------------------
+
+   public boolean equals(Object o)
+   {
+      if (this == o) return true;
+      if (o == null || getClass() != o.getClass()) return false;
+
+      SomeObject that = (SomeObject) o;
+
+      if (i != that.i) return false;
+      if (j != that.j) return false;
+
+      return true;
+   }
+
+   public int hashCode()
+   {
+      int result;
+      result = i;
+      result = 31 * result + j;
+      return result;
+   }
+
+   // Package protected ----------------------------------------------------------------------------
+
+   // Protected ------------------------------------------------------------------------------------
+
+   // Private --------------------------------------------------------------------------------------
+
+   // Inner classes --------------------------------------------------------------------------------
+
+}

Modified: trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/RMITestServer.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/RMITestServer.java	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/RMITestServer.java	2007-04-11 16:38:25 UTC (rev 2571)
@@ -117,6 +117,23 @@
       }
 
       log.info("RMI server " + serverIndex + " bound");
+
+      // there is one crash test that needs to start the server, as an external VM...
+      // as one client will crash while another will be alive
+      boolean startAll=false;
+
+      for (int i=0;i<args.length;i++)
+      {
+         if (args[i].equals("-startAll"))
+         {
+            startAll=true;
+         }
+      }
+
+      if (startAll)
+      {
+         testServer.start("all", true);
+      }
    }
 
    // Attributes ----------------------------------------------------

Modified: trunk/util/release-admin.xml
===================================================================
--- trunk/util/release-admin.xml	2007-04-11 10:13:38 UTC (rev 2570)
+++ trunk/util/release-admin.xml	2007-04-11 16:38:25 UTC (rev 2571)
@@ -192,6 +192,13 @@
       </condition>
       <antcall target="expand-jar"/>
       <antcall target="expand-sar"/>
+
+      <move todir="${jboss.home}/server/${config.name}/conf">
+          <fileset dir="${jboss.home}/server/${config.name}/deploy/jboss-messaging.sar">
+             <include name="messaging-*.properties"/>
+          </fileset>
+       </move>
+
    </target>
 
    <target name="expand-sar" if="is.sar">




More information about the jboss-cvs-commits mailing list