The forum was putting random new postings as replies to my question..
so I'm trying again:

Hi,

I need to create my own date class to handle UTC. When I try to
construct a MyDate object,
I get a "java.lang.NoSuchFieldError: mydate"  exception in this code:

private native void init(double date) /*-{
    this.mydate = new Date(date);
  }-*/;

Anybody know why?

thanks for any help
-Ben

PS.

Here's the exception:

[WARN] Malformed JSNI reference 'mydate'; expect subsequent failures
java.lang.NoSuchFieldError: mydate

at com.google.gwt.dev.shell.CompilingClassLoader
$DispatchClassInfoOracle.getDispId(CompilingClassLoader.java:119)
        at
com.google.gwt.dev.shell.CompilingClassLoader.getDispId(CompilingClassLoader.java:
531)
        at
com.google.gwt.dev.shell.moz.GeckoDispatchAdapter.setField(GeckoDispatchAdapter.java:
105)
        [..skipped..]
        at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:
107)
        at edu.mit.ll.wx.share.client.MyDate.init(MyDate.java)
        at edu.mit.ll.wx.share.client.MyDate.<init>(MyDate.java:23)
        at edu.mit.ll.wx.share.client.Main.onModuleLoad(Main.java:205)
        [..skipped..]
        at com.google.gwt.dev.shell.moz.BrowserWidgetMoz.access
$000(BrowserWidgetMoz.java:35)

Here's my code:

public class MyDate
{

  public MyDate(long millisec) {
    init(millisec);
  }

 private native void init(double date) /*-{
    this.mydate = new Date(date);
  }-*/;

  public native int getUTCFullYear() /*-{
    return this.mydate.getUTCFullYear();
  }-*/;
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
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