2013-08-15 5 views
0

대시 보드로 렌더링 될 항목 집합을 허용하는 GWT/SmartClient 위젯을 작성하려고합니다 ... 정확한 항목 유형에 따라 그리드, 차트,GWT : ClassDefNotFound 오류

public class DashboardGridItem extends DashboardItem<DataSource> { 

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

    @Override 
    public Widget render(DataSource datasource) { 
     ... 
    } 
} 

이 모든 : 등 추상 클래스 레이블, 나는 단지 데이터 소스 (그리드로 돌려)를 렌더링하는 방법을 알고 항목을 구현하기 위해 노력하고, 현재

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); 
    } 
} 

입니다 괜찮을 것 같습니다. 자, 나는 일부 소스에서 대시 보드 항목을 가져 오는 데 사용하고자하는 클래스가 있습니다. 결국이 클래스를 데이터베이스가 되길 원합니다.하지만 지금은 하드 코딩 된 빈 배열을 사용하고 싶습니다.

public class DashboardService { 
    public List<DashboardItem<?>> getDashboardItems() { 
     return new ArrayList<DashboardItem<?>>(); 
    } 
} 

난 데 문제는 내가 항상 내 코드의 나머지 부분과 같은 프로젝트에 앉아있는 사실에도 불구하고 위의 클래스에 대한 ClassDefNotFound의 오류가 발생하고 있다는 것입니다 : 여기에 클래스입니다. 클라이언트 코드에서 이것이 허용되지 않는 이유는 무엇인지 분명하지 않습니다 ... 와일드 카드를 제거하려고 시도했지만 여전히 동일한 오류가 발생합니다.

아무도 아이디어가 있습니까? 나는 두뇌 방귀가 여기에서 계속하고있는가? 요청으로

, 스택 트레이스 :

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 
+0

stacktrace 또는 발생하지 않았습니다. 'DataSource' 란 무엇이며, 어떤 클래스가 발견되지 않습니까? 클라이언트/서버 측면을 존중합니까 (예 : 클라이언트 소스는 자바 스크립트로 변환 가능해야합니다) –

+1

나는 똑같이 시도해 보았고 완벽하게 작동합니다. DashboardService 클래스가 클라이언트 패키지가 아닌 서버 패키지에 있어야합니다. – mlkammer

+0

나는 또한 귀하의 코드를 시도하고 그것은 나를 위해 작동합니다. 위의 질문에 동참합니다. StackTrace를 제공하면 도움이 될 수 있습니다. – Artem

답변

0

성령 아니네은 ... 문제는 어떻게 든 '서버'라는 이름의 패키지는 클라이언트 코드에 넣고이었다. 실제로 xxx-client와 xxx-server라는 두 개의 프로젝트가 있습니다. 모든 서버 내용은 하나에 있고 클라이언트는 다른쪽에 있습니다. 여하튼이 서버 패키지는 클라이언트 코드에서 끝났습니다.

멍청한 ...