Grails setup in eclipse - incompatible compiler - eclipse

When I create a new Grails projects I receive the attached popup
Is 1.8.0.xx not a valid version?

Groovy 1.8 is introduced in Grails 2.0, though it still should work with Grails 1.3.7, but as statement says it might break.

Related

Eclipse not recognizing the new jars when migrating from Play Framework 2.4.2 to 2.5.0

I've been trying to migrate from Play 2.4 to 2.5 by following the Migration Guide, and I've upgraded my sbt version to 0.13.11 and ensured that I'm using Scala 2.11. I believe I've been able to successfully migrate to 2.5 because I've changed my routes to fit the new default InjectedRoutesGenerator, but I can't seem to use the new play.libs.streams.Accumulator in a custom BodyParser I want to make.
Any ideas as to why I might not be able to reference Accumulator? If it helps, even when I clean, build, and refresh my project in Eclipse, the referenced jars stay as <jar_name>_2.11-2.4.2.jar.

Class not found when using JAX-RS with Eclipse and Glassfish

I am using Eclipse Luna (versions 4.4.2) and Glassfish 4 to build a REST web-app using JAX-RS.
The following piece of code, which is just a very simple post to the REST api that was previously working just fine, has started throw a very strange error:
#POST
public Response addToWatchlist(WatchlistEntry watchlistentry)
{
return Response.ok(watchlist_service.addToWatchlist(watchlistentry).toString()).build();
}
The error is below:
Warning: StandardWrapperValve[Jersey Web Application]: Servlet.service() for servlet Jersey Web Application threw exception
java.lang.ClassNotFoundException: javax.xml.parsers.ParserConfigurationException not found by org.eclipse.persistence.moxy
All I have been able to find out about this is this webpage:
https://java.net/jira/browse/JERSEY-2888
One of the comments says this has been fixed in EclipseLink 2.6.1 and Jersey 2.19.
I am pretty new to using MAVEN and eclipse - assuming the above is correct, how do I get my Maven Project in Eclipse to update the Jersey version? Also how do I update the EclipseLink version? Their site only seems to have version 2.6.0 available: http://www.eclipse.org/eclipselink/#download
I assume all this can be done through eclipse itself?
All help appreciated!
EDIT 1: It seems like eclipselink 2.6.1 has been released on Oct 15th 2015, as you can see here: http://www.eclipse.org/eclipselink/releases/
However, as you can see here, it doesn't seem to have been incorporated into eclipse for "help -> update software": http://download.eclipse.org/rt/eclipselink/updates/
Which is highly annoying.
I am building my REST website, and no PUT or POST will work because of this error.
Does anybody know how to get 2.6.1 working? I am using a Maven jersey-quickstart-webapp Project.
This bug is a royal pain in the face.
EDIT 2: I've got a hack working today. When I check programmtically what version of eclipselink is being used at runtime like below, it tells me it is version 2.6.1, even though the bug remains:
Class<?> myClass = Class.forName("org.eclipse.persistence.Version");
Method myMethod = myClass.getMethod("getVersion");
String version = myMethod.invoke(null).toString();
System.out.println("version = " + version);
In a related question (How to find what version of EclipseLink my Eclipse Project is using?) I found out how to find the actual jar files glassfish is using for eclipse. They are in the glassfish/modules directory. Inside the org.eclipse.persistence.core.jar file has will be a readme.html which tells you the version of eclipselink that glassfish is using. For me it was 2.6.
I manually updated the org.eclipse.persistence.core.jar and the org.eclipse.persistence.moxy.jar file with the latest versions from the maven site. While this is quite hacky, as I don't know what else is effected by doing this, it does get over this problem. If I find out the correct way to do this, I will write an answer below, for all and sundry.
Going through the Jersey JIRA and eclipse link website it seems like Eclipse link 2.6.1 is still under development i.e. not yet released. That's why its not available for download.
To use an updated version of Jersey in maven you need to give depending to the newer version 2.19 in your pom.xml.
But, since eclipse link 2.6.1 is yet to be released, even if you use newer version of Jersey it might be of little use. But still you can give it a try.
To update version of jersey, find the following dependency and update the value of version tag in your pom.xml file
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>2.22.1</version>
</dependency>
Which server are you deploying your project into? I've had A LOT of problems with Glassfish 4.1.1 (incluiding that error). I downgraded to 4.1 and everything runs fine. It may be due to a problem with 4.1.1 newest modules (jars incluided in the server). I hope it helps. Its not the best solution but for me was a temporary workaround 'till I find which modules are failing.
The problem was solved by updating the version of eclipselink that glassfish was using. Eclipse updated it's version, but glassfish needs it's own update. The list of jar files that need to be placed in the glassfish/modules directory is given in this answer: How to change EclipseLink in GlashFish 4.0?

Grails 3.0.1 add in Eclipse show error Specified directory does not appear to be a Grails installation

When I try to install/import Grails 3.0.1 in Eclipse I get error message
"Specified directory does not appear to be a Grails installation".
I already have installed Groovy Compiler 2.4.3. but still get same error message.
How I can install Grails 3.0.1 in Eclipse 4.4?
At grails folder you can put a file "build.properties",
/grails-3.0.1/build.properties
/install
/license
/.......
the content of this file is a single line "grails.version=3.0.1", without quotes. :-)
Now eclipse will recognize it as Grails installation.
Regards
Grails 3 is very different from earlier versions of Grails, in particular being based on Spring Boot. It will be a while before the IDEs have support for Grails 3. Eclipse will probably not have support for Grails 3 as 3.6.4 has been announced as the last release of GGTS and the Grails and Groovy tooling now that Pivotal has abandoned Grails and Groovy.
I use the lattest ggts from sping (3.6.4) the gradle plugin (installed over the spring dashboard) and the latest snapshot release of the groovy plugin for eclipse to get a groovy 2.4 compiler.
With this setup import your grails3 application as gradle application works for me.
Here are the steps for working with Grails 3 in Eclipse.
1) Get latest grails 3.X version and setup in the system.
2) Now create grails app using command line.
3) Install Gradle plugin in eclipse if not already there.
4) Import project as Gradle in eclipse, Gradle will download all required dependencies.

converting JPA 1.0 to JPA 2.0

In eclipse ,I am trying to upgrade my JPA from 1.0 to 2.0 (EJB project). I have made changes in the library and using eclipselink also but when I am again creating a project it is not giving an option of JPA 2 in faclets to select
any one have some idea whats the problem
It will depend on the version of Eclipse, and the weblogic plugin (OEPE) you are using. Without the correct connectors Eclipse is only aware that WebLogic server can run JPA1.0.
Perhaps try the latest version of OEPE pack here and point it at your workspace.
You also need to make sure the version of WebLogic you are using supports JPA2- you have tagged the question as weblogic 10.x which only supports JPA2.0 in 10.3.4 and later, and may require you to patch weblogic to enable the support.

Validator id is not registered

i am getting this warning in eclipse:
Validator id is not registered
on the line:
<f:validator validatorId="confirmPasswordValidator" />
i am using JSF 2, and tomcat 6
and my el-impl library is org.glassfish.web
any ideas why ?
and how to solve it ?
Ignore and run it. Eclipse is relying on it being present as <validator> declaration in faces-config.xml the JSF 1.x way. It does by default not recognize #FacesValidator and likes yet and therefore don't see it already being registered by new JSF 2.x annotations. The upcoming newer Eclipse versions will.
You could consider to turn off JSF validation in Eclipse preferences, it will only lead to more confusion and annoyances. The upcoming JBoss Tools plugin 3.3 (currently still in beta) will support JSF annotations like #FacesValidator, #ManagedBean, etc.
Note that this is in no way related to EL. You aren't using #{} anywhere.