user1254591
user1254591

Reputation: 21

Custom scope in CDI seems to require beans.xml

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?

Upvotes: 1

Views: 84

Answers (1)

user1254591
user1254591

Reputation: 21

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

Upvotes: 1

Related Questions