I have a producer field that returns an enum. Logically in the application, the value produced should be session scoped. However, if I annotate the producer @SessionScoped or @RequestScoped, I get the exception:
javax.enterprise.inject.UnproxyableResolutionException: The injection point field (foo) has non-proxyable dependencies
I'm assuming this is because my enum doesn't have a public no-arg constructor, which of course enums aren't allowed to have. So... is this a bug?
Yeah, you can't do that I guess. My suggestion is to store the Enum instance in a session scoped manager
bean, and then use a dependent producer field to expose it.