You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Richard S. Hall (JIRA)" <ji...@apache.org> on 2011/08/30 17:45:39 UTC

[jira] [Updated] (FELIX-2762) Substring parser incorrectly disallowing use of parentheses characters

     [ https://issues.apache.org/jira/browse/FELIX-2762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard S. Hall updated FELIX-2762:
-----------------------------------

    Priority: Minor  (was: Major)
     Summary: Substring parser incorrectly disallowing use of parentheses characters  (was: IllegalArgumentException when trying to load classnames with a parenthesis)

After investigating this issue a little more, I realized that the underlying issue is caused by the fact that our substring parsing code is disallowing the use of parentheses characters in its matching patterns. In other words, it was not allowing something like "foo(*bar" to be parsed, but there is no reason it shouldn't allow just about any character in the string. I think this is a holdover from when the code was part of the LDAP parser. I've updated the summary of this issue to reflect the this issue.

> Substring parser incorrectly disallowing use of parentheses characters
> ----------------------------------------------------------------------
>
>                 Key: FELIX-2762
>                 URL: https://issues.apache.org/jira/browse/FELIX-2762
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-3.0.7
>            Reporter: Michael Petritsch
>            Priority: Minor
>             Fix For: framework-4.0.0
>
>
> When a bundle is trying to load a class with a classname that contains a perenthesis felix is throwing an IllegalArgumentException. Now usually the bundle trying to load the class would catch a "ClassNotFoundException". Other classLoaders (or at least sun.misc.Launcher.AppClassLoader) are throwing a ClassNotFoundException if the classname contains a parenthesis.
> Even if it's illegal to have parentheses in classnames some bundles still might try to load such classnames (e.g. due to a bug). So they could stop working in felix if they are catching a ClassNotFoundException even though they worked well before with different classloaders.
> Here is the stacktrace caused by a bundle that fits the category mentioned above:
> 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)
>     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)
>     at org.ops4j.pax.swissbox.core.BundleClassLoader.loadClass(BundleClassLoader.java:194)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
>     at org.milyn.util.ClassUtil.forName(ClassUtil.java:82)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira