0

Here is the exception that gets displayed on the Browser.

java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:423) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:530) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:368) at java.lang.Thread.run(Unknown Source) Caused by: com.google.gwt.core.client.JavaScriptException: (null) @gwt.material.design.jquery.client.api.JQuery::$(Lcom/google/gwt/dom/client/Element;)([JavaScript object(8)]): null at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:252) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:121) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:573) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:293) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at gwt.material.design.jquery.client.api.JQuery.$(JQuery.java) at gwt.material.design.jquery.client.api.JQuery.$(JQuery.java:167) at gwt.material.design.client.base.MaterialWidget.$this(MaterialWidget.java:157) at com.mdesign.vadiraj.client.MaterialDesignWithCarousel.onModuleLoad(MaterialDesignWithCarousel.java:32) ... 9 more

Here is the exception from Eclipse console.

14:34:14.799 [ERROR] [materialdesignwithcarousel] Unable to load module entry point class com.mdesign.vadiraj.client.MaterialDesignWithCarousel (see associated exception for details)

com.google.gwt.core.client.JavaScriptException: (null) @gwt.material.design.jquery.client.api.JQuery::$(Lcom/google/gwt/dom/client/Element;)([JavaScript object(8)]): null at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:252) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:121) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:573) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:293) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at gwt.material.design.jquery.client.api.JQuery.$(JQuery.java) at gwt.material.design.jquery.client.api.JQuery.$(JQuery.java:167) at gwt.material.design.client.base.MaterialWidget.$this(MaterialWidget.java:157) at com.mdesign.vadiraj.client.MaterialDesignWithCarousel.onModuleLoad(MaterialDesignWithCarousel.java:32) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:423) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:530) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:368) at java.lang.Thread.run(Unknown Source)

This is my project setup - Java 1.8 | GWT 2.8.1 | Classic dev-mode

inherits name="gwt.material.design.jquery.JQuery"

inherits name='gwt.material.design.GwtMaterialWithJQuery'

inherits name="gwt.material.design.GwtMaterialDesignBasic"

Attaching the code snippet from the Entrypoint class

public void onModuleLoad() {

    MaterialSlider slider = new MaterialSlider();
    RootPanel.get().add(slider);

    slider.add(new Label("safrfsdhhdf"));
    slider.add(new Button("I am a button"));
    slider.add(new TextArea());
    slider.add(new MaterialSwitch(true));
}
Vadiraj
  • 103
  • 1
  • 9

1 Answers1

2

GWT Material Design uses JsInterop which doesn't work in legacy dev mode (nobody should continue to use legacy dev mode these days anyway, it's been deprecated for years)

Thomas Broyer
  • 64,353
  • 7
  • 91
  • 164
  • To clarify slightly - there's no problem with using it, as long as you don't want to use any new features either, like Java 8+ support or JsInterop. For legacy projects that just want to keep using the exact same tooling and same features, it remains supported. We want to encourage those projects to still use latest GWT (for security updates, etc) even with legacy Dev Mode, but it you want to actually use the new features added in recent releases, you need to upgrade how you use your tools too. – Colin Alworth Feb 14 '19 at 14:21
  • Thanks for the clarification. I have been trying to move to superdev mode. It has its own disadvantages as there is no support for `1. Hot code replace (Which is supported by Classic dev mode) ` `2. Inspect variable values while debugging. (Which again supported by classic dev mode)` – Vadiraj Feb 18 '19 at 14:56