cfmlprojects / runwar

Other
11 stars 16 forks source link

java.library.path on Windows invalid. #44

Closed dontascii closed 8 years ago

dontascii commented 8 years ago

I receive io.undertow.request UT005071: Undertow request failed HttpServerExchange and java.io.IOError: java.io.FileNotFoundException: NUL: (The system cannot find the file specified) errors when I start any server using runwar. (I use commandbox on windows7)

This issue has been driving me mad for about a month. Today, I discovered something that might be causing the issue on Windows boxes. (I can't say for sure if this is the cause of my problem, but I think it's an issue, regardless)

When I start a server using the same command that command box uses to start the server, but I enable the -debug java command line option, I see the following in the output:

...
2016-10-17 10:39:23 INFO RunwarLogger processoutput: 
2016-10-17 10:39:19 DEBUG RunwarLogger java.library.path:C:\Users\joel.clegg\.CommandBox\lib:C:\Users\joel.clegg\.CommandBox\lib;C:\Progra~1\Java\jre1.8.0_101\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Progra~1\TortoiseSVN\bin;.
2016-10-17 10:39:23 INFO RunwarLogger processoutput: 
2016-10-17 10:39:19 DEBUG RunwarLogger Setting coldfusion home:C:\26-jobscheduler\adobe-2016.0.02.299200\WEB-INF\cfusion
2016-10-17 10:39:23 INFO RunwarLogger processoutput: 
2016-10-17 10:39:19 DEBUG RunwarLogger found WEB-INF: C:\26-jobscheduler\adobe-2016.0.02.299200\WEB-INF
2016-10-17 10:39:23 INFO RunwarLogger processoutput: 
2016-10-17 10:39:19 INFO RunwarLogger Serving content from C:\webroots\jobscheduler
...

Notice the colon after the first path entry. On windows, this should be a semi-colon if I'm not mistaken. I'm hoping this might be the cause the undertow errors and inability for the server to serve any files.

I also noticed that using the -Djava.library.path= to hardset the java.library.path doesn't have any affect. It still gets changed to the path with the colon. Here's the command I'm using :

c:\26-jobscheduler>%JAVA_HOME%\java -Djava.library.path=C:\Users\joel.clegg\.CommandBox\lib;C:\Progra~1\Java\jre1.8.0_101\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Progra~1\TortoiseSVN\bin;. -Xmx512m -Xms512m -jar "C:\Users\joel.clegg\.CommandBox\lib\runwar-3.4.10.jar" --background=true --port 60128 --host 192.168.0.2 --debug=true --stop-port 58852 --processname "jobscheduler [adobe 2016.0.02+299200]" --log-dir "C:\26-jobscheduler/adobe-2016.0.02.299200/logs" --open-browser true --open-url http://192.168.0.2:60128 --cfengine-name "adobe" --server-name "jobscheduler" --tray-icon "C:\Users\joel.clegg\.CommandBox\cfml\system\config\server-icons\trayicon-cf2016-32px.png" --tray-config "C:\26-jobscheduler/adobe-2016.0.02.299200/trayOptions.json" --directoryindex "true" --cfml-web-config "C:\26-jobscheduler" --cfml-server-config "C:\Users\joel.clegg\.CommandBox/engine/cfml/server/" --timeout 240 -war "C:\webroots\jobscheduler" --lib-dirs "C:\26-jobscheduler/adobe-2016.0.02.299200/WEB-INF/lib" --web-xml-path "C:\26-jobscheduler/adobe-2016.0.02.299200/WEB-INF/web.xml" --urlrewrite-enable false

If more info is needed, I'd be happy to provide it.

dontascii commented 8 years ago

See Line 315 and 316, 323 of server.java. [https://github.com/cfmlprojects/runwar/blob/master/src/runwar/Server.java#L315]

recommend using System.getProperty("path.separator") instead