0

I try to handle a Summernote Keyup event with this:

myEditor.addSummernoteKeyUpHandler(new SummernoteKeyUpHandler() {

        @Override
        public void onSummernoteKeyUp(final SummernoteKeyUpEvent event) {
            // TODO Auto-generated method stub
            log.fine("hello");
        }

    });

I get a UmbrellaException which is IMHO a class cast exception.

This is the call stack enter image description here

I identified the following spot where te cast failes:

@HasNoSideEffects
static native boolean canCast(Object src, JavaScriptObject dstId) /*-{
if (@com.google.gwt.lang.Cast::instanceOfString(*)(src)) {
   return !!@com.google.gwt.lang.Cast::stringCastMap[dstId];
} else if (src.@java.lang.Object::castableTypeMap) {
  return !!src.@java.lang.Object::castableTypeMap[dstId]; //<-- this returns false!!!
} else if (@com.google.gwt.lang.Cast::instanceOfDouble(*)(src)) {
  return !!@com.google.gwt.lang.Cast::doubleCastMap[dstId];
} else if (@com.google.gwt.lang.Cast::instanceOfBoolean(*)(src)) {
  return !!@com.google.gwt.lang.Cast::booleanCastMap[dstId];
}
return false;
}-*/;

dstId contains:

enter image description here

Any help greatly appreciated!

I tested this with a small demo which actually works. But in my large application, I get this exception and I don't see why.

Do you have any idea whats wrong here?

Best regards Hannes

HHeckner
  • 4,722
  • 4
  • 23
  • 33
  • You're stabbing in the dark when you don't need to. Turn the `-style` to `PRETTY` or `DETAILED` (this will help with a useful stacktrace instead of obfuscated). Then print the full stacktrace somewhere (of the umbrella exception, along with its causes), maybe using this info: http://stackoverflow.com/questions/13663753/turn-a-stack-trace-into-a-string – Andrei May 18 '17 at 07:24
  • Actually beginning with GWT 2.8. this does not work anymore. Instead I can actually debug the point where exception is thrown (actually it's a ClassCastException). so I have everything I need to have – HHeckner May 18 '17 at 18:55
  • Sorry but I disagree. I have in fact some gwt 2.8 apps where I do exactly what I've told you, when the error is more subtle. – Andrei May 18 '17 at 19:30
  • Hi, I need to apologize. You are right. In fact I had already -style DETAILED for the gwt compiler task set. But I hadn't set the style on the start command. Thank you. But please read the solution of the problem and you will be surprised. – HHeckner May 19 '17 at 04:06

1 Answers1

0

As Andrei suggested I set the style to DETAILED. I use Eclipse as a development environment. I decided to clean build the system (which I had done before). Now the problem has simply vanished !! Furthermore, I use SDBG (see: https://sdbg.github.io/) to debug my GWT application. This works pretty well (even without -style DETAILED). Now the very very strange thing remains. I can set breakpoints for my application and they all work well, except setting a breakpoint within the event handling method. I use a logger to print some text to the console, so I see that the event handler for summernote is actually called but the debugger will not stop. I checked whether the breakpoint is listed in the tab "Breakpoints" and it is and it is checked. I don't get it. Perhaps I have to rebuild all again.

But to keep long things short: The solution to the problem is probably to really issue a clean build and then hope for the best.

HHeckner
  • 4,722
  • 4
  • 23
  • 33