[
http://issues.apache.org/jira/browse/AXIS-2190?page=comments#action_12319740 ]
Jason Sweeney commented on AXIS-2190:
-------------------------------------
Hi, there were three types of CVS diff available from the plug-in in Eclipse:
Unified, Context and Standard. I picked the default one (Unified). If you
need another one, its no problem to regenerate the file.
Index: EngineConfigurationFactoryServlet.java
===================================================================
RCS file:
/home/cvspublic/ws-axis/java/src/org/apache/axis/configuration/EngineConfigurationFactoryServlet.java,v
retrieving revision 1.25
diff -u -r1.25 EngineConfigurationFactoryServlet.java
--- EngineConfigurationFactoryServlet.java 2 Feb 2005 13:39:08 -0000
1.25
+++ EngineConfigurationFactoryServlet.java 23 Aug 2005 16:25:35 -0000
@@ -92,31 +92,50 @@
/**
* Get a default server engine configuration.
+ * Delegate the override implementation to a generic process
+ * ref. http://issues.apache.org/jira/browse/AXIS-2190
*
* @return a server EngineConfiguration
*/
public EngineConfiguration getServerEngineConfig() {
- return getServerEngineConfig(cfg);
+ return getServletEngineConfig(cfg, OPTION_SERVER_CONFIG_FILE,
SERVER_CONFIG_FILE);
}
/**
- * Get a default server engine configuration in a servlet environment.
+ * Get a default client engine configuration.
+ * Override the default implementation for the client configurations
+ * ref. http://issues.apache.org/jira/browse/AXIS-2190
*
- * @param ctx a ServletContext
- * @return a server EngineConfiguration
+ * @return a client EngineConfiguration
+ */
+ public EngineConfiguration getClientEngineConfig() {
+ return getServletEngineConfig(cfg, OPTION_CLIENT_CONFIG_FILE,
CLIENT_CONFIG_FILE);
+ }
+
+ /**
+ * Get a default engine configuration in a servlet environment.
+ * Make this function generic for both the server and client configurations
+ * ref. http://issues.apache.org/jira/browse/AXIS-2190
+ *
+ * @param cfg a ServletConfig
+ * @param pOptionName configuration file name option
+ * @param pConfigFile configuration file name
+ * @return an EngineConfiguration
*/
private static
- EngineConfiguration getServerEngineConfig(ServletConfig cfg) {
+ EngineConfiguration getServletEngineConfig(
+ ServletConfig cfg, String pOptionName, String pConfigFile)
+ {
ServletContext ctx = cfg.getServletContext();
// Respect the system property setting for a different config file
- String configFile = cfg.getInitParameter(OPTION_SERVER_CONFIG_FILE);
+ String configFile = cfg.getInitParameter(pOptionName);
if (configFile == null)
configFile =
- AxisProperties.getProperty(OPTION_SERVER_CONFIG_FILE);
+ AxisProperties.getProperty(pOptionName);
if (configFile == null) {
- configFile = SERVER_CONFIG_FILE;
+ configFile = pConfigFile;
}
/**
@@ -185,7 +204,7 @@
try {
InputStream is =
ClassUtils.getResourceAsStream(AxisServer.class,
- SERVER_CONFIG_FILE);
+ pConfigFile);
config = new FileProvider(is);
} catch (Exception e) {
log.error(Messages.getMessage("servletEngineWebInfError02"),
e);
> Configuration file location process different for client and server files
> -------------------------------------------------------------------------
>
> Key: AXIS-2190
> URL: http://issues.apache.org/jira/browse/AXIS-2190
> Project: Apache Axis
> Type: Bug
> Components: Basic Architecture
> Versions: 1.2.1
> Environment: Not necessary for the issue
> Reporter: Jason Sweeney
>
> When using the Axis client component within a web application, the
> client-config.xml file is usually placed in the same location as the
> server-config.xml file (if a server is also used). As a result, Axis should
> follow the same process to locate the client configuration file as for the
> server file (in particular, check the WEB-INF folder of the web application).
> Patch to correct the problem (basically making the server configuration file
> function generic):
> File: org\apache\axis\configuration\EngineConfigurationFactoryServlet.java
> Replace lines 93 to 120 (getServerEngineConfig() and start of
> getServerEngineConfig(ServletConfig cfg)) by this code
> ------------------------------------------------------------------------------------------------------------------
> /**
> * Get a default server engine configuration.
> *
> * @return a server EngineConfiguration
> */
> public EngineConfiguration getServerEngineConfig() {
> return getServletEngineConfig(cfg, OPTION_SERVER_CONFIG_FILE,
> SERVER_CONFIG_FILE);
> }
> /**
> * Get a default client engine configuration.
> *
> * @return a client EngineConfiguration
> */
> public EngineConfiguration getClientEngineConfig() {
> return getServletEngineConfig(cfg, OPTION_CLIENT_CONFIG_FILE,
> CLIENT_CONFIG_FILE);
> }
> /**
> * Get a default engine configuration in a servlet environment.
> *
> * @param cfg a ServletConfig
> * @param pOptionName configuration file name option
> * @param pConfigFile configuration file name
> * @return an EngineConfiguration
> */
> private static
> EngineConfiguration getServerEngineConfig(
> ServletConfig cfg, String pOptionName, String pConfigFile)
> {
>
> ServletContext ctx = cfg.getServletContext();
>
> // Respect the system property setting for a different config file
> String configFile = cfg.getInitParameter(pOptionName);
> if (configFile == null)
> configFile =
> AxisProperties.getProperty(pOptionName);
> if (configFile == null) {
> configFile = pConfigFile;
> }
> ------------------------------------------------------------------------------------------------------------------
> Replace lines 186 to 188 (at the end of getServerEngineConfig(ServletConfig
> cfg)) by this code
> ------------------------------------------------------------------------------------------------------------------
> InputStream is =
> ClassUtils.getResourceAsStream(AxisServer.class,
> pConfigFile);
> ------------------------------------------------------------------------------------------------------------------
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira