Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java GWT:ClassDefNotFound错误_Java_Gwt_Smartclient - Fatal编程技术网

Java GWT:ClassDefNotFound错误

Java GWT:ClassDefNotFound错误,java,gwt,smartclient,Java,Gwt,Smartclient,我正在尝试构建一个GWT/SmartClient小部件,它接受一组将呈现到仪表板中的项。。。根据具体的项目类型,它可能呈现为网格、图表、标签等。抽象类是 public abstract class DashboardItem<T> implements IsWidget { public abstract Widget render(T t); private T t; public DashboardItem(T t) { this.

我正在尝试构建一个GWT/SmartClient小部件,它接受一组将呈现到仪表板中的项。。。根据具体的项目类型,它可能呈现为网格、图表、标签等。抽象类是

public abstract class DashboardItem<T> implements IsWidget { 

    public abstract Widget render(T t);

    private T t;

    public DashboardItem(T t) {
        this.t = t;
    }

    @Override
    public Widget asWidget() {
        return render(t);
    }
}

天哪,莫利。。。问题是,不知何故,一个名为“server”的包被放入了客户机代码中。实际上有两个项目:xxx客户端和xxx服务器。所有的服务器都在其中,客户端在另一个中。不知怎的,这个服务器包最终出现在客户机代码中


啊。。。多么愚蠢

stacktrace或没有发生。什么是
数据源
,找不到什么类,您是否尊重客户机/服务器方面(即客户机源必须可转换为javascript)我也尝试了同样的方法,效果非常好。必须是您的DashboardService类在服务器包中,而不是在客户端包中。我也尝试了您的代码,它对我有效。我加入上述问题。如果你提供StackTrace可能会有帮助。当然,我可以稍后再获取StackTrace。实际上,DashboardService在客户端包中,而不是服务器中。也许我周围的环境有点不稳定。。。我似乎不明白DashboardService中有什么会冒犯GWT编译器。。。编译器没有有用的输出,即使在调试中也是如此。@RC:SmartClient的数据源文档:
public class DashboardGridItem extends DashboardItem<DataSource> {

    public DashboardGridItem(DataSource datasource) {
        super(datasource);
    }

    @Override
    public Widget render(DataSource datasource) {
         ...
    }
}
public class DashboardService {
    public List<DashboardItem<?>> getDashboardItems() {
        return new ArrayList<DashboardItem<?>>();
    }
}
08/14/2013 21:42:09 Uncaught Exception intercepted 
com.google.web.bindery.event.shared.UmbrellaException: Exception caught: com/trackmysports/server/service/impl/DashboardService
    at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:203)
    at com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java:88)
    at com.trackmysports.client.GeneralPage$3$1.onSuccess(GeneralPage.java:343)
    at com.trackmysports.client.GeneralPage$3$1.onSuccess(GeneralPage.java:1)
    at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:232)
    at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:258)
    at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:412)
    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:606)
    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:338)
    at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
    at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
    at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:279)
    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:242)
    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:606)
    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.reactToMessages(BrowserChannelServer.java:293)
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:547)
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
    at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.NoClassDefFoundError: com/trackmysports/server/service/impl/DashboardService
    at com.trackmysports.client.ContentPanelFactory.getContentPanel(ContentPanelFactory.java:80)
    at com.trackmysports.client.TrackMySports$3.onLogin(TrackMySports.java:91)
    at com.trackmysports.client.events.LoginEvent.dispatch(LoginEvent.java:27)
    at com.trackmysports.client.events.LoginEvent.dispatch(LoginEvent.java:1)
    at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)
    at com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40)
    at com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:193)
    ... 32 more
Caused by: java.lang.ClassNotFoundException: com.trackmysports.server.service.impl.DashboardService
    at com.google.gwt.dev.shell.CompilingClassLoader.findClass(CompilingClassLoader.java:1090)
    at com.google.gwt.dev.shell.CompilingClassLoader.loadClass(CompilingClassLoader.java:1196)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 39 more