How to get GWT Plugin running with Grails? - gwt

When using the grails GWT plugin I have trouble to get my dependencies refreshed.
I inserted
compile ":gwt:0.8"
into my BuildConfig.groovy and run: grails refresh-dependencies. My Grails version is 2.3M1.
The process stopps with the following error. How do I have to fix that?
| Loading Grails 2.3.0.M1
| Configuring classpath.
| Environment set to development.....
Gwt version 2.5.0 requested, downloading required dependencies
| Error Error loading event script from file [/Users/mg/Documents/Grails/GGTS-3.3M1- JUNO-4.2.2/testg23/target/work/plugins/gwt-0.8/scripts/_Events.groovy] No such property: resolveEngine for class: org.codehaus.groovy.grails.resolve.maven.aether.AetherDependencyManager (Use --stacktrace to see the full trace)
| Compiling 17 source files.
| Error Compilation error: startup failed:
Compile error during compilation with javac.
/Users/mg/Documents/Grails/GGTS-3.3M1-JUNO-4.2.2/testg23/target/work/plugins/gwt-0.8/src/java/grails/plugins/gwt/client/GwtActionService.java:3: error: package com.google.gwt.user.client.rpc does not exist
import com.google.gwt.user.client.rpc.RemoteService;
/Users/mg/Documents/Grails/GGTS-3.3M1-JUNO-4.2.2/testg23/target/work/plugins/gwt-0.8/src/java/grails/plugins/gwt/client/GwtActionService.java:12: error: cannot find symbol
public interface GwtActionService extends RemoteService {
symbol: class RemoteService
/Users/mg/Documents/Grails/GGTS-3.3M1-JUNO-4.2.2/testg23/target/work/plugins/gwt-0.8/src/java/grails/plugins/gwt/client/GwtActionServiceAsync.java:3: error: package com.google.gwt.user.client.rpc does not exist
import com.google.gwt.user.client.rpc.AsyncCallback;
/Users/mg/Documents/Grails/GGTS-3.3M1-JUNO-4.2.2/testg23/target/work/plugins/gwt- 0.8/src/java/grails/plugins/gwt/client/GwtActionServiceAsync.java:11: error: cannot find symbol
void execute(Action action, AsyncCallback callback);
symbol: class AsyncCallback
location: interface GwtActionServiceAsync
Note: /Users/mg/Documents/Grails/GGTS-3.3M1-JUNO-4.2.2/testg23/target/work/plugins/gwt-0.8/src/java/org/codehaus/groovy/grails/plugins/gwt/XMLJUnitResultFormatter.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
4 errors
1 error

I installed the gwt plugin with success. Steps:
Installed Grails 2.3.0.M1, created GRAILS_HOME.
Installed GWT SDK
Created env var GWT_HOME pointing to the gwt folder.
Created a new project
Changed BuildConfig.groovy, adding the dependency compile ":gwt:0.8"
Runned the command grails compile --refresh-dependencies

The default dependency resolution engine is changed to Aether in Grails 2.3.M1 (hence forth).
Since this is a milestone version there might be some hickups initially. If you want to fall back to maven or ivy as the dependency resolver, use
grails.project.dependency.resolver = "maven" // or ivy
Have a look at What's New in Grails 2.3.

Related

Compilation error in the Scala/Play example application for Heroku using Intellij

I am trying to compile the scala/Play framework example application on my local machine, but I am getting compilation errors when trying to compile using the SBT console in IntelliJ:
error: scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found.
I also got this message in the event log related to different SBT versions:
14:48 Started sbt shell with sbt version 0.13.18 instead of 0.13.11 configured by project.
Update sbt version
Disable version override
Any suggestions on how to fix this?
For the first error
error: scala.reflect.internal.MissingRequirementError: object java.lang.Object in compiler mirror not found.
You might want to try and ensure that you are using a compatible java version. Like #cbley suggested, try making you are using version 8 of the JDK.
For the second error
14:48 Started sbt shell with sbt version 0.13.18 instead of 0.13.11 configured by project.
Update sbt version
Disable version override
Its just suggesting you update the version of sbt (which is most likely declared in your build.properties file in a folder called project. You can just search for it by double tapping shift in IntelliJ. But you are safe to ignore it if you cloned some example repository as well.
check

Error when building Scala Maven project: Could not find or load main class scala_maven_executions.MainWithArgsInFile

Error when building a Maven project using maven-scala-plugin:
[ERROR] Error: Could not find or load main class scala_maven_executions.MainWithArgsInFile
Then reason is that settings.xml file was copied from Windows to OS X without modification, however it contained Windows-specific local repository path:
<localRepository>C:\Users\<username>\.m2\repository</localRepository>
Should be changed to:
<localRepository>/Users/<username>/.m2/repository</localRepository>

"Cannot be resolved to a type" after upgrading to GWT 2.7. and trying to compile a multi-project module

I´ve been having trouble getting the Super-Dev-Mode to work with GWT 2.7. and GXT 3.1.x The classical Dev-Mode starts without trouble, but the Super-Dev-Mode and GWT-compile the project won`t work.
I am currently working with Eclipse 4.4.2 with Java 1.7_2 on Windows.
So let´s pretend we have 2 GWT/GXT projects (no Maven) with GWT 2.6 and GXT 3.1.x (Projects are backuped on a repository).
One is called A and the other project is called B. Project A has many packages and no entrypoint (to just work as a library/framework), just an abstract entrypoint every other project has to extend. The other one is called B and inherits from A, the entrypoint extends the entrypoint of A.
When starting the project under GWT 2.6 in classical Dev-Mode the project works fine. When upgrading to GWT 2.7. it will work fine with the classical Dev-Mode, an even in Super-Dev-Mode the Codeserver starts to run, but when compiling the module i get an error that some code seems not to live under a package 'client' so i migrated it into a own package and added the sourcepath to the A.gwt.xml.
After fixing this error and starting the Super-Dev-Mode again (and when trying to GWT-compile) I get errors like this:
Ignored 15 units with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
Finding entry point classes
Tracing compile failure path for type 'com.example.b.client.B'
[ERROR] Errors in 'file:/C:/Workspace/ProjectB/src/com/example/b/client/B.java'
[ERROR] com.example.a.client.A cannot be resolved to a type
[ERROR] Errors in 'file:/C:/Workspace/ProjectA/src/com/example/a/view/ExampleLayout.java'
[ERROR] com.example.a.view.ILayout cannot be resolved to a type
[ERROR] Errors in 'file:/C:/Workspace/ProjectA/src/com/example/a/client/service/ExampleServiceAsync.java'
[ERROR] com.example.a.model.Examplemodel cannot be resolved to a type
[ERROR] Errors in 'file:/C:/Workspace/ProjectA/src/com/example/a/model/OtherExampleModel.java'
[ERROR] com.example.a.hibernate.model.ComOtherExampleModel cannot be resolved to a type
[ERROR] Errors in 'file:/C:/Workspace/ProjectB/src/com/example/b/client/service/OtherExampleServiceAsync.java'
[ERROR] com.example.a.model.NewExampleModel cannot be resolved to a type
...
(and many more)
Project A is included in the buildpath of the project B, when creating a custom run configuration where the project is added to "user entries" and adding source folders to "user" entries wont work. For the custom run configuration i used something like the following arguments:
"-src src/ -src ${workspace_loc:ProjectA} com.example.b.B"
And even:
"-src src/ -src ${workspace_loc:ProjectA} com.example.b.B com.example.a.A"
I widely searched for solutions and even tried to set up the workspace again, checkout the projects from the repository again, organize imports and even adding every package to the buildpath of A.
I also tried to add this to the .gwt.xml files didn´t work:
<add-linker name="xsiframe"/>
How can I solve the "cannot be resolved to a type" error?
I would really appreciate every form of help to get this problem done! Thanks!
One possible problem could be your version of GXT. If you are using GXT 3.1.1 (which was the latest GPL-release), then you can not use GWT 2.7.0.
Take a look at the version table:
GXT versions
As you can see, Sencha GXT 3.1.1 does not support GWT 2.7.0. The first GXT release which will support GWT 2.7.0 is GXT 3.1.2.

eclipse gives error on start up after adding sbteclipse plugin

I add sbt eclipse plug-in .First I created the project named hello the in project directory i created a file named plugins.sbt and add this line in it
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.5.0")
and after the sbt> I typed eclipse then it created the project for eclipse
when I open eclipse it gives me error message
An error has occurred. See the error log for more details
The org.eclipse.jdt.ui.javaElementFilters plug-in extension "scala.tools.eclipse.javaelements.ScalaElementFilter" specifies a viewer filter class which does not exist.
Plug-in org.scala-ide.sdt.core was unable to load class scala.tools.eclipse.javaelements.ScalaElementFilter.
An error occurred while automatically activating bundle org.scala-ide.sdt.core (806).
please help me to how to resolve this error and when I imported the sbt project eclipse give me another error
Building workspace has encountered a problem
Errors occurred during the build.
Error instantiating builder 'org.scala-ide.sdt.core.scalabuilder'.
Plug-in org.scala-ide.sdt.core was unable to load class scala.tools.eclipse.ScalaBuilder.
An error occurred while automatically activating bundle org.scala-ide.sdt.core (806).
Plug-in org.scala-ide.sdt.core was unable to load class scala.tools.eclipse.ScalaBuilder.
An error occurred while automatically activating bundle org.scala-ide.sdt.core (806).
Please help me
scala version 2.11.1
sbt version 0.13
I added the scala-IDE plugin from this source
http://scala-ide.org/download/current.html
i am using eclipse juno and pasted the following location in install new software
http://download.scala-ide.org/sdk/helium/e38/scala211/stable/site
my project compiles successfully in sbt
Are you using Eclipse Luna for Java Developers (as opposed to Eclipse Classic) AND Scala IDE 4.0 milestone 3? There is a known issue (solved in the nightly builds since then), reported on the mailing list here.
You can "fix" it by either upgrading the Scala plugin to a nightly build (they're pretty stable), or going with Eclipse Classic instead.

Unable to generate metamodel definitions using DataNucleus JPACriteriaProcessor from Eclipse

I'm trying to generate the metamodel definitions in Eclipse as documented on:
http://www.datanucleus.org/products/accessplatform/jpa/jpql_criteria.html
My project compiler level is set to 1.6 and the mentioned datanucleus jars are added to the factory path.
When the project builds I get the following error:
Errors occurred during the build.
Errors running builder 'Java Builder' on project 'X'.
Could not initialize class org.datanucleus.jpa.query.JPACriteriaProcessor
When using mvn compile the metamodel definitions are generated successfully, so it's probably related to Eclipse annnotation processing.
I'm using latest Spring Tool Suite 3.1.0.RELEASE based on Eclipse 4.2.1
Not put persistence-api.jar (or equivalent, such as Geronimo specs JPA2) in the Factory Path? Either way one of the deps is missing