Menu

#120 problem with -all and -schemas option

open
5
2014-08-14
2010-10-28
Matt
No

I have postgres database organized with many different schemas with relations between them. I tried using the -all option but I am getting '/usr/local/common/java/bin/java: No Match" error messages (see below). The result is an index.html file located in the right place, but none of the subdirectories with subsequent analysis for each of the schemas is produced. I get these same results when I use the -schemas option also.
Looks like a bug to me, or am I doing something wrong?

303% java -jar -classpath /nfs/pancake/u2/home/doggett/java/lib/postgresql.jar /nfs/pancake/u2/home/doggett/java/schemaSpy_5.0.0.jar -t pgsql -host *****-u *****-pfp -dp /nfs/pancake/u2/home/doggett/java/lib/postgresql.jar -db data -all -o packrat/data
Failed to query Graphviz version information
with: dot -V
java.io.IOException: Cannot run program "dot": java.io.IOException: error=2, No such file or directory
Using database properties:
[/nfs/pancake/u2/home/doggett/java/schemaSpy_5.0.0.jar]/net/sourceforge/schemaspy/dbTypes/pgsql.properties
Password:
Analyzing schemas that match regular expression '.*':
(use -schemaSpec on command line or in .properties to exclude other schemas)
agrimet alaska asos canada coop epa gem hja hyd information_schema meta misc normals pg_catalog public qc_monthly raws samson smart snotel test wrcc
Analyzing agrimet
/usr/local/common/java/bin/java: No match.
Analyzing alaska
/usr/local/common/java/bin/java: No match.
Analyzing asos
/usr/local/common/java/bin/java: No match.
Analyzing canada
/usr/local/common/java/bin/java: No match.
Analyzing coop
/uAnalyzing epa
sr/local/common/java/bin/java: No match.
/usr/localAnalyzing gem
/common/java/bin/java: No match.
/usr/local/common/javAnalyzing hjaa
/bin/java: No match.
/usr/local/common/jAnalyzing hyda
va/bin/java: No match.
/usr/local/common/jAnalyzing information_schema
ava/bin/java: No match.
/usr/local/common/java/bin/java: No match.
Analyzing meta
/usr/local/common/jAnalyzing misca
va/bin/java: No match.
/usr/local/common/jaAnalyzing normalsv
a/bin/java: No match.
/usr/local/common/javaAnalyzing pg_catalog/
bin/java: No match.
/usr/local/common/jAnalyzing publica
va/bin/java: No match.
/usr/local/common/jaAnalyzing qc_monthlyv
a/bin/java: No match.
/usr/local/common/jaAnalyzing raws
va/bin/java: No match.
/usr/local/common/jaAnalyzing samsonv
a/bin/java: No match.
/usr/local/common/jAnalyzing smarta
va/bin/java: No match.
/usr/local/common/java/bin/java: NAnalyzing snotelo
match.
/usr/local/common/jaAnalyzing testv
a/bin/java: No match.
/usr/local/common/jaAnalyzing wrcc
va/bin/java: No match.
/usr/local/common/j
ava/biWrote relationship details of 22 schemas in 0 seconds.n
/jaStart with packrat/data/index.htmlv
a: No match.

Discussion

  • John Currier

    John Currier - 2010-10-29

    I'm not exactly sure how it ran at all. You didn't give a jar to java's -jar option, but it apparently was able to skip over the -classpath stuff to get it.

    Try removing the "-classpath /nfs/pancake/u2/home/doggett/java/lib/postgresql.jar" from the command completely. That does nothing when you use -jar and seems to have caused some unexpected behavior.

    Let me know if that resolves it,
    John

     
  • Matt

    Matt - 2010-10-29

    Actually the jar file was given immediately after the -classpath option. So I tried it without the -classpath and it does the same thing.

    java -jar /nfs/pancake/u2/home/doggett/java/schemaSpy_5.0.0.jar -t pgsql -host packrat -u prismdb -pfp -dp /nfs/pancake/u2/home/doggett/java/lib/postgresql.jar -db data -schemas "agrimet,asos,coop,meta" -o packrat/data

    Incidentally, when I run this command, it NEVER prompts for a password. If I change -schemas to simply a single schema (ie. -s agrimet), it prompts for a password and runs flawlessly.

     
  • John Currier

    John Currier - 2010-10-29

    For some reason your java shell script is failing and returning a 0 return code. That's a deviation of normal return code standards.

    Can you try the latest beta ( http://schemaspy.sourceforge.net/schemaSpy.jar ) with "-loglevel fine"? That will dump what I use to execute java for each schema. With that output we should be able to determine why your java is giving the "No match" error.

    John

     
  • Matt

    Matt - 2010-10-29

    OK. Ran it but no change in results. Output as follows. Note, as a point of clarification (may be a red herring), when I use the -all switch, it prompts for a password. When I use the -schemas option, it does NOT prompt for password. Regardless, the results are the same. Also, schemaspy DOES generate an index.html file, but of course none of the links work since the corresponding subdirectories never get built.

    -Matt
    viento 382% /usr/local/common/java/bin/java -jar ~/java/schemaSpy.jar -t pgsql -host packrat -u prismdb -pfp -dp ~/java/lib/postgresql.jar -db data -schemas "public,agrimet,asos,coop" -o packrat/data -loglevel fine
    13:35:25.880 INFO: SchemaAnalyzer.analyze - Starting schema analysis
    Analyzing schemas:
    public agrimet asos coop
    Analyzing public
    13:35:25.983 FINE: MultipleSchemaAnalyzer.analyze - Analyzing schema with: [Ljava.lang.String;@1bca5f1
    /usr/local/common/java/bin/java: No match.
    Analyzing agrimet
    13:35:26.003 FINE: MultipleSchemaAnalyzer.analyze - Analyzing schema with: [Ljava.lang.String;@15b9e68
    /usr/local/common/java/bin/java: No match.
    Analyzing asos
    13:35:26.021 FINE: MultipleSchemaAnalyzer.analyze - Analyzing schema with: [Ljava.lang.String;@18ee9d6
    /usr/local/common/java/bin/java: No match.
    Analyzing coop
    13:35:26.039 FINE: MultipleSchemaAnalyzer.analyze - Analyzing schema with: [Ljava.lang.String;@1f42b49
    /usr/local/common/java/bin/java: No match.

    Wrote relationship details of 4 schemas in 0 seconds.
    Start with packrat/data/index.html
    viento 383%

    13:32:50.844 INFO: SchemaAnalyzer.analyze - Starting schema analysis
    Analyzing schemas:
    agrimet asos public meta
    Analyzing agrimet
    13:32:50.948 FINE: MultipleSchemaAnalyzer.analyze - Analyzing schema with: [Ljava.lang.String;@1bca5f1
    /usr/loAnalyzing asos
    cal/c13:32:50.973 FINE: MultipleSchemaAnalyzer.analyze - Analyzing schema with: [Ljava.lang.String;@15b9e68
    ommon/java/bin/java: No match.
    /usr/local/coAnalyzing public
    mmon13:32:50.993 FINE: MultipleSchemaAnalyzer.analyze - Analyzing schema with: [Ljava.lang.String;@18ee9d6
    /java/bin/java: No match.
    /usr/local/common/java/bin/java: No match.
    Analyzing meta
    13:32:51.013 FINE: MultipleSchemaAnalyzer.analyze - Analyzing schema with: [Ljava.lang.String;@1f42b49
    /usr/local/common/
    javaWrote relationship details of 4 schemas in 0 seconds.
    /bStart with packrat/data/index.htmli
    n/java: No match.

     
  • Matt

    Matt - 2010-10-29

    Oh. And incase it matters

    viento 385% java -version
    java version "1.6.0_18"
    Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
    Java HotSpot(TM) Server VM (build 16.0-b13, mixed mode)

    And the JDBC: postgresql-9.0-801.jdbc4.jar

    Running on an RHEL server.

     
  • John Currier

    John Currier - 2010-11-01

    I screwed up with that one. Please download the beta again, re-run with "-loglevel fine" and we'll hopefully see what's wrong.

    Thanks,
    John

     
  • Matt

    Matt - 2010-11-01

    OK. Got the new jar file. I ran this with the -schemas option. Still odd that it doesn't ask for a password, but the results are the same. A little more STDERR with this one. Also, I get the same error using -all option, I just didn't want to overload you with dozens more of the same error for all the schemas.

    Matt

    viento 116% java -jar ~/java/schemaSpy.jar -t pgsql -dp ~/java/lib/postgresql.jar -host packrat -u prismdb -pfp -db data -schemas 'agrimet,asos,meta' -o test -loglevel fine
    15:29:12.009 INFO: SchemaAnalyzer.analyze - Starting schema analysis
    Analyzing schemas:
    agrimet asos meta
    Analyzing agrimet
    15:29:12.106 FINE: MultipleSchemaAnalyzer.analyze - Analyzing schema with: [java, -Doneofmultipleschemas=true, -jar, /nfs/pancake/u2/home/doggett/java/schemaSpy.jar, -ahic, -dp, "/nfs/pancake/u2/home/doggett/java/lib/postgresql.jar", -css, "schemaSpy.css", -charset, "ISO-8859-1", -font, "Helvetica", -fontsize, "11", -t, "pgsql", -renderer, ":gd", -pfp, -u, "prismdb", -db, "data", -host, "packrat", -loglevel, "fine", -sqlFormatter, "net.sourceforge.schemaspy.view.DefaultSqlFormatter", -i, ".*", -I, "", -x, "[^.]", -X, "[^.]", -dbthreads, "2147483647", -maxdet, "300", -s, agrimet, -o, test/agrimet]
    /usr/local/common/java/bin/java: No match.
    Analyzing asos
    15:29:12.126 FINE: MultipleSchemaAnalyzer.analyze - Analyzing schema with: [java, -Doneofmultipleschemas=true, -jar, /nfs/pancake/u2/home/doggett/java/schemaSpy.jar, -ahic, -dp, "/nfs/pancake/u2/home/doggett/java/lib/postgresql.jar", -css, "schemaSpy.css", -charset, "ISO-8859-1", -font, "Helvetica", -fontsize, "11", -t, "pgsql", -renderer, ":gd", -pfp, -u, "prismdb", -db, "data", -host, "packrat", -loglevel, "fine", -sqlFormatter, "net.sourceforge.schemaspy.view.DefaultSqlFormatter", -i, ".*", -I, "", -x, "[^.]", -X, "[^.]", -dbthreads, "2147483647", -maxdet, "300", -s, asos, -o, test/asos]
    /usr/local/common/java/bin/java: No match.
    Analyzing meta
    15:29:12.146 FINE: MultipleSchemaAnalyzer.analyze - Analyzing schema with: [java, -Doneofmultipleschemas=true, -jar, /nfs/pancake/u2/home/doggett/java/schemaSpy.jar, -ahic, -dp, "/nfs/pancake/u2/home/doggett/java/lib/postgresql.jar", -css, "schemaSpy.css", -charset, "ISO-8859-1", -font, "Helvetica", -fontsize, "11", -t, "pgsql", -renderer, ":gd", -pfp, -u, "prismdb", -db, "data", -host, "packrat", -loglevel, "fine", -sqlFormatter, "net.sourceforge.schemaspy.view.DefaultSqlFormatter", -i, ".*", -I, "", -x, "[^.]", -X, "[^.]", -dbthreads, "2147483647", -maxdet, "300", -s, meta, -o, test/meta]
    /usr/local/common/java/bi
    n/jaWrote relationship details of 3 schemas in 0 seconds.v
    a: Start with test/index.htmlN
    o match.

     
  • John Currier

    John Currier - 2010-11-02

    Ignore the fact that it doesn't ask for a password. That's Java isn't launching the child SchemaSpy processes that would be asking.

    Does this command execute on your environment (all one line)?

    java -Doneofmultipleschemas=true -jar /nfs/pancake/u2/home/doggett/java/schemaSpy.jar -ahic -dp "/nfs/pancake/u2/home/doggett/java/lib/postgresql.jar" -css "schemaSpy.css" -charset "ISO-8859-1" -font "Helvetica" -fontsize "11", -t "pgsql" -renderer ":gd" -pfp -u "prismdb" -db "data" -host "packrat" -sqlFormatter "net.sourceforge.schemaspy.view.DefaultSqlFormatter" -i ".*" -I "" -x "[^.]" -X "[^.]" -dbthreads "2147483647" -maxdet "300" -s asos -o test/asos

    That's what it's trying to execute when you get the "/usr/local/common/java/bin/java: No match." error. I have no clue what would cause your JVM to fail like that since the wildcards are enclosed in quotes.

    John

     
  • Matt

    Matt - 2010-11-02

    I get a different error when I run this command. Very odd:

    viento 171% java -Doneofmultipleschemas=true -jar /nfs/pancake/u2/home/doggett/java/schemaSpy.jar -ahic -dp "/nfs/pancake/u2/home/doggett/java/lib/postgresql.jar" -css "schemaSpy.css" -charset "ISO-8859-1" -font "Helvetica" -fontsize "11", -t "pgsql" -renderer ":gd" -pfp -u "prismdb" -db "data" -host "packrat" -sqlFormatter "net.sourceforge.schemaspy.view.DefaultSqlFormatter" -i ".*" -I "" -x "[^.]" -X "[^.]" -dbthreads "2147483647" -maxdet "300" -s asos -o test/asos

    java.lang.IndexOutOfBoundsException: Index: 5, Size: 5

     
  • John Currier

    John Currier - 2010-11-02

    Bizarre. The same command fundamentally works from the command line but not when executed as a child process. That's assuming, of course, that the IndexOutOfBoundsException came from SchemaSpy and not from the "java" shell script. Was there a stack trace with that exception? It might give us a clue.

    One of your posts showed launching java via "/usr/local/common/java/bin/java". That directory is in your PATH, right? When SchemaSpy launches the child processes it just calls java w/o attempting to specify a path. One observation is that you have java directory in your home directory. I don't see how it could, but I wonder if that is somehow confusing things.

    John

     
  • Matt

    Matt - 2010-11-02

    No stack trace at all. Just the IndexOutOfBoundsException. Not very useful is it?. That's all that STDOUT/STDERR put to the terminal when I ran the command. I agree that this is very weird. I've done a bit of java coding and this one certainly rates in the odd category.

    java ('which java') refers to /usr/local/bin/java which is in my path and is aliased to the actual location at /usr/local/common/java/bin/java. I tried being explicit before just in case it made a different. And the java in my HOME is only a local place to stash java libraries and isn't in any PATH or CLASS environment.

    I may take a look at the source code myself to see if I spot anything. Though if you the expert who wrote it is befuddled, not sure I'd be much help. It's certainly possible that it is some odd environment issue, but I would have hoped between the error messages and your background knowledge, the solution would have surfaced.

    Incidentally, what exactly is the -all or -schemas supposed to do. Does it simply iteratively call the schemaspy app foreach schema that it finds ( I can do that in a shell script), or is there more behind-the-scenes stuff that it does?

     
  • John Currier

    John Currier - 2010-11-02

    Yes, -all just iterates over each schema (passing -Doneofmultipleschemas=true to allow cross-schema links) as well as building an index of all of them.

    There might be something about how I'm launching java that's causing the issue, but I don't know for sure. I could modify the code to explicitly use JAVA_HOME/bin/java if JAVA_HOME is set, but again, I don't know if that'll make any difference.

    John

     
  • John Currier

    John Currier - 2010-11-03

    Look at this post: http://hints.macworld.com/article.php?story=20020314095714397

    If you're using csh or tcsh then that's likely to be the cause.

    John

     

Log in to post a comment.