Hi,
we have recently switched to osgi and after wrapping a bundle we have
discovered a possible issue related to classloading. We are using
org.milyn smooks to convert some csv to java and at some point it is
trying to load a class with an invalid, malformed classname containing
unescaped '(' and ')'. This is obviously due to a bug in smooks and
causes the following exception in felix framework:
java.lang.IllegalArgumentException: Illegal value: Document doc =
element.getOwnerDocument(
at
org.apache.felix.framework.capabilityset.SimpleFilter.parseSubstring(SimpleFilter.java:399)
at
org.apache.felix.framework.util.manifestparser.RequirementImpl.convertToFilter(RequirementImpl.java:162)
at
org.apache.felix.framework.util.manifestparser.RequirementImpl.<init>(RequirementImpl.java:49)
at
org.apache.felix.framework.Felix$FelixResolver.isAllowedDynamicImport(Felix.java:4139)
at
org.apache.felix.framework.Felix$FelixResolver.resolve(Felix.java:4029)
at
org.apache.felix.framework.ModuleImpl.searchDynamicImports(ModuleImpl.java:1367)
at
org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:723)
at org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73)
at
org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1690)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)[:1.6.0_20]
at
org.apache.felix.framework.ModuleImpl.getClassByDelegation(ModuleImpl.java:634)
at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1594)
at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:887)
at
org.ops4j.pax.swissbox.core.BundleClassLoader.findClass(BundleClassLoader.java:176)[129:org.ops4j.pax.swissbox.core:1.3.0]
at
org.ops4j.pax.swissbox.core.BundleClassLoader.loadClass(BundleClassLoader.java:194)[129:org.ops4j.pax.swissbox.core:1.3.0]
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)[:1.6.0_20]
at
org.milyn.util.ClassUtil.forName(ClassUtil.java:86)[132:org.milyn:1.3.1]
at
org.milyn.cdr.SmooksResourceConfiguration.toJavaResource(SmooksResourceConfiguration.java:1128)[132:org.milyn:1.3.1]
at
org.milyn.cdr.SmooksResourceConfigurationStore.processAppContextInitializers(SmooksResourceConfigurationStore.java:235)[132:org.milyn:1.3.1]
at
org.milyn.cdr.SmooksResourceConfigurationStore.registerResources(SmooksResourceConfigurationStore.java:222)[132:org.milyn:1.3.1]
at
org.milyn.Smooks.addConfigurations(Smooks.java:310)[132:org.milyn:1.3.1]
at
org.milyn.Smooks.addConfigurations(Smooks.java:328)[132:org.milyn:1.3.1]
This exception leads to smooks canceling its conversion procedure.
However, when running the same code not via felix but via jetty,
jettys WebAppClassLoader is called and the conversion procedure can
finish. Even though smooks is still trying to load a class with an
invalid classname, the WebAppClassLoader treats it in a way that
allows smooks to finish its work.
Is there maybe something missing in felix (e.g. raising a
ClassNotFoundException) or is attempting to load classes with illegal
names just a no go?
Regards,
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]