I have problem with touchkit addon.
Touchkit has OfflineModeEntrypoint class. In that class is timer scheduled for 5 seconds and after that if applicaiton didn’t start the followed message is shown:
“The server cannot be reached
The application didn’t start properly”
Could someone please tell me what should I do to increase this time or disable this message?
Unfortunately the 5 second timeout is not directly configurable. What you can do though, is use
GWT’s deferred binding and replace the entry point with your own custom class. So, in your *.gwt.xml, do something like:
public class MyCustomOfflineModeEntrypoint implements EntryPoint {
@Override
public void onModuleLoad() {
System.out.println("Here I am!");
}
}
[/code]1)
In my *.gwt.xml I added:
<replace-with class="com.example.client.MyCustomOfflineModeEntrypoint">
<when-type-is
class="com.vaadin.addon.touchkit.gwt.client.offlinemode.OfflineModeEntrypoint" />
</replace-with>
And I have following error during building:
[INFO]
Compiling module ui.widgetset.DashboardfrontendWidgetset
[INFO]
Validating units:
[INFO]
Ignored 1 unit with compilation errors in first pass.
[INFO]
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
[INFO]
[ERROR]
Unexpected internal compiler error
[INFO]
java.lang.NoClassDefFoundError: com.example.client.MyCustomOfflineModeEntrypoint
[INFO]
at com.google.gwt.dev.jjs.impl.UnifyAst.searchForTypeBySource(UnifyAst.java:981)
[INFO]
at com.google.gwt.dev.jjs.impl.UnifyAst.addRootTypes(UnifyAst.java:531)
[INFO]
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:680)
[INFO]
at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:33)
[INFO]
at com.google.gwt.dev.Precompile.precompile(Precompile.java:278)
[INFO]
at com.google.gwt.dev.Precompile.precompile(Precompile.java:229)
[INFO]
at com.google.gwt.dev.Precompile.precompile(Precompile.java:141)
[INFO]
at com.google.gwt.dev.Compiler.run(Compiler.java:232)
[INFO]
at com.google.gwt.dev.Compiler.run(Compiler.java:198)
[INFO]
at com.google.gwt.dev.Compiler$1.run(Compiler.java:170)
[INFO]
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:88)
[INFO]
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:82)
[INFO]
at com.google.gwt.dev.Compiler.main(Compiler.java:177)
2)
In my *.gwt.xml I added:
<replace-with class="com.vaadin.addon.touchkit.gwt.client.offlinemode.MyCustomOfflineModeEntrypoint">
<when-type-is class="com.vaadin.addon.touchkit.gwt.client.offlinemode.OfflineModeEntrypoint" />
</replace-with>
During project building I got following message:
[INFO]
Compiling module ui.widgetset.MyWidgetset
[INFO]
Validating units:
[INFO]
Ignored 1 unit with compilation errors in first pass.
[INFO]
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
[INFO]
[ERROR]
Could not find module entry point class 'com.vaadin.addon.touchkit.gwt.client.offlinemode.OfflineModeEntrypoint'
With deferred binding you always have to extend the class you’re replacing, just implementing the same interfaces isn’t enough. Sorry if I was unclear on that earlier. So, instead of
public class MyCustomOfflineModeEntrypoint implements EntryPoint {
do this:
public class MyCustomOfflineModeEntrypoint extends OfflineModeEntrypoint {
Then it should compile just fine.
As for the package names, they shouldn’t matter as long as the class is in the source path of your module. If I were you though, I’d use the default source path which is the
client package inside the package your *.gwt.xml file is in.