Commit 22f944a
committed
Fix Tomcat logging and MariaDB JDBC for CF mirror dependencies
Fixes two integration test failures caused by migrating dependencies from
Maven Central to java-buildpack.cloudfoundry.org S3 bucket.
Issue 1: Tomcat CloudFoundryConsoleHandler ClassNotFoundException
- Root cause: Java Util Logging (JUL) initializes during early JVM startup
when -Djava.util.logging.config.file is set, before the application
classloader has access to regular CLASSPATH entries
- Previous approach: Added tomcat-logging-support JAR to CLASSPATH in
setenv.sh, but JUL's LogManager uses the boot classloader
- Fix: Use -Xbootclasspath/a: instead of CLASSPATH to make the JAR
available during early JVM initialization
- This matches the pattern used by other security providers (Container
Security Provider, Luna, ProtectApp) that also need early loading
Issue 2: Tomcat logging JAR filename mismatch
- Root cause: Code constructed filename from dep.Name + dep.Version +
'.RELEASE.jar', assuming Maven Central's naming convention
(tomcat-logging-support-3.4.0.RELEASE.jar with DOT before RELEASE)
- CF mirror uses normalized naming with hyphen separator
(tomcat-logging-support-3.4.0-RELEASE.jar with HYPHEN before RELEASE)
- Result: setenv.sh referenced non-existent file, causing ClassNotFoundException
- Fix: Use filepath.Base(entry.URI) to extract actual filename from manifest,
matching installer's behavior and making code repository-agnostic
Issue 3: MariaDB JDBC JAR not found
- Root cause: Glob pattern 'mariadb-java-client-*.jar' didn't match actual
filename 'mariadb-jdbc-3.5.7.jar' from manifest URI
- Fix: Change pattern to 'mariadb-jdbc-*.jar' to match actual basename
Files changed:
- src/java/containers/tomcat.go: Use boot classpath and derive JAR name from URI
- src/java/frameworks/maria_db_jdbc.go: Fix JAR filename glob pattern
These fixes make the code resilient to naming convention differences across
artifact repositories and ensure proper JVM classloader initialization order.1 parent 73d8670 commit 22f944a
2 files changed
Lines changed: 10 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
246 | 251 | | |
247 | 252 | | |
248 | 253 | | |
| |||
253 | 258 | | |
254 | 259 | | |
255 | 260 | | |
256 | | - | |
257 | | - | |
258 | 261 | | |
259 | 262 | | |
260 | | - | |
261 | 263 | | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
| 264 | + | |
266 | 265 | | |
267 | 266 | | |
268 | | - | |
269 | 267 | | |
270 | 268 | | |
271 | 269 | | |
272 | 270 | | |
273 | | - | |
| 271 | + | |
274 | 272 | | |
275 | 273 | | |
276 | 274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
0 commit comments