I am trying to use the ortussolutions/commandbox:adobe2018 image for a container to run a Coldfusion application that is already working in a Windows instance and an instance based on the adobecoldfusion/coldfusion2018:2018.0.16 image.
When I try to launch the application on the CommandBox container, I get an error:
"Error","XNIO-1 task-1","05/17/23","13:12:22","AgencyManager","Object instantiation exception.An exception occurred while instantiating a Java object. The class must not be an interface or an abstract class. If the class has a constructor that accepts an argument, you must call the constructor explicitly using the init(args) method. Error : '' The specific sequence of files included or processed is: /app/index.cfm, line: 79 "
coldfusion.runtime.java.JavaObjectInstantiationException: Object instantiation exception.
at coldfusion.runtime.java.JavaProxy.createObjectWithDefaultConstructor(JavaProxy.java:222)
at coldfusion.runtime.java.JavaProxy.invoke(JavaProxy.java:96)
...
at cfMedispan2ecfc1665728274$funcLOADCLASSIFICATIONCACHE.runFunction(/app/packages/Medispan/Medispan.cfc:79)
...
at cfMedispan2ecfc1665728274$funcINIT.runFunction(/app/packages/Medispan/Medispan.cfc:16)
...
at cfsessionrefresh2ecfc969640930$funcLOADAPPLICATIONCACHE.runFunction(/app/AM/cfc/sessionrefresh.cfc:67)
...
at cfApplication2ecfc1572209739$funcONAPPLICATIONSTART.runFunction(/app/Application.cfc:343)
...
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:311)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
...
at runwar.undertow.SSLClientCertHeaderHandler.handleRequest(SSLClientCertHeaderHandler.java:144)
at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117)
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
...
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2019)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1558)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1449)
at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at coldfusion.runtime.java.JavaProxy.createObjectWithDefaultConstructor(JavaProxy.java:216)
... 111 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class medispan.logging.LogWriter
at medispan.dib.Navigation.<init>(Unknown Source)
... 116 more
The important part, I think, is the last couple of lines about not finding medispan.logging.LogWriter at medispan.dib.Navigation. The medispan.dib.Navigation class is in /usr/local/cflibs/Medispan/dib-4.0.0.jar, and the medispan.logging.LogWriter class is in /usr/local/cflibs/Medispan/mmwfoundation-3.2.0.jar.
I have my server.json file set up with libDirs to find the jar files:
...
"app": {
"libDirs": "/usr/local/lib/serverHome/,/usr/local/cflibs,/usr/local/cflibs/Medispan/*"
},
...
and I can see both jar files get picked up when the server is starting -
It is weird that this does not work in the CommandBox container but will work on Windows and the adobe provided container. Does anyone have any ideas why it would act this way?
For reference, here is the whole server.json file I am using -
{
"cfconfig": {
"file": "test_cfconfig.json"
},
"profile": "development",
"app": {
"libDirs": "/usr/local/cflibs,/usr/local/cflibs/Medispan/*"
},
"example_fullsample": "https://commandbox.ortusbooks.com/embedded-server/server.json",
"scripts": {
"onServerInstall": "!sed -i \"s/{{MED_DB_USERNAME}}/$MED_DB_USERNAME/\" /usr/local/cflibs/Medispan/medispan.wkconfig.xml && sed -i \"s/{{MED_DB_PASS}}/$MED_DB_PASS/\" /usr/local/cflibs/Medispan/medispan.wkconfig.xml"
},
"jvm": {
"minHeapSize": "${MIN_MEMORY}",
"maxHeapSize": "${MAX_MEMORY}",
"args": [
"-Xms${MIN_MEMORY}",
"-Xmx${MAX_MEMORY}",
"-XX:MaxMetaspaceSize=${MaxMetaspaceSize}",
"--add-opens=java.base/java.lang=ALL-UNNAMED",
"--add-opens=java.base/java.nio=ALL-UNNAMED",
"--add-opens=java.base/sun.util.cldr=ALL-UNNAMED",
"--add-opens=java.base/sun.util.locale.provider=ALL-UNNAMED",
"--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED",
"-DDEBUGGER_SERVER_PORT=7777",
"-Dcoldfusion.home={application.home}",
"-Dcoldfusion.jsafe.defaultalgo=FIPS186Random",
"-Dcoldfusion.libPath={application.home}/lib",
"-Dcoldfusion.rootDir={application.home}",
"-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true ",
"-Dhttps.protocols=TLSv1.2",
"-Djava.security.egd=/dev/urandom",
"-Djava.util.logging.config.file={application.home}/lib/logging.properties",
"-Djdk.attach.allowAttachSelf=true",
"-Dorg.apache.coyote.USE_CUSTOM_STATUS_MSG_IN_HEADER=true",
"-Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.JavaUtilLog",
"-Dsun.font.layoutengine=icu",
"-Duser.language=${language:en}",
"-XX:+UseParallelGC",
"-Xdebug",
"-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005",
"-javaagent:/usr/local/newrelic/newrelic.jar",
"-server"
]
}
}