SwitchYard tooling error "Unresolvable Service Interface: The specified interface does not exist on the project classpath." in JBDS

Solution Verified - Updated -

Environment

  • Red Hat JBoss Fuse Service Works (FSW)
    • 6.x
  • Red Hat JBoss Developer Studio (JBDS)
    • 7.x
  • SwitchYard tooling

Issue

  • When I was trying to create a Bean service, I saw the following error from SwitchYard tooling in JBDS:
Unresolvable Service Interface: The specified interface does not exist on the project classpath.
  • The interface is definitely there, as follows:
public interface SampleService {
    public SampleResponse process1(String arg1, String arg2);
    public SampleResponse process2(String arg1, String arg2);
    public String process3(String arg1, String arg2);
}
  • When I was googling, I saw some people say it could be caused by SwitchYard bean service only supporting one argument on Java interface.
  • However, I could not find this in the FSW Development Guide.

Resolution

This error is shown because the Bean service interface has method signatures with multiple arguments. The Java method signature for a SwitchYard service operation must have a maximum of one Java parameter, as described in 14.8. Service Operations of FSW Development Guide, Volume 1.

To resolve the issue, you can combine multiple method arguments into one parameter object so that the interface matches the current limitation of SwitchYard like the following:

public interface SampleService {
    public SampleResponse process1(SampleRequest1 request);
    public SampleResponse process2(SampleRequest2 request);
    public String process3(SampleRequest3 request);
}

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments