Skip to content

engine-java: the '@Component JavaDelegate' warning fires on every step execution on the ${JavaTask} path and never reaches the Problems view (#7223 follow-up) #7291

Description

@delchev

Describe the bug

PR #7272 (#7223) makes "a JavaDelegate must NOT be a @component" observable as a WARN in ComponentContainer.createUnmanaged (engine-java/.../component/ComponentContainer.java:437-443). Two things about where and how often it fires:

1. On the ${JavaTask} + handler path it fires on every execution, forever. DirigibleJavaCallDelegate.instantiate (engine-bpm-flowable/.../delegate/DirigibleJavaCallDelegate.java:199) calls ClientDelegateBeans.createUnmanaged(handlerClass) for each execute - the delegate is "fresh per execution" by design (engine-java CLAUDE.md). An annotated handler on a step that runs a thousand times a day logs a thousand WARNs with the same text; the same repo just spent three PRs (#7220, #7265, #7267) establishing once-then-DEBUG for exactly this class of "the same fact, every tick" logging. On the flowable:class path it fires once per parsed definition, which is fine.

2. It is a log line at step-execution time, not a Problems-view entry at publish. #7223's preferred outcome was the Problems view; a delegate nobody has executed yet warns nothing, and an operator reading a WARN in the Logs view is not the developer who annotated the class. ComponentContainer.rebuild already enumerates every bean and fills wiringErrors (the map that feeds the IDE's Problems view via JavaLoader); a bean whose class implements an interface named org.flowable.engine.delegate.JavaDelegate (by name - engine-java cannot see the Flowable type, which is also why isBean is the detection today) is knowable there, once per rebuild, at publish.

Minor: the message hardcodes "is a JavaDelegate annotated @component" while the detection is isBean(type) (any @Component), correct only because both callers are delegate paths.

Expected

  • The publish-time check: rebuild records a @Component that implements JavaDelegate as a wiring error (or warning) surfaced in Problems, naming the class and the rule.
  • The execution-time WARN is logged once per class per generation (a Set on the container snapshot, cleared by rebuild), then DEBUG.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions