Camel CXFRS コンポーネントを使用して Restful API を公開しようとしています。これはエンドポイント構成です:
cxfrs://http://0.0.0.0:8080/api?
resourceClasses=com.myApp.UserResource
&bindingStyle=SimpleConsumer
&performInvocation=true
&throwExceptionOnFailure=true
&staticSubresourceResolution=true
UserResource クラス:
@Component
@Produces({MediaType.APPLICATION_JSON})
@Path("/user")
public class UserResource {
@Autowired
private UserService userService;
@GET
@Path("/")
public List<User> list() { return userService.list(); }
}
上記のコードに問題があります:
userService が null です。つまり、自動配線は CXFRS リソース クラス内では機能しませんが、他の場所では正常に機能します。
どんな提案も大歓迎です!ありがとう。