From f32792a9fca6a9655f4cf79c7272821e8a468ac6 Mon Sep 17 00:00:00 2001 From: "Timothy A. Bish" Date: Tue, 20 Mar 2012 13:36:10 +0000 Subject: [PATCH] fix for: https://issues.apache.org/jira/browse/AMQ-3776 git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1302883 13f79535-47bb-0310-9956-ffa450edef68 --- .../activemq/web/MessageListenerServlet.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/activemq-web/src/main/java/org/apache/activemq/web/MessageListenerServlet.java b/activemq-web/src/main/java/org/apache/activemq/web/MessageListenerServlet.java index 0f92529bcd..1ee0829e87 100644 --- a/activemq-web/src/main/java/org/apache/activemq/web/MessageListenerServlet.java +++ b/activemq-web/src/main/java/org/apache/activemq/web/MessageListenerServlet.java @@ -19,7 +19,13 @@ package org.apache.activemq.web; import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; -import java.util.*; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Timer; +import java.util.TimerTask; import javax.jms.Destination; import javax.jms.JMSException; @@ -34,10 +40,10 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.activemq.MessageAvailableConsumer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.eclipse.jetty.continuation.Continuation; import org.eclipse.jetty.continuation.ContinuationSupport; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A servlet for sending and receiving messages to/from JMS destinations using @@ -436,8 +442,9 @@ public class MessageListenerServlet extends MessageServletSupport { } String sessionKey = session.getId() + '-' + clientId; - AjaxWebClient client = ajaxWebClients.get( sessionKey ); + AjaxWebClient client = null; synchronized (ajaxWebClients) { + client = ajaxWebClients.get( sessionKey ); // create a new AjaxWebClient if one does not already exist for this sessionKey. if( client == null ) { if (LOG.isDebugEnabled()) {