You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Benson Margulies (JIRA)" <ji...@apache.org> on 2008/11/17 20:29:44 UTC
[jira] Resolved: (WSCOMMONS-358) DOM level 3 checks don't work
properly
[ https://issues.apache.org/jira/browse/WSCOMMONS-358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benson Margulies resolved WSCOMMONS-358.
----------------------------------------
Resolution: Fixed
Fix Version/s: XmlSchema 1.4.3
Patched.
> DOM level 3 checks don't work properly
> --------------------------------------
>
> Key: WSCOMMONS-358
> URL: https://issues.apache.org/jira/browse/WSCOMMONS-358
> Project: WS-Commons
> Issue Type: Bug
> Components: XmlSchema
> Reporter: Daniel Kulp
> Assignee: Benson Margulies
> Fix For: XmlSchema 1.4.3
>
>
> In DOMUtils, there are methods like:
> public static String getInputEncoding(Document doc) {
> try {
> Method m = Document.class.getMethod("getInputEncoding", new Class[]{});
> return (String) m.invoke(doc, new Object[]{});
> } catch (Exception e) {
> return DEFAULT_ENCODING;
> }
> }
> which supposedly check if it's a DOM level 3 thing or not. However, that only checks if the API jar is DOM level 3. It doesn't check the actual implementation. If you end up with the level 3 api jar, but an older xerces, the Method is found on the Document class, but when invoke is called, it gets:
> ava.lang.AbstractMethodError: weblogic.apache.xerces.dom.DeferredDocumentImpl.getInputEncoding()Ljava/lang/String;
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.apache.ws.commons.schema.utils.DOMUtil.getInputEncoding(DOMUtil.java:602)
> Most likely, the catch Exception should be changed to Throwable, but it might be good to change:
> Method m = Document.class.getMethod("getInputEncoding", new Class[]{});
> to
> Method m = doc.getClass().getMethod("getInputEncoding", new Class[]{});
> to get the method off the actual implementation class.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.