Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IDEA error "Managed bean must be a concrete class, or is annotated with @Decorator"

In my Java EE project I have a few abstract classes. IntelliJ IDEA underlines them red and tells me:

Managed bean must be a concrete class, or is annotated with @Decorator

A top-level Java class is a managed bean if it is defined to be a managed bean by any other Java EE specification, or if it meets all of the following conditions:

  • It is not a non-static inner class.
  • It is a concrete class, or is annotated @Decorator.
  • It is not annotated with an EJB component-defining annotation or declared as an EJB bean class in ejb-jar.xml.
  • It has an appropriate constructor—either:
    • the class has a constructor with no parameters, or
    • the class declares a constructor annotated @Inject.

I just want to use abstract classes, without any annotation. Although IntelliJ shows me that this is an error my JBoss server doesn't complain about it.

Any explanation?

like image 956
Adrian Krebs Avatar asked Feb 02 '16 10:02

Adrian Krebs


1 Answers

My guess is this is the Managed Bean Inconsistency errors inspection in Settings > Editor > Inspections > CDI (Contexts and Dependency Injection). Its severity is Error, so it will be underlined with a red squiggly line.

It seems you don't really care for this inspection, so just deselect it and save your changes.

like image 179
Kosi Avatar answered Oct 15 '22 07:10

Kosi