Troubleshooting
When something goes wrong, look first at where it shows. Sometimes the teacher tells a pupil off and names the rule they broke. Sometimes the school refuses to hold the examination at all. This page matches each sign with what the head teacher has to change.
One case shows nothing: every answer passes, and nobody notices that the watching never started.
The first section shows how to read an Ares error. The two tables after it are the fastest route: find the message you saw. The sections after them cover the failures that show up as wrong behaviour rather than as a message.
Reading an Ares error message
When Ares stops a test, the message usually opens with a prefix that says who caused the problem and when. If the tests run in German, the same prefix appears in German:
Ares Security Error (Reason: Student-Code; Stage: Execution): ...
Ares Sicherheitsfehler (Grund: Student-Code; Phase: Ausführung): ...
Reason: Student-Code: Ares blames the student's code. Usually it tried something the policy forbids, and the test fails on purpose. Change the policy only if you want to allow the operation. Some of these messages instead report something the student has to change, such as a class that takes the name of a test class.Reason: Ares-Code: the student is not at fault. Ares itself, the policy or the build setup is wrong. Check the policy and the setup against the tables below. If both look right, report a bug.Stage: Creation(Erstellung): Ares stopped while preparing its checks, for example while reading the policy.Stage: Execution(Ausführung): Ares stopped while a test was running. No test checks that a message's stage matches where Ares raised it, so treat the stage as a hint rather than a certainty.
The error message template lists every part and the rules for writing a new message.
Symptom table: setting Ares 2 up
| Problem | Possible Cause | Solution |
|---|---|---|
ClassNotFoundException: de.tum.cit.ase.ares.api.Policy | Ares not on the test classpath | Verify the testImplementation dependency is present |
The artifact de.tum.cit.ase:ares referenced in aspectj plugin as an aspect library, is not found the project dependencies | Maven only: Ares is <scope>test</scope>, but the aspect library is resolved against the compile-visible dependencies | Change the scope to provided (the dependency step above) |
| A test asserting on the violation text fails, although the operation was blocked | Ares localises its violation messages, so "blocked by Ares" reads "von Ares blockiert" on a German Java Virtual Machine (JVM) | Assert on locale-stable content, such as the file name or the offending method, rather than on the prose |
Could not find de.tum.cit.ase:ares:<version> | The version does not exist on Maven Central, or a mirror has not synchronised it | Check the coordinate against Maven Central; only released versions resolve |
Failed to find premain agent, or agent-related errors | Agent JAR not found, or wrong classifier | Ensure the dependency uses the :agent classifier (Gradle) or the <classifier>agent</classifier> artefact item (Maven) |
| The build succeeds but nothing is woven | The Ares JAR is on the compile classpath but not on the aspect path | Add aspect "de.tum.cit.ase:ares:..." (Gradle) or the <aspectLibraries> entry (Maven). ajc ignores binary aspects that are not on the aspect path. Ares then refuses every test and names a class that lacks the Ares aspects |
InaccessibleObjectException at runtime | Missing --add-opens / --add-exports flags | Ensure the complete list from the agent step above / the agent step above is present. A partial list fails only once a policy exercises the corresponding advice |
| Coverage reports nothing after adding Ares | A plain <argLine> overwrote the property JaCoCo sets | Prefix the Surefire <argLine> with @{argLine} and declare an empty <argLine> property |
Could not resolve all files for configuration ':aresAgent', or "expected exactly one file" | The configuration is transitive, so it holds more than the agent JAR | Set transitive = false on the dedicated configurations, as in the agent-configuration step above |
IllegalStateException: Ambiguous project: both Maven and Gradle descriptors are active | The project has both a pom.xml and a build.gradle, and the no-policy path has no explicitly selected build tool, so it cannot tell which is authoritative. Discovery fails before any enforcement is configured | Remove the descriptor you do not use, or supply a policy that names the configuration explicitly |
IllegalStateException: Unsupported project: no pom.xml, build.gradle or build.gradle.kts | The directory the tests run from carries no supported build descriptor | Run from the project root that holds the build descriptor |
Ares refuses to run tests while JUnit parallel execution is enabled on every test | junit.jupiter.execution.parallel.enabled=true is set in junit-platform.properties, the build file or a system property. Ares keeps one policy for the whole JVM, so a test that ends in parallel could lift it while another test still runs student code | Remove the setting or set it to false. Setting the execution mode to same_thread is not enough, because Ares refuses whenever this setting reads true |
logback.xml occurs multiple times on the classpath | The agent JAR and the ordinary Ares JAR each carry one | A warning only; enforcement is unaffected |
[Xlint:adviceDidNotMatch] warnings during compilation | An _ASPECTJ build reports each Ares advice that found no matching join point in the woven code | Expected and non-fatal when the exercise performs none of those operations. Their presence shows the weaver processed the Ares aspects, so do not suppress the category |
The reserved-package check never runs under gradlew test | A boundary version 1 snippet hooked check alone | Migrate to boundary version 2, which gates every Test task too (the Gradle step above) |
| A Gradle file-system watcher (FSEvents) warning at build start | Gradle's native file watching could not start in this environment | A warning only; it does not affect compilation or tests. Pass --no-watch-fs to silence it |
| Policy seems to have no effect | Wrong withinPath | Gradle: classes/java/main/<package/path>, Maven: classes/<package/path> |
Ares found no compiled classes in <folder> | The withinPath or the supervised package names a folder without compiled classes, while the project has compiled classes elsewhere. Ares refuses rather than pass every static check unchecked | Gradle: classes/java/main/<package/path>, Maven: classes/<package/path> |
Symptom table: migrating from Ares 1
| Problem | Cause | Solution |
|---|---|---|
The artifact de.tum.cit.ase:ares referenced in aspectj plugin as an aspect library, is not found the project dependencies | Maven only: you carried <scope>test</scope> across from Ares 1 | Change the scope to provided (the step named in section 4.2 of this guide) |
package de.tum.in.test.api does not exist | An Ares 1 import survived the rewrite | Search for de.tum.in.test across the test sources. Any remaining hit is either a rename (section 5 of this guide) or a security annotation to translate (section 6 of this guide) |
cannot find symbol: class WhitelistPath (and similar) | These annotations do not exist in Ares 2 | Translate them into the policy file, then delete them |
| The build succeeds but every test is refused as not woven | The Ares JAR is on the compile classpath but not on the aspect path | Add aspect "de.tum.cit.ase:ares:..." (Gradle) or the <aspectLibraries> entry (Maven). ajc ignores binary aspects that are not on the aspect path. Ares then refuses every test and names a class that lacks the Ares aspects |
| Tests pass, and nothing is restricted, and no error appears | The test carries a plain @Test and @Policy but no Ares test annotation, so the extension was never registered | Add @Public, @Hidden, @PublicTest or @HiddenTest (the step named in section 7 of this guide) |
Ares could not verify the compiled test class | theFollowingClassesAreTestClasses names a package instead of exact class names | List every test class by its fully qualified name (the step named in section 6.4 of this guide) |
| A policy is rejected on load | thisPolicyFileCompliesToThePolicyVersion is missing or is not 1, or one of the six lists is absent | All six lists must be present even when empty (the step named in section 6.1 of this guide) |
| A policy loads but the run fails with a supervised-code error | theSupervisedCodeUsesTheFollowingPackage is missing or blank. The schema tolerates that, but a present policy must name the package, and Ares fails closed rather than guessing it | Set the supervised package (the step named in section 6.1 of this guide) |
A timeout value of 0 is rejected | timeout must be strictly positive | Use a positive value, or leave the list empty |
| Policy seems to have no effect | Wrong withinPath | Gradle: classes/java/main/<package/path>; Maven: classes/<package/path> |
A @StrictTimeout was replaced by regardingTimeouts and no longer bounds anything | Timeouts are Phobos cases; Ares 2.2.2 generates the Phobos stage but does not yet dispatch it in-process | Restore @StrictTimeout (the step named in section 6.2 of this guide) |
InaccessibleObjectException at runtime | An incomplete list of module-access flags | Use the complete list from the step named in section 4.1 of this guide or the step named in section 4.2 of this guide |
| Coverage reports nothing after the migration | A plain <argLine> overwrote the property JaCoCo sets | Prefix Surefire's <argLine> with @{argLine} and declare an empty <argLine> property |
[Xlint:adviceDidNotMatch] warnings during compilation | An _ASPECTJ build reports each Ares advice that found no matching join point in the woven code | Expected and non-fatal when the exercise performs none of those operations. Their presence shows the weaver processed the Ares aspects, so do not suppress the category |
The reserved-package check never runs under gradlew test | The snippet hooks check alone | Use boundary version 2, which gates every Test task too (the step named in section 8.1 of this guide) |
Ambiguous project: both Maven and Gradle descriptors are active | The project has both a pom.xml and a build.gradle, and no policy names the build tool | Remove the descriptor you do not use, or supply a policy that names the configuration explicitly |
The build succeeds but nothing is enforced
Missing agent attachment, a @Policy that never applied, or a reserved-package check that was
never hooked onto the test task.
A permitted operation is rejected
Path normalisation, an allow-list entry that names a directory where a file was meant, or a call that reaches the forbidden operation through a library rather than directly.
A forbidden operation is not rejected
The most serious case. Which of the four analysis and weaving combinations was active, and whether the supervised package was shadowed.
The agent does not attach
--add-opens requirements, useSystemClassLoader, and the Surefire argLine trap: a plain
<argLine> replaces what other plugins contributed, silently dropping the JaCoCo agent.
Gradle runs the tests but not the boundary check
check.dependsOn test and not the reverse, so a hook on check never runs for gradlew test.
The policy file is rejected
Version gate, unknown fields, and values the enforcement layers cannot honour.
Timeouts do not fire
Policy resource limits are generated but not dispatched in Postcompile. @StrictTimeout is the
mechanism that applies there.
Notes
- Before filing a bug, record which of the four combinations you ran. A failure that appears in only one of them is a different problem from one that appears in all four.