Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An internal error occurred during: "ReviewCode". #34

Closed
ahanekom opened this issue Feb 5, 2018 · 6 comments
Closed

An internal error occurred during: "ReviewCode". #34

ahanekom opened this issue Feb 5, 2018 · 6 comments
Labels

Comments

@ahanekom
Copy link

ahanekom commented Feb 5, 2018

When executing the "check code" function on a Java Project I received the following error:

An internal error occurred during: "ReviewCode".

java.lang.NoClassDefFoundError: com/excel4apps/servlet/wand/framework/exceptions/CookieNotFoundException
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Unknown Source)
at java.lang.Class.getDeclaredField(Unknown Source)
at net.sourceforge.pmd.lang.java.typeresolution.ClassTypeResolver.getFieldType(ClassTypeResolver.java:346)
(Full Eclipse Error Log attached)

The issue seems to be related to java projects referencing other java projects in the build path, when the PMD eclipse plugin makes a call to get field types, a java.lang.NoClassDefFoundError is raised. The class reported as not being found, CookieNotFoundException, is not located in the source folder of the Java project being checked, it is part of the project, referenced in the build path.

PMD Plug-in 4.0.15.v20170624-2134 net.sourceforge.pmd.eclipse.feature.group PMD Project

ReviewCode Error.log

@ahanekom
Copy link
Author

ahanekom commented Feb 6, 2018

Update: When also adding the project class folder, Java Build Path -> Libraries Tab: Add Class Folder..., for the project which is already linked via the Projects tab in the Java Build Path dialog, the error is not raised during the Check Code call.

@ahanekom
Copy link
Author

When disabling the workspace level PMD option "Enable using Java Projects Build Path..." the check code completes successfully without adding the project class folder as commented above. Issue resolved.

@Androbin
Copy link

Good to know that this "fixes" the issue. But it's a nasty bug nonetheless.
We should use the classpath that Eclipse uses internally to be consistent.
Or at least catch the error and display a human readable error message.

@adangel adangel reopened this Apr 16, 2018
@adangel
Copy link
Member

adangel commented Apr 16, 2018

Agreed - the way how the eclipse plugin determines the classpath to be used when executing PMD is probably worth more than one look...

@Androbin
Copy link

Seems the PMD JavaTypeDefinition is now swallowing this completely:
pmd/pmd@30afff4#diff-01d012be81d194e955a628c70a37287bR69

@adangel
Copy link
Member

adangel commented Jun 7, 2019

I think, this has been fixed with #96 . Please re-open the issue, if the problem still exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants