Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring-boot-dev-tools is bundled within docker image (causing ClassCastExceptions) #266

Closed
hbruch opened this issue Sep 20, 2023 · 1 comment · Fixed by #267
Closed

Spring-boot-dev-tools is bundled within docker image (causing ClassCastExceptions) #266

hbruch opened this issue Sep 20, 2023 · 1 comment · Fixed by #267

Comments

@hbruch
Copy link
Collaborator

hbruch commented Sep 20, 2023

I start seeing #155 with the recent entur/lamassu@2023-09-20T14-28, though no ENV=DEV is activated, i.e. in production mode:

{"serviceContext":{"service":"lamassu"},"message":"Caught exception in ForkJoinPool\njava.lang.ClassCastException: null\n\tat java.base/jdk.internal.reflect.GeneratedConstructorAccessor189.newInstance(Unknown Source)\n\tat java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n\tat java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)\n\tat java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)\n\tat java.base/java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:564)\n\tat java.base/java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:591)\n\tat java.base/java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:689)\n\tat java.base/java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:159)\n\tat java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:173)\n\tat java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)\n\tat java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)\n\tat java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:765)\n\tat org.entur.gbfs.GbfsSubscriptionManager.lambda$update$0(GbfsSubscriptionManager.java:68)\n\tat java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)\n\tat java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)\n\tat java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)\n\tat java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)\n\tat java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)\n\tat java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)\nCaused by: java.lang.ClassCastException: null\n","reportLocation":{"filePath":"org.entur.lamassu.leader.FeedUpdater","lineNumber":"95","functionName":"lambda$start$0"},"severity":"WARNING"}

As the result is temporary loss of data, this is more serious than just seeing this issue in development.

Inspecting /app/libdir in the container, I see spring-boot-devtools-2.7.15.jar in the packaged libs. pom.xml declares this lib as optional runtime, but nevertheless, jib packages it within the docker image, which is expected and discussed also in GoogleContainerTools/jib#2336.

An appropriate way to solve this (by excluding spring-boot-devtools), might be to add https://github.com/GoogleContainerTools/jib-extensions/tree/master/first-party/jib-spring-boot-extension-maven to pom.xml.

@testower
Copy link
Collaborator

Looks like a reasonable fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants