The custom EnvironmentLoaderListener approach works fine as long as the
bean doesn't have a normal scope. If you really need to use a normal scope,
define an intermediary bean with the scope you need, declare the realm bean
as @Dependent, and inject the latter into the former. If you're using
alternatives for configuration beans, this approach dovetails quite nicely.

Reply via email to