23

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?

Adrian Krebs
  • 4,179
  • 5
  • 29
  • 44

1 Answers1

6

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.

Kosi
  • 263
  • 4
  • 16