Cannot initialize module TreeWalker during the build in Eclipse - eclipse

I'm performing Project-Clean... in Eclipse Mars and getting the following error
Errors occurred during the build.
Errors running builder 'Checkstyle Builder' on project 'MyProject'.
cannot initialize module TreeWalker - Unable to instantiate
'RedundantThrows' class, it is also not possible to instantiate it as
com.puppycrawl.tools.checkstyle.checks.annotation.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.blocks.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.design.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.header.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.imports.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.indentation.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.javadoc.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.metrics.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.modifier.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.naming.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.regexp.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.sizes.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.whitespace.RedundantThrows,
com.puppycrawl.tools.checkstyle.checks.RedundantThrows,
com.puppycrawl.tools.checkstyle.filters.RedundantThrows,
com.puppycrawl.tools.checkstyle.RedundantThrows. Please recheck that class name
is specified as canonical name or read how to configure short name usage
http://checkstyle.sourceforge.net/config.html#Packages. Please also recheck that
provided ClassLoader to Checker is configured correctly.
The CheckStyle plugin version is 6.11.
Could you please help me figuring out what may cause this error. Thanks.

The RedundantThrows check has been removed from Checkstyle. Just remove the <module> entry for it from your checkstyle.xml.

Related

Groovy:General error during semantic analysis: java.lang.NoSuchMethodError:

Imported the gradle project from the "complete" folder and received the following error:
Groovy:General error during semantic analysis:
java.lang.NoSuchMethodError: 'org.codehaus.groovy.ast.expr.Expression org.codehaus.groovy.ast.tools.GeneralUtils.propX(org.codehaus.groovy.ast.expr.Expression, java.lang.String)'
I am using the latest version of Eclipse, 2020-12, with groovy tools installed.
From grails guide
https://guides.grails.org/gorm-without-grails/guide/index.html
Downloaded code sample from github
https://github.com/grails-guides/gorm-without-grails.git
It seems likely to be a version mismatch, but I cannot determine how to correct this problem.
I have tried to delete the offending file, src/main/groovy/demo/domain/Manufacturer.groovy, and the error appears on the file in this package on line 1.
The error does not appear in any other package. I have done the usual internet searches for resolutions that apply, but have thus far been unable to find a suitable solution. I am hopeful for a suggestion?
I think this error comes from an AST transform that references the older signature of GeneralUtils#propX. This method used to return Expression and was changed to return PropertyExpression.
The bridge method for binary compatibility was missing in groovy-eclipse. https://github.com/groovy/groovy-eclipse/commit/f6f448675d95f858b4ec65b6fc8e55f27ccaaa94

Unable to load a Suite class

Unable to load a Suite class. This could be due to an error in your runpath.
i am getting this error while trying to run scala test case. kindly suggest.
I have same error message as yours.
What I do is:
In your test run configuration(go "Edit Configuration" > "Use classpath ... of module") select the right module at place the image show.
At least this solve my problem that I target to wrong module. May it help you.
i solved the same problem by checking "Use SBT" option in test run configuration under Edit Configuration>Test Class

Debugging OfBiz in Eclipse gives MissingResourceException

I downloaded the OfBiz Java application and the following line throws an MissingResourceException:
ResourceBundle res = ResourceBundle.getBundle(settingsResourceName);
The value of settingsResourceName is "cache", but I cannot find any file called cache.properties or cache_en.properties.
Where should I be looking? I'm new to Java. All my research on SO says there should be such a file.
I imported OfBiz in Eclipse using the Import menu option and selecting Existing Project from File System (I'm not in front of my dev machine so I don't remember the exact wording). But I chose the root folder of the downloaded OfBiz.
I then added the appropriate VM Arguments in the Run Configuration to get it to run properly at least. And that's it, on the first Run I got the above error. I think it has to do with a missing class path but I don't know what to add to class path.
Here is the stack trace:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.apache.ofbiz.base.util.Debug.<clinit>(Debug.java:68)
at org.apache.ofbiz.base.container.ContainerLoader.load(ContainerLoader.java:61)
at org.apache.ofbiz.base.start.StartupControlPanel.loadStartupLoaders(StartupControlPanel.java:202)
at org.apache.ofbiz.base.start.StartupControlPanel.start(StartupControlPanel.java:69)
at org.apache.ofbiz.base.start.Start.main(Start.java:84)
Caused by: java.util.MissingResourceException: Can't find bundle for base name cache, locale en
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1564)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1387)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:773)
at org.apache.ofbiz.base.util.cache.UtilCache.setPropertiesParams(UtilCache.java:174)
at org.apache.ofbiz.base.util.cache.UtilCache.setPropertiesParams(UtilCache.java:170)
at org.apache.ofbiz.base.util.cache.UtilCache.setPropertiesParams(UtilCache.java:166)
at org.apache.ofbiz.base.util.cache.UtilCache.<init>(UtilCache.java:124)
at org.apache.ofbiz.base.util.cache.UtilCache.createUtilCache(UtilCache.java:769)
at org.apache.ofbiz.base.util.UtilProperties.<clinit>(UtilProperties.java:75)
... 5 more
UPDATE:
My mistake, I found two files both called cache.properties in the following folders:
ofbiz-trunk/build/resources/main
ofbiz-trunk/framework/base/config
But these are folders, not packages. I tried putting them in the .classpath but that did not work, I still kept getting the same error.
As suspected, I knew it was because of a missing reference to a class path. After looking at a section on this page: http://www.opensourcestrategies.com/ofbiz/ofbiz_eclipse.php, I learned that I was supposed to go to the Java Build Path and in the Libraries tab, click on Add Class Folder, then point that to ofbiz-trunk/framework/base/config. Which is where I have one of the cache.properties files.

The compiler show error message when using ProjectExplorer in Eclipse Kpler

I use the following code in Kepler:
ProjectExplorer projExplorer = (ProjectExplorer) PlatformUI.getWorkbench().getActiveWorkbenchWindow().
getActivePage().findView(IPageLayout.ID_PROJECT_EXPLORER);
And I have added org.eclipse.ui.navigator.resources.jar, however, when I compile my project, it shows an error message:
The type org.eclipse.ui.navigator.CommonNavigator cannot be resolved. It is indirectly referenced from required .class
files
CommonNavigator is in the org.eclipse.ui.navigator plugin so add that to your plugin's dependencies.
If you check that jar # docjar : http://docjar.com/jar_detail/org.eclipse.ui.navigator.resources_3.3.100.I20080606-1300.jar.html, you'll find that CommonNavigator is not there.
You probably need this one: http://docjar.com/jar_detail/org.eclipse.ui.navigator_3.3.100.I20080606-1300.jar.html

How to include predefined set of netbeans platform modules in maven project?

I am working on maven netbeans platform project consisting of several modules. I need to depend on some modules (say java.source module), but when I try to run the application, it reports, that required modules are not installed. And event despite I have dependency on java.source declared in my pom.xml
I think, that I have to tell maven somehow, to install (and turn on) these modules in the final assembled application before my module is loaded.
How could I do something like this?
UPDATE:
When I try to create complete netbeans application project from maven artifact and add Java Source API as a dependency into pom.xml... when I run the application, window with following message appears:
Warning - could not install some modules: Editor Library 2 - None of the modules providing the capability org.netbeans.modules.editor.actions could be installed. Editor Indentation for Projects - The module named org.netbeans.modules.editor.settings.storage/1 was needed and not found. Editor Indentation for Projects - The module named org.netbeans.modules.options.editor/1 was needed and not found. Project UI API - No module providing the capability org.netbeans.modules.project.uiapi.ActionsFactory could be found. Project UI API - No module providing the capability org.netbeans.modules.project.uiapi.OpenProjectsTrampoline could be found. Project UI API - No module providing the capability org.netbeans.modules.project.uiapi.ProjectChooserFactory could be found. Editor Error Stripe Impl - The module named org.netbeans.modules.editor.errorstripe.api/1 was needed and not found. Java Source - The module named org.netbeans.libs.javacimpl/1 was needed and not found. Java Source - The module named org.netbeans.modules.editor.indent.project/0-1 was needed and not found. Java Source - The module named org.netbeans.modules.java.preprocessorbridge was needed and not found. Java Source - The module named org.netbeans.modules.options.editor/1 was needed and not found. Java Source - The module named org.netbeans.modules.parsing.api/1 was needed and not found. Editor Settings - No module providing the capability org.netbeans.api.editor.settings.implementation could be found. Diff - The module named org.netbeans.modules.options.editor/1 was needed and not found. 11 further modules could not be installed due to the above problems.
The error-message "Module dependency has friend dependency [...] but is not listed as friend" means that you need to specify an implementation version of org.netbeans.modules.options.editor.
You can achieve this by editing src/main/nbm/module.xml to contain the following entry (I didn't use the actually needed values here. Make sure to find out which values to enter for id and explicitValue to satisfy the dependencies (You can find explanations / instructions in the article linked below):
<dependencies>
<dependency>
<id>org.netbeans.modules:org-netbeans-modules-editor</id>
<type>impl</type>
<explicitValue>org.netbeans.modules.editor/1 = 201107282000</explicitValue>
</dependency>
</dependencies>
I'm pretty sure that the following article will explain some issues and help you find out the needed values for id and explicitValue (language is english, author is me):
http://blog.macrominds.de/2011/08/open-favorites-per-default-in-netbeans-rich-client-platform-maven-standalone-application/
I'm currently having related problems with my application, so I might come back with a more concrete solution in a while.
the easiest way is to grab a class that its complaining about, say "org.netbeans.modules.editor.actions" and go to the Add Dependencies and plug it into the Query field.
From there you should be able to tell which module you will need to include