Hi everyone !
I need to optimize my UI performances (loading). After some searches, I tryed to use the following tutorial to optimize my widgetset loading and therefore my UI loading : https://vaadin.com/book/vaadin7/-/page/mobile.optimization.html
But I’m getting issues in setting up this optimization because my project achitecture is made with maven with the command :
$ mvn archetype:generate \ -DarchetypeGroupId=com.vaadin \ -DarchetypeArtifactId=vaadin-archetype-application \ -DarchetypeVersion=7.4.0 \ -DgroupId=your.company \ -DartifactId=project-name \ -Dversion=1.0 \ -Dpackaging=war
So I have three projects for my application : UI, the Production & Widgetset.
I followed the previous tutorial and then I made two packages in my projects :
In my UI project, I have a package containing my loading optimization class like :
com.myproject.ui.optimization.OptimizedConnectorBundleLoaderFactory.java
And in my Widgetset project, I have a package containing :
com.myproject.widgetset.MyAppWidgetset.gwt.xml
As in the tutorial I put the following code in the MyAppWidgetset.gwt.xml file :
<generate-with class="com.myproject.ui.optimization.OptimizedConnectorBundleLoaderFactory">
<when-type-assignable class="com.vaadin.client.metadata.ConnectorBundleLoader" />
</generate-with>
But when I try to compile my project (including the widgetset compilation), I am not able to find my OptimizedConnectorBundleLoaderFactory.java class and I get the error :
[i]
[INFO]
— vaadin-maven-plugin:7.4.0:compile (default) @ MyProject-widgetset —
[INFO]
auto discovered modules [com.myproject.widgetset.MyAppWidgetset]
[INFO]
Loading inherited module ‘com.myproject.widgetset.MyAppWidgetset’
[INFO]
[ERROR]
Line 6: Unable to load class ‘com.myproject.ui.optimization.OptimizedConnectorBundleLoaderFactory’
[INFO]
java.lang.ClassNotFoundException: com.myproject.ui.optimization.OptimizedConnectorBundleLoaderFactory
[/i]
Then I tryed many different way to access to my OptimizedConnectorBundleLoaderFactory.java class in my MyAppWidgetset.gwt.xml file (like ) but I can’t get rid of the previous error.
So how can I specify in where my class is (as it is in another project folder) or where should I put my OptimizedConnectorBundleLoaderFactory.java class ?
EDIT:
There is a dependency in my UI project that includes the widgetset like :
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>MyProject-widgetset</artifactId>
<version>${project.version}</version>
</dependency>
But there isn’t dependency including the UI project in the widgetset one. That’s probably why I can’t access to my OptimizedConnectorBundleLoaderFactory.java class because it is in the UI project. So I guess I should put the OptimizedConnectorBundleLoaderFactory.java class in the widgetset project and I tryed it but it still doesn’t work !
Thanks for your help !
Tom