activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1412899 - in /activemq/trunk/activemq-web-console/src: main/java/org/apache/activemq/web/filter/ApplicationContextFilter.java test/java/org/apache/activemq/web/tool/Main.java
Date Fri, 23 Nov 2012 14:19:25 GMT
Author: gtully
Date: Fri Nov 23 14:19:24 2012
New Revision: 1412899

URL: http://svn.apache.org/viewvc?rev=1412899&view=rev
Log:
ensure connection/authentication errors with broker facade end up in the log as referenced
by our 500 page

Modified:
    activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/filter/ApplicationContextFilter.java
    activemq/trunk/activemq-web-console/src/test/java/org/apache/activemq/web/tool/Main.java

Modified: activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/filter/ApplicationContextFilter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/filter/ApplicationContextFilter.java?rev=1412899&r1=1412898&r2=1412899&view=diff
==============================================================================
--- activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/filter/ApplicationContextFilter.java
(original)
+++ activemq/trunk/activemq-web-console/src/main/java/org/apache/activemq/web/filter/ApplicationContextFilter.java
Fri Nov 23 14:19:24 2012
@@ -33,6 +33,8 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.activemq.web.BrokerFacade;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.web.bind.ServletRequestDataBinder;
 import org.springframework.web.context.WebApplicationContext;
 import org.springframework.web.context.support.WebApplicationContextUtils;
@@ -58,6 +60,7 @@ import org.springframework.web.context.s
  * 
  */
 public class ApplicationContextFilter implements Filter {
+    private static final transient Logger LOG = LoggerFactory.getLogger(ApplicationContextFilter.class);
 
     private ServletContext servletContext;
     private String applicationContextName = "applicationContext";
@@ -83,12 +86,16 @@ public class ApplicationContextFilter im
         String path = ((HttpServletRequest)request).getRequestURI();
         // handle slave brokers
         try {
-            if (((BrokerFacade)requestContextWrapper.get("brokerQuery")).isSlave()
-                    && (!(path.endsWith("css") || path.endsWith("png")) &&
!path.endsWith(slavePage))) {
+            if ( !(path.endsWith("css") || path.endsWith("png") || path.endsWith("ico") ||
path.endsWith(slavePage))
+                    && ((BrokerFacade)requestContextWrapper.get("brokerQuery")).isSlave())
{
                 ((HttpServletResponse)response).sendRedirect(slavePage);
                 return;
             }
         } catch (Exception e) {
+            LOG.warn(path + ", failed to access BrokerFacade: reason: " + e.getLocalizedMessage());
+            if (LOG.isDebugEnabled()) {
+                LOG.debug(request.toString(), e);
+            }
             throw new IOException(e);
         }
         request.setAttribute(requestContextName, requestContextWrapper);

Modified: activemq/trunk/activemq-web-console/src/test/java/org/apache/activemq/web/tool/Main.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-web-console/src/test/java/org/apache/activemq/web/tool/Main.java?rev=1412899&r1=1412898&r2=1412899&view=diff
==============================================================================
--- activemq/trunk/activemq-web-console/src/test/java/org/apache/activemq/web/tool/Main.java
(original)
+++ activemq/trunk/activemq-web-console/src/test/java/org/apache/activemq/web/tool/Main.java
Fri Nov 23 14:19:24 2012
@@ -51,6 +51,11 @@ public final class Main {
         SelectChannelConnector connector = new SelectChannelConnector();
         connector.setPort(port);
         connector.setServer(server);
+
+        //System.setProperty("webconsole.type","properties");
+        //System.setProperty("webconsole.jms.url","tcp://localhost:61616");
+        //System.setProperty("webconsole.jmx.url","service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-root");
+
         WebAppContext context = new WebAppContext();
 
         context.setResourceBase(WEBAPP_DIR);



Mime
View raw message