schemaspy / schemaspy

Database documentation built easy
http://schemaspy.org
GNU Lesser General Public License v3.0
3.22k stars 314 forks source link

SchemaSpy was unable to generate diagram(s) of table relationships. - ORACLE #854

Closed DeZan01 closed 2 years ago

DeZan01 commented 2 years ago

command line: java -jar schemaspy-6.1.0.jar -t orathin -cat % -db xxx -s xxx -host xxx -port 1537 -u xxx1 -p xxx -o Oracle_POZZI_prod -dp classes1210.jar -i "(POZ.*)" -noimplied -rails -noviews -vizjs

obtain this: INFO - Starting Main v6.1.0 onxxx INFO - The following profiles are active: default INFO - Started Main in 1.112 seconds (JVM running for 1.731) INFO - The following profiles are active: default INFO - Started Main in 1.112 seconds (JVM running for 1.731) INFO - Starting schema analysis INFO - Connected to Oracle - Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production With the Partitioning, OLAP and Data Mining options INFO - Gathering schema details Gathering schema details................................................WARN - Failed to retrieve stored procedure/function details using sql 'SELECT s.owner || '.' || s.name AS routine_name, s.TYPE AS routine_type, a.DATA_TYPE AS dtd_identifier, 'PL/SQL' AS routine_body, dbms_xmlgen.convert(xmlagg(xmlelement(e,s.text,'').extract('//text()') order by s.line).GetClobVal(), 1) AS routine_definition, null as is_deterministic, null AS sql_data_access, null AS security_type, null AS sql_mode, null AS routine_comment FROM all_source s LEFT OUTER JOIN all_arguments a ON a.OWNER = s.owner AND a.OBJECT_NAME = s.NAME AND a.DATA_LEVEL = 0 AND a.argument_name IS null where s.owner = :schema GROUP BY s.owner, s.name, s.TYPE, a.data_type' ORA-31011: XML parsing failed

(5sec) Connecting relationships................................................(0sec) Writing/graphing summary.INFO - Gathered schema details in 0 seconds INFO - Writing/graphing summary Exception in thread "main" java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119) at java.base/java.lang.reflect.Method.invoke(Method.java:577) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) Caused by: java.lang.IllegalArgumentException: viz.js at org.schemaspy.output.diagram.vizjs.VizJSDot.(VizJSDot.java:49) at org.schemaspy.SchemaAnalyzer.generateHtmlDoc(SchemaAnalyzer.java:324) at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:260) at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:123) at org.schemaspy.cli.SchemaSpyRunner.runAnalyzer(SchemaSpyRunner.java:98) at org.schemaspy.cli.SchemaSpyRunner.run(SchemaSpyRunner.java:87) at org.schemaspy.Main.main(Main.java:55) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ... 5 more Caused by: java.lang.NullPointerException: Cannot invoke "javax.script.ScriptEngine.eval(String)" because "this.scriptEngine" is null at org.schemaspy.output.diagram.vizjs.VizJSDot.(VizJSDot.java:47) ... 12 more

In the relationships and Orphans tab obtain this error messages:

SchemaSpy was unable to generate diagram(s) of table relationships. Check application output for details.

SchemaSpy was unable to generate diagrams for all orphan tables. Check application output for details.

some suggestion?

Thanks Devid

npetzall commented 2 years ago

The included Javascript engine in Java was removed in Java 11 I think or after 11.

Since you are using Java 18 you need to provide your own Javascript engine. You could probably use V8 or one provided by the eclipse foundation.

Other options are to use Graphviz binaries.

This relates to #733

npetzall commented 2 years ago

I'll try to get a cpl hours today to figure out a solution Java 17 is LTS so we need to handle this for 15 and newer.

Simples solution might be to add an additional classpath into the jar so that libraries can be added and proper check an message when starting with the vizjs option.

DeZan01 commented 2 years ago

Simples solution might be to add an additional classpath into the jar so that libraries can be added and proper check an message when starting with the vizjs option.

Have you an example?

tks

DeZan01 commented 2 years ago

I have add the binaries and insert parameter "-gv ".\Graphviz"" but have the same result

INFO - Connected to Oracle - Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production With the Partitioning, OLAP and Data Mining options INFO - Gathering schema details Gathering schema details................................................WARN - Failed to retrieve stored procedure/function details using sql 'SELECT s.owner || '.' || s.name AS routine_name, s.TYPE AS routine_type, a.DATA_TYPE AS dtd_identifier, 'PL/SQL' AS routine_body, dbms_xmlgen.convert(xmlagg(xmlelement(e,s.text,'').extract('//text()') order by s.line).GetClobVal(), 1) AS routine_definition, null as is_deterministic, null AS sql_data_access, null AS security_type, null AS sql_mode, null AS routine_comment FROM all_source s LEFT OUTER JOIN all_arguments a ON a.OWNER = s.owner AND a.OBJECT_NAME = s.NAME AND a.DATA_LEVEL = 0 AND a.argument_name IS null where s.owner = :schema GROUP BY s.owner, s.name, s.TYPE, a.data_type' ORA-31011: XML parsing failed

(5sec) Connecting relationships................................................(0sec) Writing/graphing summary.INFO - Gathered schema details in 0 seconds INFO - Writing/graphing summary INFO - Graphviz rendered set to '' ..ERROR - RelationShipDiagramError Failed to produce diagram for: Oracle_POZZI_prod1\diagrams\summary\relationships.real.compact.dot ERROR - RelationShipDiagramError Failed to produce diagram for: Oracle_POZZI_prod1\diagrams\summary\relationships.real.large.dot .ERROR - Failed to produce diagram for: Oracle_POZZI_prod1\diagrams\orphans\POZ_LOG_ACCESSI.1degree.dot Failed to generate Orphan diagram ERROR - Failed to produce diagram for: Oracle_POZZI_prod1\diagrams\orphans\POZ_POZZI_CANCELLATI.1degree.dot Failed to generate Orphan diagram ERROR - Failed to produce diagram for: Oracle_POZZI_prod1\diagrams\orphans\POZ_TAB_SONDAGGI_CELLA.1degree.dot Failed to generate Orphan diagram ERROR - Failed to produce diagram for: Oracle_POZZI_prod1\diagrams\orphans\POZ_LOG_MODIFICHE.1degree.dot Failed to generate Orphan diagram ERROR - Failed to produce diagram for: Oracle_POZZI_prod1\diagrams\orphans\POZ_POZZO_SPOSTATO.1degree.dot Failed to generate Orphan diagram ERROR - Failed to produce diagram for: Oracle_POZZI_prod1\diagrams\orphans\POZ_TAB_CODICE_COMPOSIZIONE.1degree.dot Failed to generate Orphan diagram ERROR - Failed to produce diagram for: Oracle_POZZI_prod1\diagrams\orphans\POZ_LIVELLO_STRAT.1degree.dot Failed to generate Orphan diagram ERROR - Failed to produce diagram for: Oracle_POZZI_prod1\diagrams\orphans\POZ_POZZO_STRAT.1degree.dot Failed to generate Orphan diagram .....(2sec) Writing/diagramming detailsINFO - Completed summary in 2 seconds INFO - Writing/diagramming details Exception in thread "main" java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119) at java.base/java.lang.reflect.Method.invoke(Method.java:577) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) Caused by: org.schemaspy.output.diagram.DiagramException: Failed to generate Table diagram at org.schemaspy.output.diagram.DiagramFactory.generateTableDiagram(DiagramFactory.java:71) at org.schemaspy.output.html.mustache.diagrams.MustacheDiagramFactory.generateTableDiagram(MustacheDiagramFactory.java:44) at org.schemaspy.output.html.mustache.diagrams.MustacheTableDiagramFactory.generateTableDiagrams(MustacheTableDiagramFactory.java:80) at org.schemaspy.SchemaAnalyzer.generateHtmlDoc(SchemaAnalyzer.java:426) at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:260) at org.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:123) at org.schemaspy.cli.SchemaSpyRunner.runAnalyzer(SchemaSpyRunner.java:98) at org.schemaspy.cli.SchemaSpyRunner.run(SchemaSpyRunner.java:87) at org.schemaspy.Main.main(Main.java:55) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ... 5 more Caused by: org.schemaspy.output.diagram.DiagramException: Dot missing or invalid version at org.schemaspy.output.diagram.graphviz.GraphvizDot.generateDiagram(GraphvizDot.java:193) at org.schemaspy.output.diagram.DiagramFactory.generateTableDiagram(DiagramFactory.java:68) ... 14 more

npetzall commented 2 years ago

For vizjs thing something like the example in https://github.com/schemaspy/schemaspy/issues/733#issuecomment-710694335

Corrections for versions but that's with GraalJS. You download and put in same dir as schemaspy-jar.

npetzall commented 2 years ago

Graphviz make sure it's not version 3.0 that hasn't been fully tested and there is a version check that probably prohibits use of 3.0

Also schemaspy appends bin/dot to gv args so it should be the folder containing the bin dir.

DeZan01 commented 2 years ago

Graphviz make sure it's not version 3.0 that hasn't been fully tested and there is a version check that probably prohibits use of 3.0

Also schemaspy appends bin/dot to gv args so it should be the folder containing the bin dir.

I try with version graphviz-2.50.0 and now the report is complete and correct ... first i use versione 3.0

thanks a lot.

Devid