Display and Expression Views are giving errors - eclipse

I am using SpringSource Tool Suite 2.9.2 and Grails 2.0.3. I am trying to use the Expressions and Display windows, but both are giving me errors.
The Expression Window says:
org.eclipse.debug.core.DebugException:
com.sun.jdi.ObjectCollectedException occurred retrieving type
This message is different sometimes and says it could not get the right types as if I didn't include packages.
The Display Window says:
"Evaluation failed. Reason(s): An exception occurred durring
evaluation."
Anyone have any idea what is going on?
EDIT:
Andrew, all of those items in the Preferences were checked with the exception of "Enable extra Groovy debug support on all projects (not just Groovy projects)." which I checked.
I still get the error, and for some reason nothing is showing up in the log, but the Expressions opens a sub window that says:
See error log: startup failed:
__Eval.groovy: 7: unable to resolve class mydomain.User # line 7, column 23. import mydomain.User;
^
1 error
Something that is probably relevant: This import is the 3rd domain import on the page. The other two that look like they are working are in the "domain" folder in my "grails-app" folder, but the one that is not working is in "src/groovy" as the project is using Hibernate.xml files. I would expect the Expressions to work for either, but maybe this is the problem?

There are several things that you need to do before debug evaluations can work in Groovy. Most of the time, these things are configured automatically, but sometimes you need to do one or two things manually.
Go to Preferences -> JDT Weaving, make sure it is enabled
Go to Preferences -> Groovy -> Debugger -> Extended debugging. Make sure that all check boxes are selected.
If you are still getting this exception, then this may be a bug. Please update your question with the full stack trace from the error log (Window -> Show view -> Other -> Error log). Also, include the code snippet that you are evaluating.

Related

Eclipse autocomplete problems

I use Map a lot in Java with eclipse. e.g.
Map<String, String> map = new HashMap<>();
then when I am ready to add something with put:
String key = null;
String value = null;
// somewhere before the put, key and value get populated with Strings
map.put(key, value);
the problem is, every time I type "map.put", Eclipse autocomplete changes it to "map.compute()" so I have to edit and remove the "com" and the "e".
I looked at Window -> preferences -> Java -> Editor -> Content Assist but nothing was apparent. I could, I suppose, turn off all content assist, but that would be like "throwing the baby out with the bath water". There are a lot of useful things in the content assist.
My Eclipse:
Eclipse IDE for Enterprise Java Developers.
Version: 2018-12 (4.10.0)
Build id: 20181214-0600
OS: Windows 10, v.10.0, x86_64 / win32
Java version: 1.8.0_144
How can I fix eclipse so it will make the correct suggestions like it did in previous versions?
None of the proposed solutions worked for me. What fixed it was to disable "Show substring matches" (in Preferences -> Java -> Editor -> Content Assist).
It should be considered that this will break the functionality to just type a random part of the desired reference, e.g. typing "PreparedStatement" no longer leads to OraclePreparedStatement. A feature that I don't care about, but this is obviously a matter of personal preference.
In my opinion, the name of that option is a slight misnomer since the substring aspect only applies to leading and not to trailing content.
Update: In Eclipse 2020-06, there is no longer an option "Show substring matches". In its place there is "Show subword matches", but even when disabled, suggestions for typing map.put still include compute. At least when sorted by relevance rather than alphabetically, put is listed in the suggestions before compute.
Window->Preferences
Java->Editor->Content Assist->Advanced
Unchecking "Java Proposals (Task-Focused)" and instead checking regular "Java Type Proposals" fixed the problem for me. I'm using Eclipse for Enterprise Java Developers 2019-03 on Windows 10.
This appears to be due to the unfortunate decision to remove 'Code Recommenders' going forward from 2018-12
"... Code Recommenders will unfortunately not make it into 2018-12."
https://bugs.eclipse.org/bugs/show_bug.cgi?id=542689
The solution currently is to add it manually from the marketplace.
Help -> Eclipse Marketplace -> Search for 'Code Recommenders'
There are no guarantees it will work for Java 11+.
Once installed, you'll have to:
restart Eclipse
close the 'Autocomplete installed' information page
attempt autocomplete once and select the top option that's something like 'Autocomplete enabled'
Finally attempt autocomplete again, this time it should work as expected
Update: It appears Code Recommenders has been archived due to lack of maintainers. When you try to download it, you will get a 404. Hopefully this is temporary.

SuiteCloud IDE Validator Ignore List

In the SuiteCloud Eclipse IDE for NetSuite, what is the Ignore List setting under Preferences > NetSuite > Validation? Is it a single file that behaves like, say, a .gitignore? Or is it an explicit list of files to ignore?
I suspect this setting is why Eclipse is always building libraries and other files I've explicitly told it not to in my NetSuite projects.
Can anyone provide some clarity on the usage of this field?
Attempt 1
I tried setting this preference to a single file with the following contents:
**/*.min.js
**/*.lib.js
**/docs/**
**/Third Party/**
**/node_modules/**
**/bower_components/**
**/*jquery*
**/*moment*
**/*lodash*
But that does not seem to work as expected. Files that should be caught by these regexes are still validated. One of them in particular (docstrap.lib.js) crashes the entire IDE every single time when the SuiteScript validator encounters it.
Attempt 2
I tried to put a similar string of regexes directly into the field itself:
**/*.min.js,**/*.lib.js,**/docs/**,...
but this just yields an error directly in the dialog itself: Value must be an existing file
Attempt 3
Created a new SuiteScript project with only blanket.min.js in the project root. Added an ignore file with the following contents:
/blanket.min.js
./blanket.min.js
*blanket.min.js
blanket.min.js
"blanket.min.js"
*blanket*
**/blanket*
*/blanket*
.\blanket.min.js
**\blanket*
*\blanket*
\blanket.min.js
\blanket*
.\blanket*
C:\Development\Projects\validator-test\blanket.min.js
C:/Development/Projects/validator-test/blanket.min.js
blanket.min.js still gets validated. Completely lost as to how this ignore file should be formatted.
The ignore list is used by the SuiteCloud IDE (IDE) to avoid having errors in the IDE for non-standard script ids in SuiteScript 1.0 APIs.
As an example...
nlapiLogRecord('customrecord_foo');
Since customrecord_foo is a non-standard record, it will be marked as an error by the IDE.
To tell the IDE to ignore customrecord_foo, the ignore list can be used.
It's a text file, with one script id per line.
customrecord_foo
customrecord_bar
The specified non-standard script ids in the ignore list file will not be flagged as an error by the IDE.

Error Importing a Symfony project in Eclipse

I'm trying to use Eclipse to work with Symfony2.
I'm used to Eclipse in Java but not really with PHP.
When I try to import a project with import wizard, everything is fine until the very few last moments, when I get this error :
As you can see, The error log panel is empty, and there is even no log file in my brand new workspace. (but it would appear if I get another error elsewhere)
Not my goal but it could provide some infos :
If I create a new Eclipse Symfony2 project from scrap, I get a fully working dummy website. Still, there remain 2 "redcross" errors:
cvc-complex-type.2.1: Element 'configurator' must have no character or element information item [children], because the type's content type is empty. (in /app/cache/dev/appDevDebugProjectContainer.xml line 2106) XML Problem
cvc-complex-type.2.4.a: Invalid content was found starting with element 'factory'. One of '{"http://symfony.com/schema/dic/services":file, "http://symfony.com/schema/dic/services":argument, "http://symfony.com/schema/dic/services":configurator, "http://symfony.com/schema/dic/services":call, "http://symfony.com/schema/dic/services":tag, "http://symfony.com/schema/dic/services":property}' is expected. appDevDebugProjectContainer.xml /rezdfezrdfrezdfr/app/cache/dev line 1265 XML Problem
cvc-complex-type.2.4.a: Invalid content was found starting with element 'factory'. One of '{"http://symfony.com/schema/dic/services":file, "http://symfony.com/schema/dic/services":argument, "http://symfony.com/schema/dic/services":configurator, "http://symfony.com/schema/dic/services":call, "http://symfony.com/schema/dic/services":tag, "http://symfony.com/schema/dic/services":property}' is expected.
(in /app/cache/dev/appDevDebugProjectContainer.xml line 1265)
Since it is not my goal right now, I'm didn't debug these errors yet, but I plan to. EDIT : as I saw on several SO posts, I disabled my project validators to ignore XML validation. No effect :-(
I think it is not the same as Error Importing a Symfony project in Eclipse with dubture plugin, since I dont get any log.
Do anybody know this problem and have a way to have the import wizard working ?
Thanks for any help.

I get errors when typing the #SidedProxy. What happened?

I am making a Minecraft Mod with Eclipse Mars and I got errors when typing the following:
#SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
What did I do wrong? It said "the attribute clientSide/serverSide is undefined for the annotation type SidedProxy" .
I cannot run Minecraft to test my mod without it, so I need to fix this error.
For a definitive answer you need to give us more information.
What version of minecraft forge are you using?
Have you correctly imported SidedProxy?
In eclipse, hold ctrl and click on #SidedProxy to open where it is declared, and check that you are using the correct attribute names (it may have changed between versions, so you may need to put something different)

How do I get Eclipse to ignore errors in WSDL file?

EDIT: To be clear, I want to get rid of the big red X on my project, not just filter the errors from the "Problems" list.
I get a bunch of these errors. How do I make Eclipse ignore them? I donøt have the option of fixing the actual problem :(
src-resolve.4.2: Error resolving component 'ser:char'. It was detected that 'ser:char' is in namespace 'http://schemas.microsoft.com/2003/10/Serialization/', but components from this namespace are not referenceable from schema document 'file:///Users/itunesuser/git/online-service-wizard/suppression-extension/src/main/resources/com/satorisoftware/ws/infuse/multiservice/multiservice.wsdl'. If this is the incorrect namespace, perhaps the prefix of 'ser:char' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:///Users/itunesuser/git/online-service-wizard/suppression-extension/src/main/resources/com/satorisoftware/ws/infuse/multiservice/multiservice.wsdl'. multiservice.wsdl /Scrubbr-suppression-extension/src/main/resources/com/satorisoftware/ws/infuse/multiservice line 623 WSDL Problem
Go to window > preferences search for validations(it is not under any menu) > scroll down for wsdl and uncheck the wsdl in the list see the screenshot like below.
Go to Properties, find Validation, switch off WSDL validation entirely.
Not ideal, but better than nothing.