Details
Description
Cannot find XmlRpcServlet.properties file in war when packaged it in ear.
Workaround:
-------------------
You have to extend the original org.apache.xmlrpc.webserver.XmlRpcServlet class and overwrite newXmlRpcHandlerMapping() method. After it you may use your new class file in web.xml instead of the original org.apache.xmlrpc.webserver.XmlRpcServlet class.
MyXmlRpcServlet.java:
public class MyXmlRpcServlet extends org.apache.xmlrpc.webserver.XmlRpcServlet
{
@Override
protected XmlRpcHandlerMapping newXmlRpcHandlerMapping() throws XmlRpcException
{
String packageName = this.getClass().getPackage().getName().replaceAll("
.", "/");
String realPath = "/WEB-INF/classes/" + packageName + "/XmlRpcServlet.properties";
try
{
URL url = this.getServletContext().getResource(realPath);
if (url == null)
return newPropertyHandlerMapping(url);
}
catch (IOException e)
}
}
web.xml:
<servlet>
<servlet-name>XmlRpcServlet</servlet-name>
<servlet-class>com.remal.xmlrpc.webserver.MyXmlRpcServlet</servlet-class>
<init-param>
<param-name>enabledForExtensions</param-name>
<param-value>true</param-value>
<description>
Sets, whether the servlet supports vendor extensions for XML-RPC.
</description>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>XmlRpcServlet</servlet-name>
<url-pattern>/xmlrpc</url-pattern>
</servlet-mapping>
This solution is working in standalone war and/or war when packaged it in ear.
regards, Arnold Somogyi