1

I try to call scout service from Scout Form, so I create interface in shared folder

@TunnelToServer
public interface IPersonsFormService extends IService {

  void test();
}

and in server I created implementation of this interface

public class PersonsFormService implements IPersonsFormService {

  @Override
  public void test() {

    System.out.println("TEST");

  }

}

but I get

o.e.scout.rt.platform.exception.ExceptionHandler - SecurityException:service registry does not contain a service of type com.sixt.leasing.contract.scout.shared.person.IPersonsFormService [majorPrincipal: 'marko']
java.lang.SecurityException: service registry does not contain a service of type com.sixt.leasing.contract.scout.shared.person.IPersonsFormService

It looks like interface is not registered, but in Neon I thought that service is registered with @TunnelToServer annotation.

Where else should I register service ?

This project is extension project of main project.

In Main project all services works,....

4

2 回答 2

1

解决方案:将scout.xml默认内容放在src/main/resources/META-INF服务器项目的文件夹中。

为什么会这样?由于这是一个扩展,我们显然忘记了复制这个文件,而且 Scout Neon 似乎忽略了不包含这个文件的项目。

通过在该项目中放置一个 PlatformListener 来解决这个问题,因为这从未触发过,所以更容易追踪问题。

于 2016-01-11T14:01:34.673 回答
0

远程服务请求此注释(另请参见3.5.1.@TunnelToServer部分)。实现类(或接口)应该有@ApplicationScoped注解。

对于 Local-Service,使用@Bean@ApplicationScoped注释来注册服务。


如果您的注释是正确的,您的 Jandex 索引可能会损坏。启动应用程序以-Djandex.rebuild=true在启动时重建应用程序。

这将重新计算您的每个target/classes/META-INF/jandex.idx文件。

当然,您也可以手动删除每个文件。运行mvn clean也会清理这些文件。

于 2016-01-08T12:19:31.777 回答