Cannot connect to RemoteNG Client. Check if old version of testng.jar is being used error-Eclipse Luna - testng-eclipse

I am getting an error like -
Cannot contact RemoteTestNG Client.Make sure you do not have older versions of testing.jar on your classpath.
Reason:Timeout while trying to contact RemoteTestNG.
I tried various solutions already present in stack overflow:
Check "Use project testng" option
Add latest testing.jar in classpath.
Check for duplicate testng jars in classpath.
Delete old testNG testsets ,clean workspace and restart workspace
But all the above solutions did not work for me and I ended up getting the same error again.
Please help me out here.

the latest release of testng eclipse 6.9.11 should fix this issue, please let me know (or fire an issue here https://github.com/cbeust/testng-eclipse/issues)
Noted: since this version, option "Use Project TestNG jar" was removed, to always respect the Project's TestNG lib.

Related

Can anyone help me fix this m2e-jdt/jdt bug?

Introduction
I have spend a lot of time to fix this bug
In our application we have a lot of generated code by cxf and jaxb which produces tons of warnings. We use the maven-build-helper plugin to add this code to our projects automatically.
By adding this enhancement, eclipse JDT enabled the possibility to set the javac -nowarn flag for specific source folders. Unluckily, by updating the maven project the flag gets lost. There are a few threads on SO where users got bugged by bug.
What I have tried so far
So i came up with a clever solution, javac has a nowarn flag. I set it to my maven-compiler-plugin and specified the directory. My maven build was fine, but my eclipse build wasn't. My research told me, that eclipse jdt does only use the maven-compiler-plugin source and target version. So my next step was to try to configure the EclipseCompiler, but this is not possible, because there is no possibility to add custom compiler Arguments in eclipse JDT.
Next Step. Inside of the .classpath file, eclipse JDT adds an ignore_optional_problems attribute for each ignored path. By updating the maven project inside of eclipse, this entry gets lost. So i started to write a maven "ignore-source-folder" plugin which should add the missing attribute. To run the plugin each time eclipse starts a build, i also created a m2e connector to refresh the .classpath file and everything should be fine.
By testing my plugin with my connector i realized, it works, but only 70% of the repetitions.
What happened?
Every time eclipse m2e/Jdt starts a new build, all classpath entries will be removed and populated again. When my maven plugin gets triggered by eclipse, a race condition starts.
So I started to analyze the code of jdt and m2e jdt. The ignore_optional_problems flag gets only once set manually inside of the patch which was provided to JDT and isn't stored somewhere else. By triggering a new build via m2e-jdt this information gets lost.
How to fix this problem
To fix this problem, some element has to be added or extended in jdt which contains all ignored folders. If a new build gets triggered and the classpath file gets newly generated by m2e-jdt this element should be checked for ignored paths. ClasspathEntryDescriptor seems to be a good place for it.
My problem
I checked out jdt and m2e jdt, but i have tons of errors inside of my IDE and i have no idea how to start. And even if I fix the code, I have no idea how to build and test it. I think my effort will be to high and we talk about 20 or 30 simple lines of code.
I am afraid if I add my results to the filed bug at eclipse, no one will care about it.
So, is there any developer able and willing to help me for this tiny job?
You need to "fix" the M2E's JDT project configurator. Probably somewhere in the m2e-core project. So, your change should obtain some kind of configuration flag from the project pom and create corresponding classpath entries for JDT.

Grails dependencies 'empty' in java build path STS

My coworker is attempting to install STS, groovy/grails onto his PC. He has imported a TFS project which grabbed the source fine. However he is getting lots of build errors that appear to be the result of the Grails Dependencies library being empty. He cleared .ivy2 cache and restarted STS which repopulated the .ivy2 cache. However, the dependencies are still empty under the build path (right click project, build path, libraries tab, expand Grails Dependencies).
He might be able to add them manually, but that doesn't seem like the appropriate solution and may cause issues down the line. Any ideas?
Select "Grails Tools -> Refresh dependencies" from the context menu of your project. Then the dependencies are added.
I had the same problem. It turned out that an undeclared class was causing the problem. One of the STS engineers responded that "if the command "grails compile" fails, then STS will not have the dependency data. This data is produced as a side effect of the compile command. So it doesn't get generated if the compile fails."
Basically, the entire Grails Dependency issue was a red herring. If you look at the Error Log (Window->View->Error Log or Window->View->Other: General->Error Log) check to see there is an undefined that is stopping the grails compile.

Groovy/Grails - Unable to Resolve Class

I am trying to build a Grails project in STS and am getting many error messages of the form: Groovy:unable to resolve class org.codehaus.groovy.grails.commons.ConfigurationHolder as well as others like Groovy:unable to resolve class org.grails.plugins.springsecurity.service.AuthenticateService
. I have Grails 1.3.7 selected in the Project Properties, but I don't see an item for 'Grails Depedencies' like I do when I create a sample project. Is this the problem? How can I add it back in?
I don't know why, but here are the steps I took to solve the problem:
Right click on the project and go to Grails Tools -> Enable Dependency Management
Grails Tools -> Refresh Dependencies. This correctly added the 'Grails Dependencies' library.
I still had plugin errors. I for some reason had to uninstall them and then reinstall them for the project to realize they were there.
For anyone who is using Grails >= 2.4
If you are using Grails 2.4 and above, use grails.util.Holders instead of org.codehaus.groovy.grails.commons.ConfigurationHolder.
Read the doc here section 'Static Holder'
Classes The following deprecated classes have been
removed from Grails 2.4.x:
org.codehaus.groovy.grails.commons.ApplicationHolder
org.codehaus.groovy.grails.commons.ConfigurationHolder
org.codehaus.groovy.grails.plugins.PluginManagerHolder
org.codehaus.groovy.grails.web.context.ServletContextHolder
org.codehaus.groovy.grails.compiler.support.GrailsResourceLoaderHolder
If you or any plugins you have installed are using these classes you
will get a compilation error. The problem can be rectified by updating
to new plugins and using grails.util.Holders instead.
If "Refresh Dependencies" has done all it can for you (as you indicate in your comment on the question), try disabling and re-enabling dependencies. You might try refreshing dependencies again afterward if the Acegi plugin still isn't recognized.
there is another way solved me this issue when i moved my workspace from Windows OS to Ubuntu , go to
yourWorkSpace -->yourGrailsProject-->setting folder --> org.grails.ide.eclipse.core.prefs,
then check all the grails paths are correct or not , because in my case all were pointing to windows paths ..
Hope this solve.
I faced a similar issue: "Unable to resolve class GrailsTestCase". I checked Grails Tools of my project and observed Dependency Management was already enabled (IDE - GGTS). I just disabled Dependency Management, refreshed and enabled it again. This solved the issue for me.

Eclipse RCP: How to troubleshoot plugin dependencies & classpath problems?

I am working on an RCP project based on eclipse. It has been working fine but recently I thought I'd upgrade it to use a new eclipse version (3.2 -> 3.5).
After a bit of trouble, it was running on the new platform. Then I did something. Don't know what. The end result is that I'm now getting a classpath error when one of my plugins (A) tries to access a class in one of the dependent plugins (B) (also one of mine).
As far as I can see, Plugin A has Plugin B in its' dependency list and the compiler shows no errors. To test, I created a new Plugin C with one class and accessed the class from Plugin A. That works fine.
Does anyone have any hints for troubleshooting such issues? A checklist of settings to check? I've been struggling with this for hours and getting nowhere! Particularly frustrating as it was working until I changed something!
Thanks
Update
I should also say that the project is quite old and uses the plugin.xml and not the manifest. Could this be a problem? Is there a way to upgrade?
Some ideas:
Clean-and-build every project (maybe after a restart of Eclipse)
Check, whether the required packages are also exported
Check the Error log, maybe there is some unloadable plug-in, etc.
Check the Run configuration, whether every required plug-in is present there
If the problem does not happen in a Runtime workbench, but in an Exported RCP app, then check whether you compile the project with the same settings during export than in Eclipse
I hope, something helps about these.
You can try the following in your run configuration:
In the Main tab check Clear (workspace) under Workspace Data
In the Configuration tab check clear the configuration area before launching under Configuration Area
This helps me every time I encounter some strange ClassNotFound errors.
If I understand you correctly you have no compiler errors but when you run you get class not found exceptions? You could try PDE Tools > Update Classpath from the project's context menu to see if you declared any dependencies outside of the MANIFEST.MF file, which would result in compiling code that fails at runtime.
I developed for RCP quite a long ago, but if I'm not wrong, since 3.4 or 3.5 you have to declare in the plugin configration which packages/classes are exported for dependent plugins and which are not.
This is unlike the old convention of using 'internal' in the package to mark non-exported packages.
Since you have plugin.xml from very old version of eclipse, it might be the problem, as exported resources from one plugin to another were not enforced in Eclipse RCP 3.2.
One more complement, hope it helps.
Open plugin.xml, check "build" tab, see how "binary build" are configured. It affects which files will compiled and exported.
See binary build here : http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Fguide%2Ftools%2Feditors%2Fmanifest_editor%2Fbuild.htm

Eclipse Galileo - JUnit missing

Build Path > Add Library > JUnit unable to add JUnit3 or JUnit4 components.
I see such message in the .log
!MESSAGE No property tester contributes a property projectPersistentProperty org.eclipse.team.core.repository to type class org.eclipse.core.internal.resources.Project
Eclipse Galileo installed by root user on Linux.
It works well for root and for other users except this JUnit issue.
Why it lost Junit?
(I've checked file permissions twice - all readable!)
This seems to be related to bug 239715, triggered by TypeExtensionManager.java, and due to some kind of plugins combination.
Could you check if your org.eclipse.core.expressions/.options file has the line
org.eclipse.core.expressions/debug/TypeExtensionManager=false
This should be enough to make that error message disappear.
That file is <eclipse-SDK-3.5-win32>\eclipse\plugins\org.eclipse.core.expressions_3.4.100.v20090429-1800.jar, and I just checked, it does contains the right option value (with latest Galileo) (are you using an older Galileo RC or Milestone release?).
Ah, I was getting this problem this morning. A search showed that it was possibly related to JGit/Egit. After updating the EGit plugin from 0.5 to 0.6, the errors have not returned.
You can make a variable junit or smtg similar to your customized one, add the junit folder to this varible, and give extension of it as junit4.8.1.jar.
I tried this and it works, but you have to delete any plugins of junit of version4 if present from plugins folder.