sten-navie commented on issue #60:
URL: https://github.com/apache/felix-atomos/issues/60#issuecomment-1163248236
> > javax.xml.parsers.SAXParserFactory is in unnamed module of loader
org.eclipse.osgi.internal.loader.EquinoxClassLoader @162a66a1)
>
> This indicates to me that you may have another "normal" bundle that is
exporting `javax.xml.parsers` package also?
This was my first thought, so I created a simple setup with just the jars
listed above. There are no other "normal" bundles than the metatype one.
Running `which 42 javax.xml.parsers.SAXParserFactory`(where 42 is the bundle id
of the meta-type bundle gives me:
```
Loaded from: java.xml_11.0.14 [14]
```
Interestingly enough if I run `which 0 javax.xml.parsers.SAXParserFactory`,
even though the the system bundle does not list a export for javax.xml.parsers,
I get the response:
```
Loaded from: boot class loader
```
My understanding of class loader delegation in equinox is very limited, but
when running my "real" app in the debugger I observed the following:
- It seems that meta-type bundle SAXParserFactory.class is in the
"un-named" module and a has a EquinoxClassLoader. (Checked by putting a
breakpoint where the metatype bundle activator starts tracking
SaxParserFactories).
- The factory returned by equinox in
org.eclipse.osgi.internal.framework.XMLParsingServiceFactory uses a
SAXParserFactory.class from the "javax.xml" module and null class loader.
(Checked by breaking in XMLParsingServiceFactory.createService and stepping
into SaxParserFactory.newInstance which specifies the class).
best regards,
Sten
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]