Eclipse Scout Neon : service registry does not con

2019-08-14 04:25发布

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,....

2条回答
Summer. ? 凉城
2楼-- · 2019-08-14 04:53

Solution: put scout.xml with default content in src/main/resources/META-INF folder of the server project.

Why did this happen? Since this is an extension we apparently forgot to copy this file and Scout Neon seems to ignore projects that don't contain this file.

Figured this out by putting a PlatformListener in that project and since that never triggered it was easier to track down the issue.

查看更多
Luminary・发光体
3楼-- · 2019-08-14 05:01

This annotation is requested for Remote-Service (see also the 3.5.1. @TunnelToServer section). The implementation class (or the interface) should have the @ApplicationScoped annotation.

For Local-Service, use either the @Bean or the @ApplicationScoped annotation to register the service.


If your annotations are correct, your Jandex index might be broken. Start the application with -Djandex.rebuild=true to rebuild the application on startup.

This will recalculate each of your target/classes/META-INF/jandex.idx files.

Of course, you can also delete each file manually. Running mvn clean also clean those files.

查看更多
登录 后发表回答