UndeclaredThrowableException与仅客户端的Eclipse Scout应用程序 [英] UndeclaredThrowableException with a client only eclipse scout application

查看:52
本文介绍了UndeclaredThrowableException与仅客户端的Eclipse Scout应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to do a client only Eclipse Scout application.

我选择了菜单"New Scout Project…",在向导的第一步中,我仅进行了检查:

I selected the menu "New Scout Project…" and in the first step of the wizard I checked only:

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

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

Everything seems to be fine, but when I start my client application, I get following 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)

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

Why does the Client application needs to connect to a server that do not exists?

推荐答案

这是 Scout SDK 的问题.

创建新的侦查项目时,即使您在向导中未选中服务器,生成的客户端代码也依赖于服务器.

When you create your new scout project, the generated client code rely on a server, even if you have unchecked the server in the wizard.

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

You need to remove the elements that produce calls to the server.

<您的应用程序> .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);

<您的应用程序> .client.ui.desktop.Desktop 中,删除内部类:

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

仅客户端应用程序将启动.

Your client only application will start.

这篇关于UndeclaredThrowableException与仅客户端的Eclipse Scout应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆