<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Bill,<div class=""><br class=""></div><div style="widows: 1;" class="">I already had <span style="widows: 1;" class=""><span style="white-space: pre-wrap;" class=""> <module name="javax.api”/> in my module.xml</span></span></div><div style="widows: 1;" class=""><span style="widows: 1;" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></span></div><div style="widows: 1;" class=""><span style="widows: 1;" class=""><span style="white-space: pre-wrap;" class="">I did find a workaround that I do not like and I am hoping that you can help me do it right</span></span></div><div style="widows: 1;" class=""><span style="widows: 1;" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></span></div><div style="widows: 1;" class=""><span style="widows: 1;" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></span></div><div style="widows: 1;" class=""><span style="widows: 1;" class=""><span style="white-space: pre-wrap;" class="">Ok so I first set </span></span> jaxp debug to true, </div><div class="">and I was getting the following error</div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(195, 55, 32);">JAXP: using thread context class loader (ModuleClassLoader for Module "deployment.keycloak-server.war:main" from Service Module Loader) for search</div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(195, 55, 32);">11:03:40,517 ERROR [stderr] (default task-2) JAXP: Looking up system property 'javax.xml.xpath.XPathFactory:http://<a href="http://java.sun.com/jaxp/xpath/dom'" class="">java.sun.com/jaxp/xpath/dom'</a></div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(195, 55, 32);">11:03:40,517 ERROR [stderr] (default task-2) JAXP: The value is '__redirected.__XPathFactory'</div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(195, 55, 32);">11:03:40,517 ERROR [stderr] (default task-2) JAXP: createInstance(__redirected.__XPathFactory)</div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(195, 55, 32);">11:03:40,518 ERROR [stderr] (default task-2) JAXP: loaded __redirected.__XPathFactory from jar:file:/Users/Carmen/software/keycloak-demo-1.5.0.Final/keycloak/jboss-modules.jar!/__redirected/__XPathFactory.class</div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(195, 55, 32);">11:03:40,518 ERROR [stderr] (default task-2) JAXP: could not instantiate __redirected.__XPathFactory</div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(195, 55, 32);">11:03:40,519 ERROR [stderr] (default task-2) java.lang.ClassCastException: __redirected.__XPathFactory cannot be cast to javax.xml.xpath.XPathFactory</div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(195, 55, 32);">11:03:40,519 ERROR [stderr] (default task-2) <span class="Apple-tab-span" style="white-space: pre;">        </span>at javax.xml.xpath.XPathFactoryFinder.createInstance(XPathFactoryFinder.java:306)</div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(195, 55, 32);">11:03:40,519 ERROR [stderr] (default task-2) <span class="Apple-tab-span" style="white-space: pre;">        </span>at javax.xml.xpath.XPathFactoryFinder._newFactory(XPathFactoryFinder.java:184)</div><div class="" style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(195, 55, 32);">11:03:40,519 ERROR [stderr] (default task-2) <span class="Apple-tab-span" style="white-space: pre;">        </span>at javax.xml.xpath.XPathFactoryFinder.newFactory(XPathFactoryFinder.java:157)</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">So it looked like there was a class loader issue and the ClassCast was not working.</div><div class="">I did not know how to fix that, so I went ahead and I changed the property <span style="color: rgb(195, 55, 32); font-family: Menlo;" class="">javax.xml.xpath.XPathFactory:http://</span><font face="Menlo" class=""><a href="http://java.sun.com/jaxp/xpath/dom" class="">java.sun.com/jaxp/xpath/dom</a></font> back to the default, to override looking for <span style="color: rgb(195, 55, 32); font-family: Menlo;" class="">__redirected.__XPathFactory</span> </div><div class="">The default implementation is a com.sun….. class that lives in rt.jar and when I tried that I was getting a ClassNotFound, so I went ahead, added Xalan to my module and changed the property to use the Xalan class: <font color="#c33720" face="Menlo" class="">org.apache.path.jaxp.XPathFactoryImpl</font> </div><div class="">That worked.</div><div class=""><br class=""></div><div class="">I had that same issue with another class that was also overriden with a __redirected class (DocumentBuilderFactory), and once I set the default value to the default implementation, the implementation cannot be loaded because it is in rt.jar. I went around that by adding crimsom to my module.</div><div class=""><br class=""></div><div class="">So it looks like even though there is a dependency defined of java.api, those jars (at least for xml) do not contain implementations, just the interfaces, and the actual providers are in rt.jar and I get an error trying to load them.</div><div class=""><br class=""></div><div class="">So I really do not like what I have done. There’s got to be a way to be able to use the implementations in rt.jar, right?</div><div class=""><br class=""></div><div class="">Thanks</div><div class="">Maria</div><div class=""><br class=""></div><div class=""> </div></body></html>