cfmlprojects / runwar

Other
11 stars 16 forks source link

Error starting server with space in path to RunWar jar #13

Closed bdw429s closed 8 years ago

bdw429s commented 8 years ago
java.lang.NullPointerException
at runwar.AgentInitialization.findLocalJarOrZipFileFromLocationOfCurrentClassFil
e(AgentInitialization.java:108)
at runwar.AgentInitialization.getPathToJarFileContainingThisClass(AgentInitializ
ation.java:96)
at runwar.AgentInitialization.discoverPathToJarFile(AgentInitialization.java:57)

at runwar.AgentInitialization.loadAgentFromLocalJarFile(AgentInitialization.java
:35)
at runwar.Server.startServer(Server.java:204)

       at lucee.commons.cli.Command.execute(Command.java:69)
       at lucee.runtime.tag._Execute._run(_Execute.java:81)
       at lucee.runtime.tag._Execute.run(_Execute.java:72)

I can reproduce this from the CommandBox REPL with this code if my CommandBox home has a space in it:

r = createObject( "java", "runwar.AgentInitialization")
codesource = r.getClass().getProtectionDomain().getCodeSource()
location = codeSource.getLocation()
locationPath = location.getPath()
libDir = createObject( "java", "java.io.File" ).init( locationpath ).getParentFile()
libdir.toString()
libdir.listFiles()

The space is replaced with %20 and the libdir.listFiles() bit returns null.

bdw429s commented 8 years ago

Is this one fixed?

denuno commented 8 years ago

Seems to be for me. We can reopen if not.