<@U06V253M4> I'm trying to distribute a sample app...
# box-products
p
@bdw429s I'm trying to distribute a sample app that relies on the H2 driver extension for Lucee to be installed. I have the process all automated and working on a Mac but it is failing on Windows. The process relies on the use of commandbox-env and commandbox-cfconfig. Basically I distribute a .env file with the project that sets an environment variable for the admin password for Lucee and another environment variable to tell Lucee to install the H2 extension on startup. Then the cfconfig module injects that password into the Lucee server at startup. So like I said, the process works find on a Mac. But it fails to inject the password or extension on startup in my Windows box. What I have discovered, however, is that if I launch box.exe by right clicking on it and selecting Run as administrator the whole process works fine and the password gets injected into the Lucee server and the extension gets installed. So my question to you is, have you seen this issue before and what do you think is causing this?
b
Nope, never seen it. You have to run CommandBox as admin to do things like • create symlinks • edit the hosts file but none of those are related to your H2 config
I would guess there is an unrelated issue getting in your way, but you need to first determine why it's not working on Windows
Add
--verbose
to your server start and look for any errors or warnings
p
@bdw429s Thanks, I'll try --verbose and see what I find.
@bdw429s There are a couple of warnings at the end of the server start command. Here is the package install results:
Copy code
CommandBox:todo> package install --verbose
 √ | Installing ALL dependencies
   |------------------------------------------
   | √ | Installing package [forgebox:cfwheels-core@^2.2.0]
   |   |-----------------------------------------------------------------
   |   | Verifying package 'cfwheels-core' in forgebox, please wait...
   |   | Installing version [2.2.9].
   |   | Verified entry in forgebox: 'cfwheels-core'
   |   | Package found in local artifacts!
   |   | Decompressing...
   |   | The package cfwheels-core is already installed at C:\Users\administrator.PAI\Downloads\commandbox-jre-win64-5
   |   | .4.2\projects\todo/wheels. Skipping installation. Use --force option to force install.
   |   |-----------------------------------------------------------------
   | √ | Installing package [lex:<https://ext.lucee.org/org.h2-1.3.172.lex>]
   |   |---------------------------------------------------------------------------
   |   | Downloading [<https://ext.lucee.org/org.h2-1.3.172.lex>]
   |   | The package orgh213172lex is already installed at C:\Users\administrator.PAI\Downloads\commandbox-jre-win64-5
   |   | .4.2\projects\todo/orgh213172lex. Skipping installation. Use --force option to force install.
   |   |---------------------------------------------------------------------------
   | √ | Installing package [forgebox:commandbox-dotenv@*]
   |   |----------------------------------------------------------------
   |   | Verifying package 'commandbox-dotenv' in forgebox, please wait...
   |   | Installing version [2.3.0].
   |   | Verified entry in forgebox: 'commandbox-dotenv'
   |   | Package found in local artifacts!
   |   | Decompressing...
   |   | The package commandbox-dotenv is already installed at C:\Users\administrator.PAI\.CommandBox\cfml\modules/com
   |   | mandbox-dotenv. Skipping installation. Use --force option to force install.
   |   |----------------------------------------------------------------
   | √ | Installing package [forgebox:commandbox-cfconfig@*]
   |   |------------------------------------------------------------------
   |   | Verifying package 'commandbox-cfconfig' in forgebox, please wait...
   |   | Installing version [1.7.0].
   |   | Verified entry in forgebox: 'commandbox-cfconfig'
   |   | Package found in local artifacts!
   |   | Decompressing...
   |   | The package commandbox-cfconfig is already installed at C:\Users\administrator.PAI\.CommandBox\cfml\modules/c
   |   | ommandbox-cfconfig. Skipping installation. Use --force option to force install.
   |   |------------------------------------------------------------------
   | √ | Installing package [forgebox:commandbox-cfformat@*]
   |   |------------------------------------------------------------------
   |   | Verifying package 'commandbox-cfformat' in forgebox, please wait...
   |   | Installing version [0.17.4].
   |   | Verified entry in forgebox: 'commandbox-cfformat'
   |   | Package found in local artifacts!
   |   | Decompressing...
   |   | The package commandbox-cfformat is already installed at C:\Users\administrator.PAI\.CommandBox\cfml\modules/c
   |   | ommandbox-cfformat. Skipping installation. Use --force option to force install.
   |   |------------------------------------------------------------------
And here is the results of the server start command:
Copy code
CommandBox:todo> server start --verbose
 √ | Starting Server
   |------------------------------
   | Looking for server JSON file by convention: C:\Users\administrator.PAI\Downloads\commandbox-jre-win64-5.4.2\proje
   | cts\todo\/server.json
   | webroot defaulted to location of server's JSON file: C:\Users\administrator.PAI\Downloads\commandbox-jre-win64-5.
   | 4.2\projects\todo\
   | start server in - C:\Users\administrator.PAI\Downloads\commandbox-jre-win64-5.4.2\projects\todo\
   | server name - todo
   | server config file - C:\Users\administrator.PAI\Downloads\commandbox-jre-win64-5.4.2\projects\todo\/server.json
   | Contacting ForgeBox to determine the latest & greatest version of [lucee stable]...  Use an exact 'cfengine' vers
   | ion to skip this check.
   | OK, [lucee 5.3.8+206] it is!
   | Building a WAR from local jars.
   | Server start command:
   |     C:\Users\administrator.PAI\Downloads\commandbox-jre-win64-5.4.2\jre\bin\java.exe
   |     -jar C:\Users\administrator.PAI\.CommandBox\lib\runwar-4.5.2.jar
   |     --background=true
   |     --host 127.0.0.1
   |     --stop-port 60395
   |     --processname todo [lucee 5.3.8+206]
   |     --log-dir C:/Users/administrator.PAI/.CommandBox/server/D5EA3389FD128F3C764CF40CDD10F18F-todo/lucee-5.3.8.206
   | /logs
   |     --server-name todo
   |     --tray-enable true
   |     --dock-enable true
   |     --directoryindex true
   |     --timeout 240
   |     --proxy-peeraddress true
   |     --cookie-secure false
   |     --cookie-httponly false
   |     --pid-file C:/Users/administrator.PAI/.CommandBox/server/D5EA3389FD128F3C764CF40CDD10F18F-todo/lucee-5.3.8.20
   | 6/.pid.txt
   |     --tray-icon C:\Users\administrator.PAI\.CommandBox\cfml\system\config\server-icons\trayicon-lucee-32px.png
   |     --tray-config C:/Users/administrator.PAI/.CommandBox/server/D5EA3389FD128F3C764CF40CDD10F18F-todo/lucee-5.3.8
   | .206/.trayOptions.json
   |     --gzip-enable true
   |     --cfengine-name lucee
   |     --jvm-args=-DLUCEE_EXTENSIONS=465E1E35-2425-4F4E-8B3FAB638BD7280A\;name=H2\;version=1.3.172;-Dcfconfig_adminP
   | assword=cfwheels
   |     -war C:\Users\administrator.PAI\Downloads\commandbox-jre-win64-5.4.2\projects\todo\
   |     --web-xml-path C:\Users\administrator.PAI\.CommandBox/server/D5EA3389FD128F3C764CF40CDD10F18F-todo/lucee-5.3.
   | 8.206/WEB-INF/web.xml
   |     --http-enable true
   |     --ssl-enable false
   |     --ajp-enable false
   |     --http2-enable true
   |     --open-browser true
   |     --open-url <http://127.0.0.1:60394>
   |     --port 60394
   |     --urlrewrite-enable true
   |     --urlrewrite-file C:\Users\administrator.PAI\Downloads\commandbox-jre-win64-5.4.2\projects\todo\urlrewrite.xm
   | l
   |     --predicate-file C:/Users/administrator.PAI/.CommandBox/server/D5EA3389FD128F3C764CF40CDD10F18F-todo/lucee-5.
   | 3.8.206/.predicateFile.txt
   | The server for C:\Users\administrator.PAI\Downloads\commandbox-jre-win64-5.4.2\projects\todo\ is starting on http
   | ://127.0.0.1:60394 ...
   |------------------------------
   | √ | Setting Server Profile to [development]
   |   |------------------------------------------------------
   |   | Profile set from server bound to localhost
   |   | Block CF Admin disabled
   |   | Block Sensitive Paths enabled
   |   | Block Flash Remoting enabled
   |   | Directory Browsing enabled
   |   |------------------------------------------------------
   | √ | Loading CFConfig into server
   |   |-------------------------------------------
   |   | Found CFConfig JSON in ".cfconfig.json" file in web root by convention.
   |   | Importing luceeserver config from [C:/Users/administrator.PAI/Downloads/commandbox-jre-win64-5.4.2/projects/t
   |   | odo/.cfconfig.json]
   |   | Config transferred from C:\Users\administrator.PAI\Downloads\commandbox-jre-win64-5.4.2\projects\tod
   |   | o\.cfconfig.json!
   |   | Found box environment variable [cfconfig_adminPassword]
   |   | Importing into [luceeserver]...
   |   | [adminPassword] set.
   |   | No Web context admin password found. Setting your admin password to the same as your Server context password.
   |   | [adminPassword] set.
   |   |-------------------------------------------

[INFO ] Runwar: Starting RunWAR 4.5.2
[INFO ] Runwar: HTTP2 Enabled:true
[INFO ] Runwar: HTTP sslEnable:false
[INFO ] Runwar: HTTP ajpEnable:false
[INFO ] Runwar: HTTP warFile exists:true
[INFO ] Runwar: HTTP warFile isDirectory:true
[INFO ] Runwar: Starting background todo [lucee 5.3.8+206] from: /C:/Users/administrator.PAI/.CommandBox/lib/runwar-4.5.2.jar
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by runwar.LaunchUtil (file:/C:/Users/administrator.PAI/.CommandBox/lib/runwar-4.5.2.jar) to method java.lang.ProcessImpl.pid()
WARNING: Please consider reporting this to the maintainers of runwar.LaunchUtil
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
[INFO ] Starting in background -
The only thing that looks suspicious are the Warnings at the end, but since I don't normally run the
--verbose
option I don't know if those are anything to worry about.
b
The warning at the end is normal
The lucee admin password looks like it imported with no issue
Copy code
|   | Found box environment variable [cfconfig_adminPassword]
   |   | Importing into [luceeserver]...
   |   | [adminPassword] set.
   |   | No Web context admin password found. Setting your admin password to the same as your Server context password.
   |   | [adminPassword] set.
As far as the extension, can you show how you're specifying that and you'd need to look in Lucee's deploy log to see if that happened
p
This is the contents of the .env file.
Copy code
LUCEE_EXTENSIONS=465E1E35-2425-4F4E-8B3FAB638BD7280A;name=H2;version=1.3.172
cfconfig_adminPassword=cfwheels
The extension gets installed if the environment variable is set.
Let me look in the Lucee logs to see if there is any mention of the deploy.
b
That looks right, but you'd need to confirm in the deploy log
which... may or may not be set to a default level which tells you anything.