[ 
https://issues.apache.org/jira/browse/KARAF-7084?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17309323#comment-17309323
 ] 

Grzegorz Grzybek edited comment on KARAF-7084 at 3/26/21, 10:09 AM:
--------------------------------------------------------------------

And finally, a real archaeology... JEP 268: XML Catalog API was generally 
related to exposing internal (in JDK8):
{noformat}
com.sun.org.apache.xml.internal.resolver.CatalogManager
{noformat}
as public (in JDK9+, {{java.xml}} module):
{noformat}
javax.xml.catalog.CatalogManager
{noformat}

{{com.sun.org.apache.xml.internal.resolver.CatalogManager}} is of course 
related to {{org.apache.xml.resolver.CatalogManager}} which is available in 
https://search.maven.org/artifact/xml-resolver/xml-resolver/1.2/jar with the 
source code available in 
http://svn.apache.org/repos/asf/xerces/xml-commons/tags/xml-commons-resolver-1_2/

Original (\?) JAXP API is available through 
https://search.maven.org/artifact/xml-apis/xml-apis/1.4.01/jar with the source 
code available in 
http://svn.apache.org/repos/asf/xerces/xml-commons/tags/xml-commons-external-1_4_01/

There are SMX bundles both for Xerces and Xalan, which require (through 
Import-Package):
* Xalan needs 
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.bcel/5.2_4
* Xerces needs 
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver/1.2_5

So when installing Xerces/Xalan SMX bundles, we need to ensure that the 
requirements are also installed (see for example Camel's {{camel-box}} Karaf 
feature).


was (Author: gzres):
And finally, a real archaeology... JEP 268: XML Catalog API was generally 
related to exposing internal (in JDK8):
{noformat}
com.sun.org.apache.xml.internal.resolver.CatalogManager
{noformat}
as public (in JDK9+, {{java.xml}} module):
{noformat}
javax.xml.catalog.CatalogManager
{noformat}

{{com.sun.org.apache.xml.internal.resolver.CatalogManager}} is of course 
related to {{org.apache.xml.resolver.CatalogManager}} which is available in 
https://search.maven.org/artifact/xml-resolver/xml-resolver/1.2/jar with the 
source code available in 
http://svn.apache.org/repos/asf/xerces/xml-commons/tags/xml-commons-resolver-1_2/

Original (?) JAXP API is available through 
https://search.maven.org/artifact/xml-apis/xml-apis/1.4.01/jar with the source 
code available in 
http://svn.apache.org/repos/asf/xerces/xml-commons/tags/xml-commons-external-1_4_01/

There are SMX bundles both for Xerces and Xalan, which require (through 
Import-Package):
* Xalan needs 
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.bcel/5.2_4
* Xerces needs 
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver/1.2_5

So when installing Xerces/Xalan SMX bundles, we need to ensure that the 
requirements are also installed (see for example Camel's {{camel-box}} Karaf 
feature).

> Not every factory access from JAXP (specs/java.xml) goes through OsgiLocator
> ----------------------------------------------------------------------------
>
>                 Key: KARAF-7084
>                 URL: https://issues.apache.org/jira/browse/KARAF-7084
>             Project: Karaf
>          Issue Type: Bug
>            Reporter: Grzegorz Grzybek
>            Assignee: Grzegorz Grzybek
>            Priority: Major
>             Fix For: 4.3.2
>
>
> I was checking this code:
> {code:java}
> System.out.println("== JAXP");
> info(DatatypeFactory.class, DatatypeFactory.newInstance());
> info(DocumentBuilderFactory.class, DocumentBuilderFactory.newInstance());
> info(SAXParserFactory.class, SAXParserFactory.newInstance());
> info(XMLEventFactory.class, XMLEventFactory.newInstance());
> info(XMLInputFactory.class, XMLInputFactory.newInstance());
> info(XMLOutputFactory.class, XMLOutputFactory.newInstance());
> info(TransformerFactory.class, TransformerFactory.newInstance());
> info(SchemaFactory.class, 
> SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI));
> info(XPathFactory.class, XPathFactory.newInstance());
> System.out.println("== SAAJ");
> try {
>     info(MessageFactory.class, MessageFactory.newInstance());
>     info(SOAPConnectionFactory.class, SOAPConnectionFactory.newInstance());
>     info(SOAPFactory.class, SOAPFactory.newInstance());
> } catch (Throwable ignored) {
> }
> System.out.println("== JAX-WS");
> try {
>     info(Provider.class, Provider.provider());
> } catch (Throwable ignored) {
> }
> System.out.println("== JAXB");
> try {
>     info(JAXBContext.class, JAXBContext.newInstance("grgr.test.jaxb.model", 
> getClass().getClassLoader()));
>     Class<?> cfClass = 
> FrameworkUtil.getBundle(this.getClass()).adapt(BundleWiring.class).getClassLoader().loadClass("com.sun.xml.bind.v2.ContextFactory");
>     System.out.println("ContextFactory class = " + cfClass);
> } catch (Throwable ignored) {
> }
> ...
> private void info(Class<?> clazz, Object service) {
>     System.out.printf(" - %s: %s%n", clazz, service.getClass().getName());
>     System.out.printf(" - %s%n", FrameworkUtil.getBundle(service.getClass()));
> }
> {code}
> TO see if I really can get implementations of JAXP interfaces, if given 
> interface is implemented in a bundle with proper 
> {{/META-INF/services/<service-name>}}. It works well with _some_ JAXP 
> interfaces and with SAAJ. However it doesn't work with:
> * javax.xml.validation.SchemaFactory
> * javax.xml.xpath.XPathFactory
> * org.xml.sax.helpers.XMLReaderFactory (here there's not even a shaded 
> factory in {{java.xml}} Karaf spec)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to