2

我正在尝试做一个仅限客户端的 Eclipse Scout 应用程序。

我选择了菜单“New Scout Project...”,在向导的第一步中我只检查了:

  • com.company.app.ui.swt
  • com.company.app.client
  • com.company.app.shared

一切似乎都很好,但是当我启动我的客户端应用程序时,我得到了 Stacktrace:

!ENTRY org.eclipse.scout.rt.client 4 0 2014-07-09 15:35:06.078
!MESSAGE org.eclipse.scout.rt.client.AbstractClientSession.startSession(AbstractClientSession.java:257) load session
!STACK 0
java.lang.reflect.UndeclaredThrowableException
    at com.sun.proxy.$Proxy17.getAllCodeTypeClasses(Unknown Source)
    at org.eclipse.scout.rt.client.services.common.code.CodeServiceClientProxy.getAllCodeTypeClasses(CodeServiceClientProxy.java:333)
    at org.eclipse.scout.rt.client.services.common.code.CodeServiceClientProxy.getAllCodeTypes(CodeServiceClientProxy.java:354)
    at org.eclipse.scout.rt.shared.services.common.code.CODES.getAllCodeTypes(CODES.java:97)
    at com.company.app.client.ClientSession.execLoadSession(ClientSession.java:33)
    at org.eclipse.scout.rt.client.AbstractClientSession.startSession(AbstractClientSession.java:252)
    at org.eclipse.scout.rt.client.services.common.session.internal.ClientSessionRegistryService$1.runVoid(ClientSessionRegistryService.java:64)
    at org.eclipse.scout.rt.client.ClientJob.runStatus(ClientJob.java:189)
    at org.eclipse.scout.rt.client.ClientJob.runTransactionWrapper(ClientJob.java:172)
    at org.eclipse.scout.rt.client.ClientJob.run(ClientJob.java:159)
    at org.eclipse.scout.commons.job.JobEx.runNow(JobEx.java:51)
    at org.eclipse.scout.rt.client.services.common.session.internal.ClientSessionRegistryService.createAndStartClientSession(ClientSessionRegistryService.java:68)
    at org.eclipse.scout.rt.client.services.common.session.internal.ClientSessionRegistryService.newClientSession(ClientSessionRegistryService.java:39)
    at org.eclipse.scout.rt.ui.swt.AbstractSwtEnvironment$4.run(AbstractSwtEnvironment.java:539)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

为什么客户端应用程序需要连接到不存在的服务器?

4

2 回答 2

0

新项目向导Scout SDK并不真正适合创建仅客户端应用程序。您需要在某些地方手动调整生成的代码。

Scout 书中描述了最简单(也是最有限)的方法,我们在其中描述了一个 Scout 小部件演示应用程序。

要获得更详细的答案,您可能需要阅读此论坛帖子

于 2014-07-09T15:47:26.790 回答
0

这是一个问题Scout SDK

当您创建新的 scout 项目时,生成的客户端代码依赖于服务器,即使您在向导中取消选中了服务器。

您需要删除产生对服务器的调用的元素。

<your app>.client.ClientSession.execLoadSession()删除行:

setServiceTunnel(new ClientHttpServiceTunnel(this, UriUtility.toUrl(getBundle().getBundleContext().getProperty("server.url"))));

//pre-load all known code types
CODES.getAllCodeTypes(com.company.app.shared.Activator.PLUGIN_ID);

<your app>.client.ui.desktop.Desktop删除内部类:

@Order(25)
public class BookmarkMenu extends AbstractBookmarkMenu {
  public BookmarkMenu() {
    super(Desktop.this);
  }
}

您的仅限客户端的应用程序将启动。

于 2014-07-09T16:10:48.797 回答