Ninjaframework MVC 控制器继承和路由

Ninjaframework MVC Controller inheritance and routing

在我的 Ninja Web 应用程序中,我有一个用于 CRUD 操作的通用控制器。

通用接口:

interface GenericCrudController <T, PK> {
    Result read(PK id);
}

抽象控制器:

abstract class AbstractCrudController<T, PK extends Serializable> implements GenericCrudController<T, PK>{
    @Override
    public Result read(PK id) {
        return null;
    }
}

Foo 控制器:

@Singleton
@Path("/foo")
public class FooController extends AbstractCrudController<FooDto, Long>{
    @Path("/{id}")
    @GET
    @Override
    public Result read(@PathParam("id") Long id) {
    }
}

当我 运行 我的 ninja webapp 时,出现了这个错误:

[NinjaJetty] ERROR ninja.RouteBuilder - Error in route configuration!!!
[NinjaJetty] ERROR ninja.RouteBuilder - Can not find Controller controllers.FooController and method read
[NinjaJetty] ERROR ninja.RouteBuilder - Hint: make sure the controller returns a ninja.Result!
[NinjaJetty] ERROR ninja.RouteBuilder - Hint: Ninja does not allow more than one method with the same name!
[NinjaJetty] ERROR ninja.RouteBuilder - Error in route configuration!!!
[NinjaJetty] ERROR ninja.RouteBuilder - Can not find Controller controllers.FooController and method read
[NinjaJetty] ERROR ninja.RouteBuilder - Hint: make sure the controller returns a ninja.Result!
[NinjaJetty] ERROR ninja.RouteBuilder - Hint: Ninja does not allow more than one method with the same name!
[NinjaJetty] ERROR ninja.RouteBuilder - Can not find Controller controllers.FooController and method read
[NinjaJetty] ERROR ninja.RouteBuilder - Hint: make sure the controller returns a ninja.Result!
[NinjaJetty] ERROR ninja.RouteBuilder - Hint: Ninja does not allow more than one method with the same name!

提前致谢

这似乎是一个 java 错误。查看错误报告 java 8 and java 6.