Custom scope in CDI seems to require beans.xml

92 views Asked by At

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?

1

There are 1 answers

0
user1254591 On BEST ANSWER

I have packed custom scope as separate jar and placed beans.xml inside. Now its working fine.