Skip to main content

Troubleshooting

Simple Story

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.

Who is who

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​

ProblemPossible CauseSolution
ClassNotFoundException: de.tum.cit.ase.ares.api.PolicyAres not on the test classpathVerify 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 dependenciesMaven only: Ares is <scope>test</scope>, but the aspect library is resolved against the compile-visible dependenciesChange the scope to provided (the dependency step above)
A test asserting on the violation text fails, although the operation was blockedAres 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 itCheck the coordinate against Maven Central; only released versions resolve
Failed to find premain agent, or agent-related errorsAgent JAR not found, or wrong classifierEnsure the dependency uses the :agent classifier (Gradle) or the <classifier>agent</classifier> artefact item (Maven)
The build succeeds but nothing is wovenThe Ares JAR is on the compile classpath but not on the aspect pathAdd 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 runtimeMissing --add-opens / --add-exports flagsEnsure 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 AresA plain <argLine> overwrote the property JaCoCo setsPrefix 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 JARSet transitive = false on the dedicated configurations, as in the agent-configuration step above
IllegalStateException: Ambiguous project: both Maven and Gradle descriptors are activeThe 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 configuredRemove 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.ktsThe directory the tests run from carries no supported build descriptorRun from the project root that holds the build descriptor
Ares refuses to run tests while JUnit parallel execution is enabled on every testjunit.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 codeRemove 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 classpathThe agent JAR and the ordinary Ares JAR each carry oneA warning only; enforcement is unaffected
[Xlint:adviceDidNotMatch] warnings during compilationAn _ASPECTJ build reports each Ares advice that found no matching join point in the woven codeExpected 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 testA boundary version 1 snippet hooked check aloneMigrate to boundary version 2, which gates every Test task too (the Gradle step above)
A Gradle file-system watcher (FSEvents) warning at build startGradle's native file watching could not start in this environmentA warning only; it does not affect compilation or tests. Pass --no-watch-fs to silence it
Policy seems to have no effectWrong withinPathGradle: 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 uncheckedGradle: classes/java/main/<package/path>, Maven: classes/<package/path>

Symptom table: migrating from Ares 1​

ProblemCauseSolution
The artifact de.tum.cit.ase:ares referenced in aspectj plugin as an aspect library, is not found the project dependenciesMaven only: you carried <scope>test</scope> across from Ares 1Change the scope to provided (the step named in section 4.2 of this guide)
package de.tum.in.test.api does not existAn Ares 1 import survived the rewriteSearch 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 2Translate them into the policy file, then delete them
The build succeeds but every test is refused as not wovenThe Ares JAR is on the compile classpath but not on the aspect pathAdd 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 appearsThe test carries a plain @Test and @Policy but no Ares test annotation, so the extension was never registeredAdd @Public, @Hidden, @PublicTest or @HiddenTest (the step named in section 7 of this guide)
Ares could not verify the compiled test classtheFollowingClassesAreTestClasses names a package instead of exact class namesList every test class by its fully qualified name (the step named in section 6.4 of this guide)
A policy is rejected on loadthisPolicyFileCompliesToThePolicyVersion is missing or is not 1, or one of the six lists is absentAll 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 errortheSupervisedCodeUsesTheFollowingPackage is missing or blank. The schema tolerates that, but a present policy must name the package, and Ares fails closed rather than guessing itSet the supervised package (the step named in section 6.1 of this guide)
A timeout value of 0 is rejectedtimeout must be strictly positiveUse a positive value, or leave the list empty
Policy seems to have no effectWrong withinPathGradle: classes/java/main/<package/path>; Maven: classes/<package/path>
A @StrictTimeout was replaced by regardingTimeouts and no longer bounds anythingTimeouts are Phobos cases; Ares 2.2.2 generates the Phobos stage but does not yet dispatch it in-processRestore @StrictTimeout (the step named in section 6.2 of this guide)
InaccessibleObjectException at runtimeAn incomplete list of module-access flagsUse 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 migrationA plain <argLine> overwrote the property JaCoCo setsPrefix Surefire's <argLine> with @{argLine} and declare an empty <argLine> property
[Xlint:adviceDidNotMatch] warnings during compilationAn _ASPECTJ build reports each Ares advice that found no matching join point in the woven codeExpected 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 testThe snippet hooks check aloneUse 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 activeThe project has both a pom.xml and a build.gradle, and no policy names the build toolRemove 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.