0

When running the errai-mvp-demo sample application via

mvn gwt:run 

I get this error:

java.lang.IllegalArgumentException: Something other than a Java object was returned from JSNI method '@com.google.gwt.core.client.impl.Impl::apply(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)': JS value of type boolean, expected java.lang.Object at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:178) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:271) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.google.gwt.core.client.impl.Impl.apply(Impl.java) at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337) at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeBoolean(ModuleSpace.java:184) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeBoolean(JavaScriptHost.java:35) at org.jboss.errai.common.client.util.LogUtil.isNativeJavaScriptLoggerSupported(LogUtil.java) at org.jboss.errai.common.client.util.LogUtil.log(LogUtil.java:29) at org.jboss.errai.ioc.client.Container.boostrapContainer(Container.java:45) at org.jboss.errai.ioc.client.Container.onModuleLoad(Container.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:396) at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363) at java.lang.Thread.run(Thread.java:722)

quarks
  • 33,478
  • 73
  • 290
  • 513

3 Answers3

1

I'm assuming you're working with Chrome.This seems to be a common problem with it. I had the same issue and switched to Firefox. I haven't seen the error since.

enrybo
  • 1,787
  • 1
  • 12
  • 20
  • Maybe there's another reason for this error, but a possibility is that your version of Firefox is very recent and the DevMode plugin is for an earlier version. In that case you may be able to fix it by updating your plugin or downgrading Firefox. – enrybo Feb 13 '13 at 12:06
0

If you are using Chrome,YES.This issue is with CHROME happens .

According to @Thomos Broyer relative to the same issue on Google groups:

https://groups.google.com/forum/?fromgroups=#!topic/google-web-toolkit/b0KbD8BNsqw

Quick Fix: switch from Chrome to Firefox for Dev Mode

And you can find the same question on Stackoverflow .See answer for that question also .

Community
  • 1
  • 1
Suresh Atta
  • 120,458
  • 37
  • 198
  • 307
0

If you are getting IllegalArgumentException, just make a few changes on client side model or bean.

Just mention package path when you returning the value with his data type.

public native final Boolean apply() /*-{
 return this.apply ? @java.lang.Double::Boolean(D)(this.apply) : null;
 }-*/;
Pang
  • 9,564
  • 146
  • 81
  • 122