GWT upgrade from 2.1 to 2.4 - gwt

while compiling from GWT 2.1 to 2.4, the following error is shown:
Found interface com.google.gwt.core.ext.typeinfo.JClassType, but class was expected
so kindly provide me with the solution to this issue.

There's a binary backwards-incompatibility in GWT 2.2 (where com.google.gwt.core.ext.typeinfo.JClassType et al. were changed from classes to interfaces). You have to update your third-party dependencies with ones that have been compiled against the GWT 2.2 SDK or a newer version; for your own library or if the third-party lib has been somewhat abandoned, you'll have to recompile it (javac).
GIN for example provides 2 builds of its 1.5 release: one compatible with GWT 2.1.1 and older, and one compatible with 2.2 onwards (there are two distinct JARs in the gwt-1.5.zip download).

Related

UnsupportedClassVersionError on play with JDK 1.7

I am getting the same error as this post. i'm trying to resolve the problem as mentioned in the proposed solution but i didn't understand how ?
If you are using version 2.4.x (or newer), you must use Java 8. From the Highlights of version 2.4:
Play 2.4 now requires JDK 8. Due to this, Play can, out of the box, provide support for Java 8 data types. For example, Play’s JSON APIs now support Java 8 temporal types including Instance, LocalDateTime and LocalDate.
To confirm that you are using Play 2.4, see file project/plugins.sbt.
Edit:
If you can't (or don't want to) use Java 8, you have to use Play 2.3 instead. To do so, you must edit project/plugins.sbt to change the used version of Play:
// Notice we are now using version 2.3.10
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.10")
If this is a brand new project, you can recreate it using 2.3 template instead:
activator new play-scala-2.3 name-of-your-project
Or, for Java:
activator new play-java-2.3 name-of-your-project

Is Scala's inability to mix version in library fixed?

I have learned that Scala is suffering from a limitation, that all Scala bytecodes needs to be generated from same compiler version. e.g. I cannot have a library built for 2.9 to work with my application which is built by 2.9.1
http://lift.la/blog/scalas-version-fragility-make-the-enterprise
I tried to search from the web for more discussion on this issue but cannot find much updates. Is this issue, as in Scala 2.11.6, fixed in any extend?
In Scala, the 'middle' number in the version string is the major version, so in 2.10.x and 2.11.x, the major version is 10 and 11 respectively.
Major versions are binary compatible. Therefore, if you have a library compiled against Scala 2.11.0, you can safely use it in a project that uses 2.11.6 without recompilation, and vice versa. If your library was compiled for Scala 2.10.5, you would have to compile it newly to use in a Scala 2.11.x project.
If your code doesn't call into deprecated API, it should be source compatible with the subsequent major version.
Most libraries are published for at least two major versions at the same time, so there is quite a bit of elasticity. Take an example, Scalaz, it has its latest artifacts cross-built for Scala 2.9.3, Scala 2.10.x, and Scala 2.11.x.

Overload GWT Date_CustomFieldSerializer

I'm trying to overload the GWT "Date_CustomFieldSerializer" ( GWT 2.5.1 with maven2 and java1.6 ).
I've read that it is possible to overload a serializer by creating the same package structure inside your own project.
In my case I reproduce the package com.google.gwt.user.client.rpc.core.java.util to overload the class Date_CustomFieldSerializer but it does not seem to work well.
When serializing the Date, GWT Date_CustomSerializer is used but when the Date is deserialized my own "Date_CustomSerializer" is used.
If I delete the compiled Date_CustomFieldSerializer.class off gwt-user.jar and gwt-servlet.jar then my own Date_CustomFieldSerializer is always used but this is a bad solution, I am after a clean way to say to GWT that uses my own serializer always.
For delvelopment I use jetty and maven with the gwt-maven-plugin and in production mode I use weblogic.
I try to compile my own version of GWT but it fails when I try to run it, the server says:
[ERROR] Unable to initialize static dispatcher
java.lang.UnsupportedClassVersionError: com/google/gwt/core/client/JavaScriptObject$ : Unsupported major.minor version 51.0
How can I set it up to use my own serializer without GWT custom compilation?
Is your version first on the classpath?
It'a the version of Java.
You must compile the GWT Jar and your class with the same version of java.
The version 51 is the Java 7 version. (How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version)
But the GWT must be compiled with java 6.
You must set your java source to 1.6

What is the Difference between com.google.gwt.dev.Compiler and com.google.gwt.dev.GWTCompiler

When i go through the com.google.gwt.dev package i found that there are two compilers available in com.google.gwt.dev.
My need is to compile a GWT project programatically from my Java Application. Which one is suited?
GWTCompiler is the old entry point. The class has been deprecated for years, and has finally been removed starting with GWT 2.5.1-rc1.
Both the classes are the main executable entry point
for the GWT Java to JavaScript compiler.
But com.google.gwt.dev.GWTCompiler is deprecated
Use com.google.gwt.dev.Compiler (latest compiler from 2.5)
Here you can find the both classes api:
GWTCompiler // here you can find that its deprecated
Compiler

Migrating GWT 1.7 to GWT 2.4

I am trying to upgrade GWT from 1.7 to GWT 2.4 but I get build errors saying
Errors in 'jar:file:/C:/src/project/lib/gxt.jar!/com/extjs/gxt/ui/client/widget/Component.java'
[ERROR] Line 1280: Cannot reduce the visibility of the inherited method from Widget
Should I change the gxt version as well? I tried to change gxt to 2.2.5 and 2.2.6 but it doesn't work.
Yes, you do need to upgrade GXT. GXT 2.2.4+ should work. Check the release notes; they say GWT 2.3 support is introduced in GXT version 2.2.4.
http://dev.sencha.com/deploy/gxt-2.2.4/release_notes.html#Release_2.2.4
They also answer this in the forums.
http://www.sencha.com/forum/showthread.php?146796-GWT-2.4-compatibility