Using -P on command line returns StringIndexOutOfBoundsExcep

I’m trying to run a graph from the command line and including a parameter using the -P argument. When I run without the -P, the graph executes without issue. However, when I use -P, it returns a StringIndexOutOfBoundsException.

Here’s the command I’m trying to use as well as the exception:

C:\Users\skaszyk.IFPARTNERS>clover.bat -P:FILENAME="C:\temp\data_staging\lpl\DFM-R2FC-Account-20140619-v2.0.txt" -contexturl C:\cloverETL\AdvisorDataLoads "graph\LPLFileLoaders\Load Daily LPL Account File.grf" > account_test.log
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.String.substring(String.java:1911)
        at org.jetel.main.runGraph.main(runGraph.java:227)

I’m trying to pass in the filename since it contains a date component and was unable to use the Parameters within the graph (tried setting it to today() but wasn’t able to format it in yyyyMMDD format).

CLOVER_HOME=C:\cloverETL\bin\.\..
CLOVER_CMD_LINE_ARGS=-P:FILENAME "C:/temp/data_staging/lpl/DFM-R2FC-Account-20140619-v2.0.txt" -contexturl C:\cloverETL\AdvisorDataLoads "graph\LPLFileLoaders\Load Daily LPL Account File.grf"
JAVA_CMD_LINE_ARGS=
USER_CLASSPATH=
"C:\Program Files\Java\jdk1.7.0_45\bin\java.exe"   -classpath ";;C:\cloverETL\bin\;C:\Program Files\Java\jdk1.7.0_45\lib\tools.jar;;C:\cloverETL\bin\.\../lib/annotations.jar;C:\cloverETL\bin\.\../lib/cloveretl.engine.jar;C:\cloverETL\bin\.\../lib/commons-cli-1.2.jar;C:\cloverETL\bin\.\../lib/commons-codec-1.6.jar;C:\cloverETL\bin\.\../lib/commons-collections-3.2.1.jar;C:\cloverETL\bin\.\../lib/commons-compress-1.7.jar;C:\cloverETL\bin\.\../lib/commons-io-2.2.jar;C:\cloverETL\bin\.\../lib/commons-io-LICENSE.txt;C:\cloverETL\bin\.\../lib/commons-logging-1.1.3.jar;C:\cloverETL\bin\.\../lib/commons-net-3.3.jar;C:\cloverETL\bin\.\../lib/commons-pool-1.6.jar;C:\cloverETL\bin\.\../lib/dom4j-1.6.1.jar;C:\cloverETL\bin\.\../lib/ftp4j-1.7.2.jar;C:\cloverETL\bin\.\../lib/ftp4j-LICENSE.txt;C:\cloverETL\bin\.\../lib/httpclient-4.3.2.jar;C:\cloverETL\bin\.\../lib/httpclient-LICENSE.txt;C:\cloverETL\bin\.\../lib/httpcore-4.3.1.jar;C:\cloverETL\bin\.\../lib/httpcore-LICENSE.txt;C:\cloverETL\bin\.\../lib/httpmime-4.3.2.jar;C:\cloverETL\bin\.\../lib/httpmime-LICENSE.txt;C:\cloverETL\bin\.\../lib/icu4j-52_1.jar;C:\cloverETL\bin\.\../lib/icu4j-LICENSE.html;C:\cloverETL\bin\.\../lib/icu4j-unicode-LICENSE.txt;C:\cloverETL\bin\.\../lib/jackson-core-asl-1.9.3.jar;C:\cloverETL\bin\.\../lib/javolution.jar;C:\cloverETL\bin\.\../lib/jaxen-1.1.6.jar;C:\cloverETL\bin\.\../lib/jcifs-1.3.17.jar;C:\cloverETL\bin\.\../lib/jets3t-0.9.0.jar;C:\cloverETL\bin\.\../lib/jms.jar;C:\cloverETL\bin\.\../lib/joda-time-2.1.jar;C:\cloverETL\bin\.\../lib/jsch-0.1.50.jar;C:\cloverETL\bin\.\../lib/jxl.jar;C:\cloverETL\bin\.\../lib/LICENSE.txt;C:\cloverETL\bin\.\../lib/log4j-1.2.17.jar;C:\cloverETL\bin\.\../lib/poi-3.8-20120326.jar;C:\cloverETL\bin\.\../lib/poi-ooxml-3.8-20120326.jar;C:\cloverETL\bin\.\../lib/poi-ooxml-schemas-3.8-20120326.jar;C:\cloverETL\bin\.\../lib/sardine-5.0.2.jar;C:\cloverETL\bin\.\../lib/signpost-commonshttp4-1.2.1.2.jar;C:\cloverETL\bin\.\../lib/signpost-core-1.2.1.2.jar;C:\cloverETL\bin\.\../lib/slf4j-api-1.7.2.jar;C:\cloverETL\bin\.\../lib/slf4j-log4j12-1.7.2.jar;C:\cloverETL\bin\.\../lib/truezip-driver-file-7.7.5.jar;C:\cloverETL\bin\.\../lib/truezip-driver-zip-7.7.5.jar;C:\cloverETL\bin\.\../lib/truezip-file-7.7.5.jar;C:\cloverETL\bin\.\../lib/truezip-kernel-7.7.5.jar;C:\cloverETL\bin\.\../lib/truezip-path-7.7.5.jar;C:\cloverETL\bin\.\../lib/truezip-swing-7.7.5.jar;C:\cloverETL\bin\.\../lib/xmlbeans-2.5.0-modified-for-WSC.jar;C:\cloverETL\bin\.\../lib/XmlSchema-1.4.7-modified-for-WSC.jar;C:\cloverETL\bin\.\../lib/XmlSchema-LICENSE.txt" "-Dclover.home=C:\cloverETL\bin\.\.." org.jetel.main.runGraph -plugins "C:\cloverETL\bin\.\..\plugins" -P:FILENAME "C:/temp/data_staging/lpl/DFM-R2FC-Account-20140619-v2.0.txt" -contexturl C:\cloverETL\AdvisorDataLoads "graph\LPLFileLoaders\Load Daily LPL Account File.grf"

In this latest attempt, I tried using forward slashes instead of backslashes since it seems to be choking on parsing the -P argument.

What am I doing wrong?

Hi skaszyk,

It seems to me this is similar issue - https://bug.javlin.eu/browse/CL-2112

Please try to quote whole expression:


"-P:FILENAME=C:\temp\data_staging\lpl\DFM-R2FC-Account-20140619-v2.0.txt"

Awesome, that did it! Thanks for your help.