Cause error when use -varFile option

20 views
Skip to first unread message

Yuichi SEINO

unread,
Feb 15, 2017, 11:51:25 AM2/15/17
to SQL Workbench/J - DBMS independent SQL tool
Hi,

I want to read the file of variable. however I can't read variable because a error is caused.
I consult the manual of 5.4. Defining variables.

Would you tell me how to avoid this error ?

bulid version

Workbench-Build122

operation

~/Workbench-Build122$ cat vars.txt
#Define some values
var_id=42
person_name=Dent
another_variable=24
~/Workbench-Build122$ ./sqlwbconsole.sh -varFile=vars.txt

SQL Workbench/J (122) console interface started.
Enter exit to quit.
Enter WbHelp for a list of SQL Workbench/J specific commands
Config directory: /usr/local/external/home/seino/.sqlworkbench

SQL> WbListVars;

---- Variables
Variable | Value
---------+------

(0 Rows)

SQL> exit


workbench.log

2017-02-16 01:10:07 INFO  =================== Log started ===================
2017-02-16 01:10:07 INFO  Using configdir: /home/seino/.sqlworkbench
2017-02-16 01:10:07 ERROR Error initializing command line arguments! java.util.ArrayList cannot be cast to java.lang.String
java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String
    at workbench.util.ArgumentParser.getValue(ArgumentParser.java:567)
    at workbench.util.ArgumentParser.getValue(ArgumentParser.java:595)
    at workbench.WbManager.readVariablesFromCommandline(WbManager.java:896)
    at workbench.WbManager.readParameters(WbManager.java:822)
    at workbench.console.SQLConsole.main(SQLConsole.java:642)

2017-02-16 01:10:07 INFO  Installed signal handler for INT
2017-02-16 01:10:07 INFO  could not register signal handler for: QUIT Signal already used by VM or OS: SIGQUIT
java.lang.IllegalArgumentException: Signal already used by VM or OS: SIGQUIT
    at sun.misc.Signal.handle(Signal.java:166)
    at workbench.console.SQLConsole.installSignalHandler(SQLConsole.java:752)
    at workbench.console.SQLConsole.<init>(SQLConsole.java:110)
    at workbench.console.SQLConsole.runConsole(SQLConsole.java:649)
    at workbench.console.SQLConsole.main(SQLConsole.java:643)

2017-02-16 01:10:08 INFO  Setting default locale to: en
2017-02-16 01:10:08 INFO  SQL Workbench/J Console interface started
2017-02-16 01:10:08 INFO  Loaded statement history from /home/seino/.sqlworkbench/sqlworkbench_history.txt
2017-02-16 01:10:27 INFO  Saved statement history to /home/seino/.sqlworkbench/sqlworkbench_history.txt
2017-02-16 01:10:27 INFO  Stopping SQL Workbench/J, Build 122
2017-02-16 01:10:27 INFO  =================== Log stopped ===================


Thomas Kellerer

unread,
Feb 15, 2017, 1:13:57 PM2/15/17
to sql-wo...@googlegroups.com
That indeed is a bug. I will fix that.

Currently you can't really avoid it except for using the old -vardef parameter.

Alternatively you could add the variables to the connection profile you are using.

http://www.sql-workbench.net/manual/profiles.html#profile-variables

The easiest way to do that is to use the property file based profiles:

http://www.sql-workbench.net/manual/plain-profile-file.html

And then add something like this to the .properties file:

profile.0001.connection.variables=<properties><entry key="var_id">42</entry><entry key="person_name">Dent</key></properties>

Or you use the GUI to define the connection profile and re-use that profile from the command line.


Thanks for the feedback
Thomas

Yuichi SEINO

unread,
Feb 16, 2017, 3:20:17 AM2/16/17
to SQL Workbench/J - DBMS independent SQL tool
Thank for a reply.

I could read the file of variable by using -varDef option.
This issue was tentatively resolved.

2017年2月16日木曜日 3時13分57秒 UTC+9 Thomas Kellerer:
Reply all
Reply to author
Forward
0 new messages