Hello,

I've written a nice little generator to generate Overlay Types for
mementos (Rails-GWT interop), however I kept encountering a strange
exception any time I wanted to cast (or use in any way) a
JavaScriptObject to the generated class. The generated output was as
follows: ( gwt-mac-1.5.3 )


package hu.thepaw.presskit.client.worksheets;

public class OrderSheetJsonMemento extends
com.google.gwt.core.client.JavaScriptObject {
  protected  OrderSheetJsonMemento(){}  // Necessary, since Composer
doesn't allow to set the access flags flags for the generated class
  public final native  String getdeadline() /*-{ return
this.deadline; }-*/;
  public final native  String getcreated_at() /*-{ return
this.created_at; }-*/;
  /* ...BLAH-BLAH... */
}

Now each time the object is used is made:
JavaScriptObject mementoJSO=...
OrderSheetJsonMemento memento = mementoJSO.cast();

I get an exception (both hosted and deployed mode).

[ERROR] Uncaught exception escaped
java.lang.ClassFormatError: Illegal method name "<init>$" in class
hu/thepaw/presskit/client/worksheets/OrderSheetJsonMemento
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:520)
        at
com.google.gwt.dev.shell.CompilingClassLoader.findClass
(CompilingClassLoader.java:593)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
        at
hu.thepaw.presskit.client.worksheets.OrderSheetStoreImplementation.assignFromMemento
(transient source for
hu.thepaw.presskit.client.worksheets.OrderSheetStoreImplementation:67)
...BLAH-BLAH..

After a few hours of debugging it, I copied the generated file (from
the path specified by -gen) into the original classpath, the problem
disappears. All other generated code (including native methods in
"normal" (non-overlay) classes) works fine.

My guess is that some part of the transformation of Overlay Types is
done only prior to code generation. I am trying to fix this, however I
would like to ask the help of you fine gwt developers ( :) ) too: I
will be looking into the compiler's JSNI generator for my answers, if
anyone has any suggestions, please answer to this thread....



ps: I've already submitted a ticket for this:
http://code.google.com/p/google-web-toolkit/issues/detail?id=3383&can=4

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to