synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asan...@apache.org
Subject svn commit: r609110 - /webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseAxisServlet.java
Date Sat, 05 Jan 2008 09:21:49 GMT
Author: asankha
Date: Sat Jan  5 01:21:32 2008
New Revision: 609110

URL: http://svn.apache.org/viewvc?rev=609110&view=rev
Log:
fix SYNAPSE-222 by applying patch submitted by  Andreas Veithen

Modified:
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseAxisServlet.java

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseAxisServlet.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseAxisServlet.java?rev=609110&r1=609109&r2=609110&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseAxisServlet.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseAxisServlet.java
Sat Jan  5 01:21:32 2008
@@ -18,8 +18,13 @@
  */
 package org.apache.synapse.core.axis2;
 
+import java.lang.reflect.Field;
+
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.transport.http.AxisServlet;
+import org.apache.axis2.transport.http.ListingAgent;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.ServerManager;
 
 import javax.servlet.ServletConfig;
@@ -32,8 +37,8 @@
  */
 
 public class SynapseAxisServlet extends AxisServlet {
-
-
+    private final static Log log = LogFactory.getLog(SynapseAxisServlet.class);
+    
     /**
      * Overrides init method so that avoid  starting listeners again
      *
@@ -46,6 +51,18 @@
         this.axisConfiguration = this.configContext.getAxisConfiguration();
         servletContext.setAttribute(this.getClass().getName(), this);
         this.servletConfig = config;
+        
+        // Initialize the agent field. Since it is declared private, we need to do
+        // it using reflection.
+        try {
+            Field agentField = AxisServlet.class.getDeclaredField("agent");
+            agentField.setAccessible(true);
+            agentField.set(this, new ListingAgent(configContext));
+        }
+        catch (Throwable ex) {
+        	log.warn("Unable to initialize AxisServlet#agent. Published WSDL documents may be
inaccessible.");
+        }
+        
         initParams();
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Mime
View raw message