fix(logback): drop '--' from comment to fix SAXParseException at startup#69
Merged
fix(logback): drop '--' from comment to fix SAXParseException at startup#69
Conversation
… at startup PR #65 added a date to the logback.xml timestamp pattern with a long comment explaining why. The comment included the literal token 'kubectl logs --previous' to motivate the choice. XML forbids the '--' sequence inside comments — and rightly: it terminates the comment parser early and ambiguates with the closing '-->'. Effect at runtime: every JVM startup hit ch.qos.logback.core.joran.spi.JoranException: Problem parsing XML document. ... Caused by: org.xml.sax.SAXParseException; ... line 9 column 46; The string "--" is not permitted within comments. Logback then fell back to its default appender (no pattern, no level overrides) and the rest of the app proceeded with degraded logging. Reported by VirusAlex on the v0.4.1 docker-pull live test. Why it slipped through: ArchUnit doesn't validate XML; the only smoke test that exercises logback init was the Jetty-using server tests, which fail under our Windows CI env for unrelated loopback reasons. The CI build-and-package step also doesn't actually start the JVM with logback.xml on the classpath. Local mvn-test on JDK 25 didn't trip it because the test infra uses logback's default config. Fix: rewrite the comment as a one-liner that doesn't reference command- line flags. The kubernetes/GH-Actions framing was speculative scope creep anyway — NetCopy targets two trusted hosts on a LAN, not k8s. Verified locally: XML parses, java -jar netcopy.jar --version starts clean with no SAXParseException. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
PR #65 added a date to the
logback.xmltimestamp pattern with an explanatory comment. The comment included the literal tokenkubectl logs --previousto motivate the choice. XML forbids the--sequence inside comments — it terminates the comment parser early.At every JVM startup since v0.4.0:
Logback fell back to its default appender (no pattern, no level overrides) and the app continued with degraded logging. Reported by VirusAlex on a v0.4.1 live
docker pulltest.Why it slipped through
logback.xmlon the classpath.mvn testuses logback's default config, never reads our resource.In short: no automated path even tries to load this file.
Fix
Replaced the verbose comment (which also did unnecessary scope creep into Kubernetes / journalctl framing — NetCopy targets two trusted hosts on a LAN, not k8s) with a tight one-liner that doesn't reference command-line flags.
Verification
xmllint-equivalent validation: XML parses cleanly via .NET XmlDocument.java -jar netcopy.jar --versionstarts with noSAXParseExceptionand prints version line.Follow-up
After this lands I'll move the
v0.4.1tag onto the new HEAD so the GHCR / GH Release artifacts are rebuilt with the working logback config. The currently-published:0.4.1works (logback's default appender prints lines, just without the configured pattern), but it'll keep emitting thatJoranExceptionstack trace at every startup until users repull. Force-moving the tag is fine here — the release is a v0.x pre-release and only ~one user has pulled it.🤖 Generated with Claude Code