0

I am facing issues with Schemaspy when trying to connect with Production org. Below is the build.xml I am using -

<project default="document">

  <property name="sf.username" value="I PUT THE USERNAME"/>
  <property name="sf.password" value="I PUT PASSWORD AND SECURITY TOKEN"/>

  <target name="document">
      <echo message="Generating SchemaSpy documentation (requires Graphviz to be installed to produce diagrams)"/>
      <delete dir="doc" failonerror="false"/>
      <java classname="net.sourceforge.schemaspy.Main" fork="true" failonerror="true">
          <arg line="-t schemaspy/force"/>
          <arg line="-db Claims"/>
          <arg line="-un ${sf.username}"/>
          <arg line="-pw ${sf.password}"/>
          <arg line="-o doc"/>
          <arg line="-font Arial"/>
          <arg line="-fontsize 8"/>
          <arg line="-hq"/>
          <arg line="-norows"/>
          <arg line='-desc "Extracted from Consumer Org r${env.SVN_REVISION} on Force.com"'/>
          <arg line="-u fake"/>
          <arg line="-p fake"/>
          <arg line="-host fake"/>
          <arg line="-connprops url\=https://<I PUT THE DOMAIN>.my.salesforce.com/services/Soap/u/22.0"/>
          <classpath>
               <fileset dir="schemaspy" includes="*.jar"/>
          </classpath>
      </java>
  </target>

</project>

This is the error I am getting -

Sudiptas-MacBook-Pro:runSchemaSpy sudiptadeb$ ant
Buildfile: /Users/sudiptadeb/Documents/Sudipta Deb/Salesforce/runSchemaSpy/build.xml

document:
     [echo] Generating SchemaSpy documentation (requires Graphviz to be installed to produce diagrams)
   [delete] Deleting directory /Users/sudiptadeb/Documents/Sudipta Deb/Salesforce/runSchemaSpy/doc
     [java] java.lang.IllegalArgumentException: Illegal group reference
     [java]     at java.base/java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1068)
     [java]     at java.base/java.util.regex.Matcher.appendReplacement(Matcher.java:998)
     [java]     at java.base/java.util.regex.Matcher.replaceAll(Matcher.java:1181)
     [java]     at java.base/java.lang.String.replaceAll(String.java:2125)
     [java]     at net.sourceforge.schemaspy.util.ConnectionURLBuilder.buildUrl(ConnectionURLBuilder.java:72)
     [java]     at net.sourceforge.schemaspy.util.ConnectionURLBuilder.<init>(ConnectionURLBuilder.java:50)
     [java]     at net.sourceforge.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:139)
     [java]     at net.sourceforge.schemaspy.Main.main(Main.java:42)

BUILD FAILED
/Users/sudiptadeb/Documents/Sudipta Deb/Salesforce/runSchemaSpy/build.xml:12: Java returned: 1

Any help?

2

It's a good few years since I wrote and used this (assuming you are using force-metadata-jdbc-driver here), but looking at the stacktrace, you need more escaping in the url that is buried in the connprops. Add more backslashes...

That string passes through regular expression logic and such logic scans for special characters. Something more like this should work:

url\=https:\/\/abc\.my\.salesforce\.com\/services\/Soap\/u\/22\.0

The reason for this craziness is that the Salesforce-specific logic is slotted into an existing tool (the wonderful SchemaSpy) as if it were a JDBC driver and so extra information has to be sneaked past the SchemaSpy command-line interface.

2
  • I changed it to <arg line="-connprops url\=https:\/\/abc\.my\.salesforce\.com\/services\/Soap\/u\/22\.0"/>, but still the same problem. This is what I have in force.properties - description=Force driver=com.claimvantage.force.jdbc.ForceMetaDataDriver connectionSpec=jdbc:gunpla:force:<un>:<pw> – Sudipta Deb Sep 10 '18 at 16:44
  • @SudiptaDeb FYI, this has recently moved to github.com/claimvantage/force-metadata-jdbc-driver; the docs are a little better there. – Keith C Nov 1 '18 at 15:18
0

Ok I was able to figure it out. Having $ in the password was creating the problem. I have changed the password by removing $ and it is working fine for me now. Learned something new.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.