Note that there are some explanatory texts on larger screens.

plurals
  1. PONoClassDefFoundError when checkstyle is running
    primarykey
    data
    text
    <p>I have written a new checkstyle check as a filescanner. I modeled my junits after the code I found in the checkstyle code. The junits run just fine and everything looks good.</p> <p>But then, I add the check to my project. </p> <pre><code>&lt;module name="TreeWalker"&gt; &lt;property name="tabWidth" value="4" /&gt; &lt;module name="com.onuspride.codetools.checkstyles.DuplicateClassNames"/&gt; &lt;/module&gt; </code></pre> <p>and my ant task</p> <pre><code>&lt;taskdef resource="checkstyletask.properties"&gt; &lt;classpath refid="classpath" /&gt; &lt;/taskdef&gt; &lt;property name="checkstyle.suppressions.file" value="checkstyle/suppressions.xml" /&gt; &lt;property name="translation.severity" value="error" /&gt; &lt;target name="checkStyle" description="TestTask to evaluate the checkstyle system."&gt; &lt;checkstyle config="checkstyle/checkstyle_checks.xml"&gt; &lt;fileset dir="${msg.src}" includes="**/*.java" /&gt; &lt;formatter type="plain" /&gt; &lt;formatter type="xml" toFile="${msg.build.jar}/checkstyle_errors.xml" /&gt; &lt;classpath refid="classpath" /&gt; &lt;/checkstyle&gt; &lt;/target&gt; </code></pre> <p>the duplicateclassnames class calls several classes in the same jar. For some reason, when ant runs it, ant finds the check class, but can't find the supporting classes, when they are all in the same jar file. here's what i get in ant</p> <pre><code> [checkstyle] [class]:0: Got an exception - java.lang.NoClassDefFoundError: com/onuspride/codetools/common/classpath/criteria/ClassNameCriteriaCollector </code></pre> <p>Im stumped. Ive checkd all the dependencies of my jar, they are all in the classpath, I don't understand how it can find one class file but not another in the same jar. Ive done all my dirty little tricks and I just don't get it.</p> <p>any ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload