Bug#747560: Checkstyle unusable with commons-beanutils 1.9.1
Saikrishna Arcot
saiarcot895 at gmail.com
Fri May 9 23:50:27 UTC 2014
Package: checkstyle
Version: 5.7-1
With the release of commons-beanutils 1.9.1 (possibly from commons-beanutils 1.9.0 itself), the org.apache.commons.collections package was removed from this source package, since it was already present in the libcommons-collections3-java source package. Because the wrapper script doesn't include the latter package in the list of jars to add to the runtime path, checkstyle crashes with the following stack trace:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap
at org.apache.commons.beanutils.PropertyUtilsBean.getPropertyDescriptor(PropertyUtilsBean.java:959)
at org.apache.commons.beanutils.BeanUtilsBean.copyProperty(BeanUtilsBean.java:388)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.contextualize(AutomaticBean.java:206)
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:156)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:184)
at com.puppycrawl.tools.checkstyle.Main.createChecker(Main.java:143)
at com.puppycrawl.tools.checkstyle.Main.main(Main.java:120)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.FastHashMap
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 7 more
To fix this, two things need to be done:
1. Edit the wrapper to load the commons-collections3 jar file.
2. Add a dependency on libcommons-collections3-java
In addition, it may be possible to remove the libcommons-beanutils-java dependency. A basic test seems to show checkstyle working without the jar file loaded at runtime.
I've attached a patch that does the two things above.
See also https://bugs.launchpad.net/ubuntu/+source/checkstyle/+bug/1308794[1]
--
Saikrishna Arcot
--------
[1] https://bugs.launchpad.net/ubuntu/+source/checkstyle/+bug/1308794
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-java-maintainers/attachments/20140509/003682b4/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: checkstyle_fixes.diff
Type: text/x-patch
Size: 933 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-java-maintainers/attachments/20140509/003682b4/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/pkg-java-maintainers/attachments/20140509/003682b4/attachment-0001.sig>
More information about the pkg-java-maintainers
mailing list