I am using CommandBox to host a Lucee site with ve...
# lucee
g
I am using CommandBox to host a Lucee site with version 5.4.3.2 on Windows. Has anyone had an issue with the CFSpreadsheet extension working, then not? I install it on the site, it works, but then after restarting the site it throws this error:
invalid component definition, can't find component [org.cfpoi.spreadsheet.Spreadsheet]
Uninstalling and reinstalling the extension fixes it until I restart the site again.
p
Are you using cfconfig and exporting your config after you install it? So its there whenever you reboot?
g
I am using an env var to install it at startup. I can confirm that it gets installed properly (for example do a server forget then start), and it works the first time, but then I restart the service it errors when running that code
p
Um yea strange...not sure about that case then.
g
Strange indeed. On initial installation, the spreadsheet stuff is in the felix-cache and everything works. On restart, the felix-cache gets rebuilt, but those spreadsheet files are no longer there
p
Anything from logs?
g
not that we saw
no errors
just the felix-cache having a lot few files the second start when compared to the first
p
Have you tried a different version of the extension?
g
there is only one version
p
welp got me there then; sounds like a compat issue; sry cant really help much more
g
we are moving on to an alternate solution at this point
p
Strapped to that exact build of Lucee? Have you tried different builds?
g
yep
r
Are you using Lucee Light? We have issues where the OWASP extension doesn't load. Sometimes.
g
nope, full version of Lucee
c
Could try a different version of Lucee temporarily to see if just an incompatibility or bug. Separately, would https://github.com/cfsimplicity/spreadsheet-cfml work - I don't know if it is a drop in replacement for your library.
m
That had happened to me once about a year ago. But in my case, I only had to uninstall and then re-installed the extension one time and it worked even after restarting the site.
g
I tried that, but that didn't work.
At this point we moved on to a different solution
g
I had what seems to be the same issue... I was using a cfconfig recipe and it wasnt sticking. After checking the server.json - I noticed that I was ALSO doing extension loading in there. AND I was also doing extension loading via ENV variables. TL;DR; Make sure you're only doing your config in one place. Check for environment vars Check in server.json Check in .cfconfig.json We're swapping over to using docker containers - so having a repeatable / programmable, method of configuring the Lucee server settings is really important to us. And changing your mind-set to : THIS running server might die at any time - it is NOT dependable as being a source of truth for the configuration - really helps you to see infrastructure concerns a lot differently. I have changed my config now to just use
.cfconfig.json
for Lucee server settings. And
server.json
- just for commandbox settings. (I haven't had a need to use
box.json
server.json
Copy code
{
    "app":{
        "cfengine":"lucee@5.4.4.38"
    },
    "JVM":{
        "heapSize":"2048",
        "javaVersion":"openjdk11"
    },
    "name":"local-dev",
    "openbrowser":"false",
    "web":{
        "http":{
            "port":"80"
        },
    },
    "server":{
        "profile":"development"
    }
}
.config.json
Copy code
{
    All the things I previously did with a cfconfig "recipe",

    Also all the things I did manually in a batch file with environment variables - that didn't need to be an environment variable.

    Then - I did all my "hand" configuration via Lucee administrator and finally did  a cfconfig "export" : to get a "near" complete Lucee server configuration that gets loaded on server start - automatically - as long as your starting your server with commandbox.
}
(in fact : I actually use an environment variable as override to a few of the settings in both the JSON files. "box_server_app_cfengine", "box_server_name", "box_server_profile" Spring to mind but I know we use more. Lastly - I noticed some of the (lesser used / less important) Lucee server / web settings were not included in the cfconfig export - so we did "hack" the lucee-server.xml directly for those - and store that in source control - and copy it into the appropriate location, in the container build process. So we have a starting point for our lucee settings - that may / may not get overridden by settings in the JSON files.