I created a custom scope in CDI.
@NormalScope(passivating = false)
@Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE,ElementType.METHOD,ElementType.FIELD})
@Inherited
public @interface MyScope { }
It works only if I had beans.xml
with in my deployment. Is this a must?
I have packed custom scope as separate jar and placed beans.xml inside. Now its working fine.