Commit 03d162de authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Log a warn if a SAXException occurs while setting the feature to the SAXReader and continue...


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1641 b35dd754-fafc-0310-a699-88a17e54d16e
parent c7e36e5e
...@@ -19,6 +19,7 @@ import org.dom4j.io.SAXReader; ...@@ -19,6 +19,7 @@ import org.dom4j.io.SAXReader;
import org.jivesoftware.util.JiveGlobals; import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.Log; import org.jivesoftware.util.Log;
import org.jivesoftware.util.StringUtils; import org.jivesoftware.util.StringUtils;
import org.xml.sax.SAXException;
import javax.servlet.ServletConfig; import javax.servlet.ServletConfig;
import javax.servlet.ServletException; import javax.servlet.ServletException;
...@@ -26,12 +27,7 @@ import javax.servlet.ServletOutputStream; ...@@ -26,12 +27,7 @@ import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -136,8 +132,13 @@ public class PluginServlet extends HttpServlet { ...@@ -136,8 +132,13 @@ public class PluginServlet extends HttpServlet {
// Make the reader non-validating so that it doesn't try to resolve external // Make the reader non-validating so that it doesn't try to resolve external
// DTD's. Trying to resolve external DTD's can break on some firewall configurations. // DTD's. Trying to resolve external DTD's can break on some firewall configurations.
SAXReader saxReader = new SAXReader(false); SAXReader saxReader = new SAXReader(false);
try {
saxReader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", saxReader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd",
false); false);
}
catch (SAXException e) {
Log.warn("Error setting SAXReader feature", e);
}
Document doc = saxReader.read(webXML); Document doc = saxReader.read(webXML);
// Find all <servlet> entries to discover name to class mapping. // Find all <servlet> entries to discover name to class mapping.
List classes = doc.selectNodes("//servlet"); List classes = doc.selectNodes("//servlet");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment