You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/02/13 14:56:35 UTC

cvs commit: jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger/tool Caller.java Consumer.java Producer.java

jstrachan    02/02/13 05:56:35

  Modified:    messenger build.properties.sample
               messenger/src/conf SpiritWave.xml
               messenger/src/java/org/apache/commons/messenger
                        MessengerManager.java
               messenger/src/java/org/apache/commons/messenger/tool
                        Caller.java Consumer.java Producer.java
  Log:
  Added better diagnostics so that underlying exceptions are reported better if a JMS connection cannot be established.
  
  Revision  Changes    Path
  1.13      +2 -2      jakarta-commons-sandbox/messenger/build.properties.sample
  
  Index: build.properties.sample
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/build.properties.sample,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- build.properties.sample	30 Oct 2001 08:30:09 -0000	1.12
  +++ build.properties.sample	13 Feb 2002 13:56:34 -0000	1.13
  @@ -2,9 +2,9 @@
   # Compile-time dependencies
   #
   
  -jms.jar=/jpackages/jms1.0.2b/lib/jms.jar
  +jms.jar=/java/jms/jms.jar
   
  -servlet.jar=../../lib/servlet.jar
  +servlet.jar=/java/servlet/servlet.jar
   
   # jakarta commons-digester.jar
   commons-digester.jar=../../jakarta-commons/digester/dist/commons-digester.jar
  
  
  
  1.2       +0 -17     jakarta-commons-sandbox/messenger/src/conf/SpiritWave.xml
  
  Index: SpiritWave.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/conf/SpiritWave.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SpiritWave.xml	30 Oct 2001 08:30:09 -0000	1.1
  +++ SpiritWave.xml	13 Feb 2002 13:56:34 -0000	1.2
  @@ -1,21 +1,12 @@
   <?xml version="1.0" encoding="UTF-8"?>
   <manager>
   
  -  <!-- Embedded JMQ daemons -->
     <messenger name="topic">
       <factory className="com.spirit.messenger.WaveTopicSessionFactory">
         <property>
           <name>driverName</name>
           <value>SpiritJMQ</value>
         </property>          
  -      <property>
  -        <name>messageChannels</name>	
  -        <value>stream://localhost:3345</value>
  -      </property>          
  -      <property>
  -        <name>dispatchThreadPerConnection</name>	
  -        <value>true</value>
  -      </property>          
       </factory>
     </messenger>
   
  @@ -24,14 +15,6 @@
         <property>
           <name>driverName</name>
           <value>SpiritJMQ</value>
  -      </property>          
  -      <property>
  -        <name>messageChannels</name>	
  -        <value>stream://localhost:3345</value>
  -      </property>          
  -      <property>
  -        <name>dispatchThreadPerConnection</name>	
  -        <value>true</value>
         </property>          
       </factory>
     </messenger>
  
  
  
  1.6       +6 -3      jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger/MessengerManager.java
  
  Index: MessengerManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger/MessengerManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MessengerManager.java	1 Feb 2002 14:32:33 -0000	1.5
  +++ MessengerManager.java	13 Feb 2002 13:56:34 -0000	1.6
  @@ -5,7 +5,7 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE file.
    * 
  - * $Id: MessengerManager.java,v 1.5 2002/02/01 14:32:33 jstrachan Exp $
  + * $Id: MessengerManager.java,v 1.6 2002/02/13 13:56:34 jstrachan Exp $
    */
   package org.apache.commons.messenger;
   
  @@ -19,7 +19,7 @@
   /** <p><code>MessengerManager</code> is a manager of {@link Messenger} instances.</p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.5 $
  +  * @version $Revision: 1.6 $
     */
   public class MessengerManager {
       
  @@ -51,7 +51,10 @@
               return (MessengerManager) digester.parse( xmlURL );
           }
           catch (Exception e) {
  -            JMSException newException = new JMSException( "Could not load the Messenger XML config file from: " + xmlURL );
  +            JMSException newException = new JMSException( 
  +                "Could not load the Messenger XML config file from: " + xmlURL 
  +                + ". Underlying reason: " + e 
  +            );
               newException.setLinkedException(e);
               throw newException;
           }
  
  
  
  1.2       +12 -1     jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger/tool/Caller.java
  
  Index: Caller.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger/tool/Caller.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Caller.java	25 Oct 2001 21:45:04 -0000	1.1
  +++ Caller.java	13 Feb 2002 13:56:35 -0000	1.2
  @@ -5,7 +5,7 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE file.
    * 
  - * $Id: Caller.java,v 1.1 2001/10/25 21:45:04 jstrachan Exp $
  + * $Id: Caller.java,v 1.2 2002/02/13 13:56:35 jstrachan Exp $
    */
   package org.apache.commons.messenger.tool;
   
  @@ -33,7 +33,7 @@
     * sends a message to a destination and waits for a response.</p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.1 $
  +  * @version $Revision: 1.2 $
     */
   public class Caller extends Producer {
   
  @@ -41,6 +41,17 @@
           try {
               Caller client = new Caller();
               client.run( args );
  +        }
  +        catch (JMSException e) {
  +            System.out.println( "Caught: " + e );
  +            Exception linked = e.getLinkedException();
  +            if ( linked != null ) {
  +                System.out.println( "Underlying exception: " + linked );
  +                linked.printStackTrace();
  +            }
  +            else {
  +                e.printStackTrace();
  +            }
           }
           catch (Exception e) {
               System.out.println( "Caught: " + e );
  
  
  
  1.2       +13 -2     jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger/tool/Consumer.java
  
  Index: Consumer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger/tool/Consumer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Consumer.java	25 Oct 2001 20:31:41 -0000	1.1
  +++ Consumer.java	13 Feb 2002 13:56:35 -0000	1.2
  @@ -5,7 +5,7 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE file.
    * 
  - * $Id: Consumer.java,v 1.1 2001/10/25 20:31:41 jstrachan Exp $
  + * $Id: Consumer.java,v 1.2 2002/02/13 13:56:35 jstrachan Exp $
    */
   package org.apache.commons.messenger.tool;
   
  @@ -29,7 +29,7 @@
     * either stanard output or a named file.</p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.1 $
  +  * @version $Revision: 1.2 $
     */
   public class Consumer {
   
  @@ -39,6 +39,17 @@
           try {
               Consumer client = new Consumer();
               client.run( args );
  +        }
  +        catch (JMSException e) {
  +            System.out.println( "Caught: " + e );
  +            Exception linked = e.getLinkedException();
  +            if ( linked != null ) {
  +                System.out.println( "Underlying exception: " + linked );
  +                linked.printStackTrace();
  +            }
  +            else {
  +                e.printStackTrace();
  +            }
           }
           catch (Exception e) {
               System.out.println( "Caught: " + e );
  
  
  
  1.3       +13 -2     jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger/tool/Producer.java
  
  Index: Producer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger/tool/Producer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Producer.java	25 Oct 2001 21:45:04 -0000	1.2
  +++ Producer.java	13 Feb 2002 13:56:35 -0000	1.3
  @@ -5,7 +5,7 @@
    * version 1.1, a copy of which has been included with this distribution in
    * the LICENSE file.
    * 
  - * $Id: Producer.java,v 1.2 2001/10/25 21:45:04 jstrachan Exp $
  + * $Id: Producer.java,v 1.3 2002/02/13 13:56:35 jstrachan Exp $
    */
   package org.apache.commons.messenger.tool;
   
  @@ -29,7 +29,7 @@
     * could either be a queue or a topc.</p>
     *
     * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  -  * @version $Revision: 1.2 $
  +  * @version $Revision: 1.3 $
     */
   public class Producer {
   
  @@ -39,6 +39,17 @@
           try {
               Producer client = new Producer();
               client.run( args );
  +        }
  +        catch (JMSException e) {
  +            System.out.println( "Caught: " + e );
  +            Exception linked = e.getLinkedException();
  +            if ( linked != null ) {
  +                System.out.println( "Underlying exception: " + linked );
  +                linked.printStackTrace();
  +            }
  +            else {
  +                e.printStackTrace();
  +            }
           }
           catch (Exception e) {
               System.out.println( "Caught: " + e );
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>