You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the managed bean class is a generic type, it must have scope @dependent. If a managed bean with a parameterized bean class declares any scope other than @dependent, the container automatically detects the problem and treats it as a definition error.
Check if managed bean is of generic/parameterized type
Check if dependency class is annotated with @Dependent or has no other scope specified
If not, deliver an error at the class declaration
Quickfixes
Suggest removing scope
Example
@ApplicationScoped// Error here due to the generic typepublicclassGreeting<T>{
publicStringgreet(Stringname) {
return"GreetingA, " + name;
}
}
[INFO] [ERROR ] CWWKZ0004E: An exception occurred while starting the application demo-servlet. The exception message was: com.ibm.ws.container.service.state.StateChangeException: org.jboss.weld.exceptions.DefinitionException: WELD-000071: Managed bean with a parameterized bean class must be @Dependent: class io.openliberty.sample.jakarta.di.error.generic.Greeting
Managed Beans
Diagnostics
@Dependent
or has no other scope specifiedQuickfixes
Example
Related to #153
The text was updated successfully, but these errors were encountered: