findify / s3mock

Embedded S3 server for easy mocking
MIT License
387 stars 107 forks source link

Docker images crashes with NoClassDefFoundError: javax/xml/bind/DatatypeConverter #116

Open sewe opened 6 years ago

sewe commented 6 years ago

Using the findify/s3mock latest (85e0ab80f0b3) docker image, I get fatal server crashes when doing a multi-part upload:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by scala.reflect.package$ (file:/app/s3mock.jar) to method java.nio.channels.Channels$1.close()
WARNING: Please consider reporting this to the maintainers of scala.reflect.package$
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Uncaught error from thread [s3mock-akka.actor.default-dispatcher-4]: javax/xml/bind/DatatypeConverter, shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for for ActorSystem[s3mock]
java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
    at better.files.File.checksum(File.scala:395)
    at better.files.File.md5(File.scala:398)
    at io.findify.s3mock.provider.FileProvider.putObjectMultipartComplete(FileProvider.scala:119)
    at io.findify.s3mock.route.PutObjectMultipartComplete.$anonfun$route$5(PutObjectMultipartComplete.scala:22)
    at scala.util.Try$.apply(Try.scala:209)
    at io.findify.s3mock.route.PutObjectMultipartComplete.$anonfun$route$4(PutObjectMultipartComplete.scala:22)
...

My guess would be that the JVM bundled with the image is Java 9 or later and doesn't activate the java.xml.bind by default. So an --add-modules java.xml.bind may be enough to fix this.