カスタムコンテキストがあります:
public class MyContext {
public String doSomething() {...}
}
コンテキストリゾルバを作成しました:
@Provider
public class MyContextResolver implements ContextResolver<MyContext> {
public MyContext getContext(Class<?> type) {
return new MyContext();
}
}
今、リソースで私はそれを注入しようとしています:
@Path("/")
public class MyResource {
@Context MyContext context;
}
そして、次のエラーが表示されます。
SEVERE: Missing dependency for field: com.something.MyContext com.something.MyResource.context
同じコードは Apache Wink 1.1.3 では問題なく動作しますが、Jersey 1.10 では失敗します。
どんなアイデアでも大歓迎です。