Skip to content

Commit

Permalink
Adds java.sql.rowset module (#82)
Browse files Browse the repository at this point in the history
MariaDB Connector/J 3.x additionally requires rowset, and without it
crashes like so:
```
zipkin        | Caused by: java.lang.ClassNotFoundException: javax.sql.rowset.serial.SerialException
zipkin        | 	at java.base/java.net.URLClassLoader.findClass(Unknown Source) ~[?:?]
zipkin        | 	at java.base/java.lang.ClassLoader.loadClass(Unknown Source) ~[?:?]
zipkin        | 	at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151) ~[zipkin/:?]
zipkin        | 	at java.base/java.lang.ClassLoader.loadClass(Unknown Source) ~[?:?]
```

Signed-off-by: Adrian Cole <[email protected]>
  • Loading branch information
codefromthecrypt authored Dec 15, 2023
1 parent e772546 commit d49ba90
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ java.base,java.logging,\
java.desktop,\
# our default server includes SQL
java.sql,\
# MariaDB Connector/J 3.x additionally requires rowset
java.sql.rowset,\
# instrumentation
java.instrument,\
# remote debug
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,27 @@ OpenJDK 64-Bit Server VM (build 21.0.1+12-alpine-r0, mixed mode, sharing)
To release the image, push a tag matching the arg to `build-bin/build` (ex `21.0.1_p12`).
This triggers a [GitHub Actions](https://github.com/openzipkin/docker-java/actions) job to push the image.

## java.lang.ClassNotFoundException

The image ending in `-jre` is stripped to only retain the minimal modules needed by Zipkin. This is
to make it as small as possible. If the `zipkin` or `zipkin-slim` images fail with a
`java.lang.ClassNotFoundException`, it may be related to the modules linked in the [Dockerfile][Dockerfile].

If the package begins with `java.`, `sun.` or `com.sun.`, it is likely a JRE module. To verify, use
`javap` without any other options. If a result is printed, you need to link a corresponding module.

For example, here's the result of `javax.sql.rowset.serial.SerialException`, which is in the module
`java.sql.rowset`:
```
$ javap javax.sql.rowset.serial.SerialException
Compiled from "SerialException.java"
public class javax.sql.rowset.serial.SerialException extends java.sql.SQLException {
static final long serialVersionUID;
public javax.sql.rowset.serial.SerialException();
public javax.sql.rowset.serial.SerialException(java.lang.String);
}
```

## CVEs

This builds JDK and JRE images over our [Alpine Linux](https://github.com/openzipkin/docker-alpine)
Expand Down

0 comments on commit d49ba90

Please sign in to comment.