Vaadin 8 + compatibility = widgetset implementation missing for v7 componen

Hi,

I’ve been playing with the 8 release and loving the new API, huge KUDOS.

However I cannot seem to get the compatibility components to work.

I’ve created a simple app using:

mvn archetype:generate \
-DarchetypeGroupId=com.vaadin \
-DarchetypeArtifactId=vaadin-archetype-application \
-DarchetypeRepository=https://maven.vaadin.com/vaadin-prereleases \
-DarchetypeVersion=8.0.0.beta1

It worked fine (obviously). Then i wanted to add a Tree component to the UI, so I changed my pom.xml to include:

<dependency>
 <groupId>com.vaadin</groupId>
 <artifactId>vaadin-compatibility-server</artifactId>
</dependency>

<dependency>
 <groupId>com.vaadin</groupId>
 <artifactId>vaadin-compatibility-client-compiled</artifactId>
</dependency>

And changed the MyUI class by appending a simple Tree to the layout.

I’ve cleaned and run the project again (Widgetset was recompiled).

But when I launch the app instead of the Tree I get:


Widgetset ‘AppWidgetset’ does not contain an implementation for com.vaadin.v7.ui.Tree.

The above is for simplicity, I’m using spring-boot, so If there is some more action involved in making it work with boot please include it.

Hi, good to know that you are enjoying the new version :slight_smile: Check the following:

  • You have to
    replace
    the
    vaadin-server
    dependency with
    vaadin-compatibility-server
    .
  • If you are using the default widgetset (you are not compiling it by yourself):
    [list]

  • Replace
    the
    vaadin-client-compiled
    dependency with
    vaadin-compatibility-client-compiled
    .
  • Add
    @Widgetset(“com.vaadin.v7.Vaadin7WidgetSet”)
    to your UI implementations.

    [/list]
  • If you are using a custom widgetset:
    [list]

  • Replace
    the
    vaadin-client
    dependency with
    vaadin-compatibility-client
    .
  • Recompile it.


    [/list]

The key was the @Widgetset annotation, I got the Tree to work… but now it fails on Charts :frowning:

Widgetset ‘com.vaadin.v7.Vaadin7WidgetSet’ does not contain an implementation for com.vaadin.addon.charts.Chart…

I’m using 4.0.0-beta1 of charts, which work fine without @Widgetset(“com.vaadin.v7.Vaadin7WidgetSet”).

Log of widgetset compilation looks the same in both cases.

If you are using Vaadin Charts, that means you have a custom widgetset, so you cannot use the “default”
Vaadin7Widgetset
. I assume you have a module descriptor, say
com/example/Widgetset.gwt.xml
file. there, you should have at least:





When compiling with Maven this should be done automatically. You should also have the following in you UI implementation:


@Widgetset("
com.example.Widgetset
")
public class YourUI extends UI { … }

I tested it, and it works :slight_smile: For completeness, here’s the full dependencies section of the pom.xml file I used:




javax.servlet
javax.servlet-api
3.0.1
provided


com.vaadin
vaadin-push


com.vaadin
vaadin-themes


com.vaadin
vaadin-compatibility-server


com.vaadin
vaadin-compatibility-client


com.vaadin
vaadin-charts
4.0.0-beta1


I thought the dark days of XYZWidgetset.gwt.xml have ended since vaadin 7.7 - I for sure was glad having the configuration simplified. Too bad I had to reintroduce it again, is this temporary ?

Anyways I managed to have everything up and running according to your instructions.

However… everything is fine when using 8.0.0.beta1, but when I switch to 8.0-SNAPSHOT (which is what I REALLY want), I get an
OutOfMemoryError
:

[INFO] Compiling module MyAppWidgetset [ERROR] Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded [ERROR] at org.eclipse.jdt.internal.compiler.util.HashtableOfObject.<init>(HashtableOfObject.java:38) [ERROR] at org.eclipse.jdt.internal.compiler.codegen.ConstantPool.<init>(ConstantPool.java:309) [ERROR] at org.eclipse.jdt.internal.compiler.ClassFile.<init>(ClassFile.java:271) [ERROR] at org.eclipse.jdt.internal.compiler.ClassFilePool.acquire(ClassFilePool.java:45) [ERROR] at org.eclipse.jdt.internal.compiler.ClassFile.getNewInstance(ClassFile.java:259) [ERROR] at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:537) [ERROR] at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.generateCode(TypeDeclaration.java:636) [ERROR] at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.generateCode(CompilationUnitDeclaration.java:371) [ERROR] at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:872) I’ll try to increase memory available for maven using MAVEN_OPTS and post back, but anyway this not good news.

No luck.

I’ve set:
MAVEN_OPTS=-Xms512m -Xmx1512m
JAVA_OPTS=-Xms512m -Xmx1512m

But still got the error, above options do not seem to work on the vaadin-maven-plugin - the process crashes at ~680MB used memory.

Is there a memory configuration option for the vaadin-maven-plugin available ?

Hi,
the widgetset compilation runs in a forked process. To set memory allocation params try to use
-Dgwt.extraJvmArgs=“-Xms512m -Xmx1512m”
on command line or
extraJvmArgs
property in plugin configuration.

HTH
Marco

Thanks Marco, 1024m was enough.

Everything works.

I’ve created a pull request containing the above solution here
https://github.com/mike-goetz/spring-boot-vaadin/pull/2

I tested the jpacontainer-addressbook-demo with vaadin 8.1.1 and connat make it run.
Thanks to Alejandro’s hints I could fix the problems.
Now it’s runnung.

Where do you find these configuration files? I’m using Eclipse with Ivy

Thank you very much, this fixed my problem!

One small question: When we are using a custom Widgetset, do we still need the vaadin-compatibility-client-compiled? We currently have both the client and client-compiled in our pom.xml.

Greetings,
Kevin

You don’t need[font=courier new]

[/font]
vaadin

-compatibility-client-compiled
when using a custom widgetset. However you must inherit
com.vaadin.v7.Vaadin7WidgetSet
in your
.gwt.xml
module descriptor. See my previous answer for an example.

Yes, you need both. Vaadin client is needed for widget set compilation. Client-compiled is the library that is deployed with the Vaadin WidgetSets.