You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Dirk Schaube (JIRA)" <ji...@apache.org> on 2012/06/15 14:05:42 UTC
[jira] [Created] (DIGESTER-165) BinderClassLoader does not override
getResource
Dirk Schaube created DIGESTER-165:
-------------------------------------
Summary: BinderClassLoader does not override getResource
Key: DIGESTER-165
URL: https://issues.apache.org/jira/browse/DIGESTER-165
Project: Commons Digester
Issue Type: Bug
Affects Versions: 3.2
Reporter: Dirk Schaube
The class org.apache.commons.digester3.binder.BinderClassLoader adapts the the actual classloader but does not override getResource and call getResource of the adapted classloader. This method is called when using an include element with a classpath url in a xml rules file (e.g. <include url="classpath:/com/something/foo.xml" />).
As the constructor of BinderClassLoader does not call super(parent) the system class loader is the parent of the BinderClassLoader which is a problem if you are e.g. in a web application. As result the xml file is not found although it is in the classpath (and could be found by the adapted classloader).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (DIGESTER-165) BinderClassLoader does not
override getResource
Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIGESTER-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295616#comment-13295616 ]
Simone Tripodi commented on DIGESTER-165:
-----------------------------------------
Good catch Dirk!
can you provide a patch?
TIA!
> BinderClassLoader does not override getResource
> -----------------------------------------------
>
> Key: DIGESTER-165
> URL: https://issues.apache.org/jira/browse/DIGESTER-165
> Project: Commons Digester
> Issue Type: Bug
> Affects Versions: 3.2
> Reporter: Dirk Schaube
> Assignee: Simone Tripodi
>
> The class org.apache.commons.digester3.binder.BinderClassLoader adapts the the actual classloader but does not override getResource and call getResource of the adapted classloader. This method is called when using an include element with a classpath url in a xml rules file (e.g. <include url="classpath:/com/something/foo.xml" />).
> As the constructor of BinderClassLoader does not call super(parent) the system class loader is the parent of the BinderClassLoader which is a problem if you are e.g. in a web application. As result the xml file is not found although it is in the classpath (and could be found by the adapted classloader).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (DIGESTER-165) BinderClassLoader does not
override getResource
Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIGESTER-165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Simone Tripodi resolved DIGESTER-165.
-------------------------------------
Resolution: Fixed
Fix Version/s: 3.3
Thanks a lot for contributing Dirk, I applied your patches, see r1352055.
Just few minor recommendations for future patches you'll submit, also in other ASF projects:
* have a look at [On Contributing Patches |http://commons.apache.org/patches.html] on main Apache Commons site
* it would be helpful provide one single patch which is name with the issue key, i.e. {{{DIGESTER-165}}}
* please fix your svn settings, I had to fight against the _Inconsistent line ending style_ issue with {{dos2unix}}, see suggested [Native EOL|http://www.apache.org/dev/svn-eol-style.txt] style.
Hope to apply more patches from you!
> BinderClassLoader does not override getResource
> -----------------------------------------------
>
> Key: DIGESTER-165
> URL: https://issues.apache.org/jira/browse/DIGESTER-165
> Project: Commons Digester
> Issue Type: Bug
> Affects Versions: 3.2
> Reporter: Dirk Schaube
> Assignee: Simone Tripodi
> Fix For: 3.3
>
> Attachments: BinderClassLoader.java.2.patch, BinderClassLoader.java.patch, BinderClassLoaderTestCase.java.patch
>
>
> The class org.apache.commons.digester3.binder.BinderClassLoader adapts the the actual classloader but does not override getResource and call getResource of the adapted classloader. This method is called when using an include element with a classpath url in a xml rules file (e.g. <include url="classpath:/com/something/foo.xml" />).
> As the constructor of BinderClassLoader does not call super(parent) the system class loader is the parent of the BinderClassLoader which is a problem if you are e.g. in a web application. As result the xml file is not found although it is in the classpath (and could be found by the adapted classloader).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (DIGESTER-165) BinderClassLoader does not
override getResource
Posted by "Simone Tripodi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIGESTER-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13395469#comment-13395469 ]
Simone Tripodi commented on DIGESTER-165:
-----------------------------------------
thanks a lot for the patch Dirk, I've just applied it, see [r1351226|http://svn.apache.org/viewvc?rev=1351226&view=rev].
Can you provide please a simple patch with testcase as well, in order to demonstrate the bug is fixed?
TIA!
PS I also added you in the contributors list
> BinderClassLoader does not override getResource
> -----------------------------------------------
>
> Key: DIGESTER-165
> URL: https://issues.apache.org/jira/browse/DIGESTER-165
> Project: Commons Digester
> Issue Type: Bug
> Affects Versions: 3.2
> Reporter: Dirk Schaube
> Assignee: Simone Tripodi
> Attachments: BinderClassLoader.java.patch
>
>
> The class org.apache.commons.digester3.binder.BinderClassLoader adapts the the actual classloader but does not override getResource and call getResource of the adapted classloader. This method is called when using an include element with a classpath url in a xml rules file (e.g. <include url="classpath:/com/something/foo.xml" />).
> As the constructor of BinderClassLoader does not call super(parent) the system class loader is the parent of the BinderClassLoader which is a problem if you are e.g. in a web application. As result the xml file is not found although it is in the classpath (and could be found by the adapted classloader).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (DIGESTER-165) BinderClassLoader does not override
getResource
Posted by "Dirk Schaube (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIGESTER-165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dirk Schaube updated DIGESTER-165:
----------------------------------
Attachment: BinderClassLoader.java.patch
The most robust solution would be to call super(adaptedClassLoader) in the constructor.
> BinderClassLoader does not override getResource
> -----------------------------------------------
>
> Key: DIGESTER-165
> URL: https://issues.apache.org/jira/browse/DIGESTER-165
> Project: Commons Digester
> Issue Type: Bug
> Affects Versions: 3.2
> Reporter: Dirk Schaube
> Assignee: Simone Tripodi
> Attachments: BinderClassLoader.java.patch
>
>
> The class org.apache.commons.digester3.binder.BinderClassLoader adapts the the actual classloader but does not override getResource and call getResource of the adapted classloader. This method is called when using an include element with a classpath url in a xml rules file (e.g. <include url="classpath:/com/something/foo.xml" />).
> As the constructor of BinderClassLoader does not call super(parent) the system class loader is the parent of the BinderClassLoader which is a problem if you are e.g. in a web application. As result the xml file is not found although it is in the classpath (and could be found by the adapted classloader).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (DIGESTER-165) BinderClassLoader does not override
getResource
Posted by "Dirk Schaube (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIGESTER-165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dirk Schaube updated DIGESTER-165:
----------------------------------
Attachment: BinderClassLoader.java.2.patch
BinderClassLoaderTestCase.java.patch
Attached the path for the test. I also simplified the BinderClassLoader a little bit.
> BinderClassLoader does not override getResource
> -----------------------------------------------
>
> Key: DIGESTER-165
> URL: https://issues.apache.org/jira/browse/DIGESTER-165
> Project: Commons Digester
> Issue Type: Bug
> Affects Versions: 3.2
> Reporter: Dirk Schaube
> Assignee: Simone Tripodi
> Attachments: BinderClassLoader.java.2.patch, BinderClassLoader.java.patch, BinderClassLoaderTestCase.java.patch
>
>
> The class org.apache.commons.digester3.binder.BinderClassLoader adapts the the actual classloader but does not override getResource and call getResource of the adapted classloader. This method is called when using an include element with a classpath url in a xml rules file (e.g. <include url="classpath:/com/something/foo.xml" />).
> As the constructor of BinderClassLoader does not call super(parent) the system class loader is the parent of the BinderClassLoader which is a problem if you are e.g. in a web application. As result the xml file is not found although it is in the classpath (and could be found by the adapted classloader).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira