Forum Discussion

M_McDonald's avatar
M_McDonald
Super Contributor
15 years ago

[RESOLVED]Error with property expansion in JDBC connection

I am using a dialog to collect a database username and password at the time a project opens, then using property expansions for the user and password properties in the JDBC connection (see screenshot.)

When I test the connection from the Database Configuration wizard, the connection works, but when I execute a JDBC Request step using the connection, I get the following error:

Mon Mar 01 10:08:53 EST 2010:ERROR:java.lang.IllegalArgumentException: Illegal group reference
   java.lang.IllegalArgumentException: Illegal group reference
    at java.util.regex.Matcher.appendReplacement(Unknown Source)
    at java.util.regex.Matcher.replaceFirst(Unknown Source)
    at java.lang.String.replaceFirst(Unknown Source)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.getDatabaseConnection(JdbcSubmit.java:244)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.prepare(JdbcSubmit.java:306)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.runQuery(JdbcSubmit.java:197)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.run(JdbcSubmit.java:162)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)


UPDATE: Perhaps this is a scope issue - maybe the wizard has direct access to the 'project' variable, but this needs to be accessed differently when actually in the request step?

3 Replies

  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Minor progress: for the username, the following expansion will work in the actual JDBC Request step:

    [tt:3d4vdrp5]${=testStep.testCase.testSuite.project.trackerUser.username}[/tt:3d4vdrp5]

    If I use the actual password, I can successfully execute the step, but the same expansion for password still gives me the IllegalArgumentException.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    This should be fixed in the upcoming nightly build, thanks for bringing it to our attention.

    Regards,
    Dain
    eviware.com
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Working well now.

    This pretty much solves my problem with using JDBC connections without storing the username/password in the project file.

    Thanks!