Skip to content

[Bug][java] Missing Log4j dependencies in IDE support #1209

Closed

Description

@zzwqqq

Search before asking

  • I searched in the issues and found nothing similar.

Description

Running the Java example locally fails with:

NoClassDefFoundError: org/apache/logging/log4j/core/Layout

It looks like the Log4j dependencies are missing from the IDE classpath because runtime declares them as provided. This may be related to #954, which removed them from plan.

Adding the following to ide-support/pom.xml resolved the missing-class error in local testing. It also pulls in log4j-api and log4j-core. Would this be an appropriate fix?

<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-slf4j-impl</artifactId>
    <version>${log4j2.version}</version>
</dependency>

How to reproduce

  1. Import the project into IntelliJ IDEA.
  2. Create a run configuration for org.apache.flink.agents.examples.WorkflowSingleAgentExample, using the examples module classpath.
  3. Enable "Add dependencies with provided scope to classpath" and run it.

Version and environment

  • Flink Agents: 0.4-SNAPSHOT, main (99103da)
  • Flink: 2.3.0
  • Java: OpenJDK 17.0.15

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

  1. added
    bug[Issue Type] Something isn't working as expected.
    priority/majorDefault priority of the PR or issue.
    on Oct 8, 2026
  2. wenjin272 commented on Oct 9, 2026

    @wenjin272
    Contributor

    Thanks for reporting this and investigating the cause. Adding log4j-slf4j-impl to ide-support sounds like the right approach.

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

Metadata

Metadata

Assignees

Labels

bug[Issue Type] Something isn't working as expected.fixVersion/0.4.0priority/majorDefault priority of the PR or issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions