August 4, 2020, 11:05am
Need your kind advise.
My application loads Java source file by Scripting interface.
It’s working well if app launched by Idea, but throws exception if run by UberJar, saying cannot find package and class and symbols etc.
Something wrong with classloader? Or I missed to configure something?
test0804.zip (425.8 KB)
Here’s a project could reproduce the issue.
Modify cuba.confDir setting in both app.properties and build.gradle, to “/conf”
Another question: why cuba.confDir in app.properties doesn’t work for UberJar?
Launch the application by Idea, no issue.
Build UberJar, and run by command line, then error happens
java -Dapp.home=./app-home -jar ./app.jar
step 1. modify cuba.confDir to “[project-path]/conf”
Running by UberJar, below configuration seems wrong for Jetty.
I tried to modify cubaClasspathDirectories, but still got compilation exception.
August 6, 2020, 8:44am
Unfortunately, hot deploy of classes does not work for UberJar because of the class loading mechanism in that case. I’ve created an
issue to investigate that problem. Property
app.properties does not work for UberJar because application properties for UberJar should be defined separately by
appProperties task parameter.
August 6, 2020, 10:41am
And I have tried to use tomcat fast deployment and change DockerFile slightly to copy artifacts and startup tomcat. So far it’s working well.