apache / apache/pulsar

NoClassDefFoundError when trying to run 'mvn package' on source code

Open
#13,906 3 comments 0 reactions 0 assignees View on GitHub
lifecycle/stale Stale type/bug
Dominant language
Java
Stars
15.3k
Forks
3.8k
Avg merge
1d 14h
Merged PRs (30d)
160

Description

**Describe the bug**

```
[ERROR] Tests run: 39, Failures: 1, Errors: 0, Skipped: 28, Time elapsed: 1.079 s <<< FAILURE! - in TestSuite
[ERROR] testThreadLocalStateCleanupInCurrentAndOtherThread(org.apache.pulsar.tests.FastThreadLocalStateCleanerTest) Time elapsed: 0 s <<< FAILURE!
java.lang.NoClassDefFoundError: Could not initialize class org.apache.pulsar.tests.ThreadLocalStateCleaner
at org.apache.pulsar.tests.FastThreadLocalStateCleanerTest.testThreadLocalStateCleanupInCurrentAndOtherThread(FastThreadLocalStateCleanerTest.java:88)

[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] org.apache.pulsar.tests.FastThreadLocalStateCleanerTest.testThreadLocalStateCleanupInCurrentAndOtherThread(org.apache.pulsar.tests.FastThreadLocalStateCleanerTest)
[INFO] Run 1: PASS
[ERROR] Run 2: FastThreadLocalStateCleanerTest.testThreadLocalStateCleanupInCurrentAndOtherThread:88 » NoClassDefFound
[INFO]
[INFO]
[ERROR] Tests run: 33, Failures: 1, Errors: 0, Skipped: 22
```

**To Reproduce**
Try to build jar from source code using 'mvn package'. Fails during tests stage. Source code of pulsar 2.8.2

**Desktop (please complete the following information):**
- OS: Windows

**Additional context**
I'm new to Maven so perhaps I'm missing something

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure on the Pulsar 2.8.2 source with `mvn package`, then start at FastThreadLocalStateCleanerTest.java:88 and the ThreadLocalStateCleaner initialization referenced in the stack trace. Check whether the test still fails during the test stage, and consider the issue resolved when the package build completes without this NoClassDefFoundError.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.