Skip to content

IGNITE-28073 : Examples fail with IllegalStateException when run directly - deploymentUnitJar not built#7710

Open
ashishm07 wants to merge 541 commits intoapache:mainfrom
ashishm07:IGNITE-28073
Open

IGNITE-28073 : Examples fail with IllegalStateException when run directly - deploymentUnitJar not built#7710
ashishm07 wants to merge 541 commits intoapache:mainfrom
ashishm07:IGNITE-28073

Conversation

@ashishm07
Copy link
Contributor

@ashishm07 ashishm07 commented Mar 5, 2026

Running any example that requires a deployment unit directly via Gradle fails with:

java.lang.IllegalStateException: Deployment unit JAR not found at: .../examples/java/build/libs/deploymentunit-example-1.0.0.jar

Root Cause:

deploymentUnitJar was only wired into the build lifecycle. Direct class execution via Gradle uses a JavaExec task that only depends on classes, bypassing deploymentUnitJar. As a result, the JAR is never built unless ./gradlew :ignite-examples:build is run explicitly beforehand.

Affected Examples:

code/deployment/CodeDeploymentExample

compute/ComputeAsyncExample

compute/ComputeBroadcastExample

compute/ComputeCancellationExample

compute/ComputeColocatedExample

compute/ComputeExample

compute/ComputeJobPriorityExample

compute/ComputeJobStateExample

compute/ComputeMapReduceExample

compute/ComputeWithCustomResultMarshallerExample

compute/ComputeWithResultExample

serialization/SerializationExample

streaming/DistributedComputeWithReceiverExample

streaming/MultiTableDataStreamerExample

Background / Motivation:
The ai3tests framework imports the ignite-examples JAR and drives each example class as an automated test, invoking them via a shared runExample(...) utility:
java@Test
@DisplayName("Run ComputeRustJobExample")
public void testCompute*Example()

{ runExample(Compute*Example.class); }
This pattern allows individual examples to be validated in a repeatable, CI-friendly way and forms the foundation for cyclic stability testing as well. For this to work reliably, examples must be executable directly via Gradle without requiring a manual build step beforehand — making this fix a prerequisite for stable automated test execution.
Fix:

Added to examples/java/build.gradle:

groovy
tasks.withType(JavaExec).configureEach {
dependsOn deploymentUnitJar
}
This ensures the deployment unit JAR is always built before any example class is executed via Gradle, regardless of whether build was run first.

@ashishm07 ashishm07 changed the title IGNITE-28073 : Examples fail with IllegalStateException when run directly — deploymentUnitJar not built IGNITE-28073 : Examples fail with IllegalStateException when run directly - deploymentUnitJar not built Mar 5, 2026

public static void main(String[] args) throws Exception {

try (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes seem unrelated to the deployment unit issue

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I see no difference with main. The files are identical. I even pasted the main one to this branch and there is no difference.

denis-chudov and others added 28 commits March 11, 2026 20:05
…7434)

Signed-off-by: Slava Koptilin <slava.koptilin@gmail.com>
Co-authored-by: Slava Koptilin <slava.koptilin@gmail.com>
…ache#7441)

Signed-off-by: Slava Koptilin <slava.koptilin@gmail.com>
Co-authored-by: Slava Koptilin <slava.koptilin@gmail.com>
Signed-off-by: Slava Koptilin <slava.koptilin@gmail.com>
Co-authored-by: Slava Koptilin <slava.koptilin@gmail.com>
Signed-off-by: Slava Koptilin <slava.koptilin@gmail.com>
Signed-off-by: Slava Koptilin <slava.koptilin@gmail.com>
Co-authored-by: Slava Koptilin <slava.koptilin@gmail.com>
Fix flakiness in PartitionAwarenessRealClusterTests and others that rely on GetProxies.
isapego and others added 30 commits March 11, 2026 20:05
Signed-off-by: Aleksandr Polovtsev <alex.polovtcev@gmail.com>
Co-authored-by: Aleksandr Polovtsev <alex.polovtcev@gmail.com>
Signed-off-by: Aleksandr Polovtsev <alex.polovtcev@gmail.com>
Co-authored-by: Aleksandr Polovtsev <alex.polovtcev@gmail.com>
Signed-off-by: Aleksandr Polovtsev <alex.polovtcev@gmail.com>
Co-authored-by: Aleksandr Polovtsev <alex.polovtcev@gmail.com>
…tor of IgniteImpl when launched without JVM options "--add-opens=..." (apache#7606)
Co-authored-by: dzabotlin <dzabotlin@gridgain.com>
Co-authored-by: Kirill Sizov <sizov.kirill.y@gmail.com>
* TotalEmptySize
* TotalDataSize
* PagesFillFactor
Signed-off-by: Aleksandr Polovtsev <alex.polovtcev@gmail.com>
Co-authored-by: Aleksandr Polovtsev <alex.polovtcev@gmail.com>
Signed-off-by: Aleksandr Polovtsev <alex.polovtcev@gmail.com>
Co-authored-by: Aleksandr Polovtsev <alex.polovtcev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.