2

I am trying to generate class diagram from the source code through UmlGraph. I have built and created the umlgraph.jar but while i am using it in my project it is giving me the below error ::

[javadoc] java.io.IOException: Cannot run program "dot": CreateProcess error=2, The system cannot find the file specified
  [javadoc]     at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
  [javadoc]     at java.lang.Runtime.exec(Runtime.java:593)
  [javadoc]     at java.lang.Runtime.exec(Runtime.java:466)
  [javadoc]     at org.umlgraph.doclet.UmlGraphDoc.runGraphviz(UmlGraphDoc.java:131)
  [javadoc]     at org.umlgraph.doclet.UmlGraphDoc.generatePackageDiagrams(UmlGraphDoc.java:95)
  [javadoc]     at org.umlgraph.doclet.UmlGraphDoc.start(UmlGraphDoc.java:63)
  [javadoc]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [javadoc]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  [javadoc]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  [javadoc]     at java.lang.reflect.Method.invoke(Method.java:597)
  [javadoc]     at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:269)
  [javadoc]     at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:143)
  [javadoc]     at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:340)
  [javadoc]     at com.sun.tools.javadoc.Start.begin(Start.java:128)
  [javadoc]     at com.sun.tools.javadoc.Main.execute(Main.java:41)
  [javadoc]     at com.sun.tools.javadoc.Main.main(Main.java:31)

I have downloaded the GraphViz and set the path for the graphviz. please help me guys i am new to this one.

The javadoc target in ant file ::

    <fileset dir="${srcroot.dir}" >
            <filename name="**/*.java"/>
        </fileset>

               <doclet name="org.umlgraph.doclet.UmlGraphDoc"
                  path="${umlLib.dir}/UmlGraph.jar">
                    <param name="-attributes"  />
                    <param name="-operations"  />
                    <param name="-qualify" />
                    <param name="-types"  />
                    <param name="-visibility"  />
                </doclet>
              </javadoc>
      <apply executable="dot" dest="${reports.dir}" parallel="false">
        <arg value="-Tpng"/>
        <arg value="-o"/>
         <targetfile/>
         <srcfile/>
         <fileset dir="${reports.dir}" includes="*.dot"/>
         <mapper type="glob" from="*.dot" to="*.png"/>
      </apply>
</target>
user3322822
  • 133
  • 3
  • 13
  • Ant isn't finding "dot" or "dot.exe" on the PATH. What OS are you running (Windows, Unix, etc.)? – Chad Nouis Jun 25 '14 at 13:24
  • @ChadNouis :: i am using windows 7 – user3322822 Jun 26 '14 at 06:53
  • @ChadNouis :: i have downloaded the graphViz dot file processor from http://www.graphviz.org/Download_source.php, and gave the path of the bin..actually i m trying to do this by following this tutorial::http://java.dzone.com/articles/reverse-engineer-source-code-u – user3322822 Jun 26 '14 at 07:13
  • In a Command Prompt, run the following and post the output: `ant -diagnostics | findstr java.library.path` – Chad Nouis Jun 26 '14 at 15:44
  • Where's you dot executable located? Does the path contain whitespace like `program files`? – Dante WWWW Jun 30 '14 at 09:04
  • @coolcfan :: it is not containning the program files. – user3322822 Jul 02 '14 at 09:37
  • @ChadNouis :: actually now the error coming is :: dot.exe has stopped working.. now actually the dot file is executing. it is working sometime but in most of the cases it is not. sorry for the delay in answering. – user3322822 Jul 02 '14 at 09:40

4 Answers4

3

I got the same "dot" message. http://sourceforge.net/p/schemaspy/discussion/462849/thread/38a9bfad/#7a89 indicates to restart your machine after installing GraphViz and adding it to your path. I did this and that did the trick.

Jim Bethancourt
  • 1,061
  • 11
  • 16
0

Add path to \graphviz-2.38\release to your classpath and you are done.

Sandy
  • 11
  • 2
0

I had the common issues about the mysql-connector and the dot executable file. It's not necessary to restart the machine if you pass the correct value to -gv, believe me. I've installed the Graphviz and found the mysql-connector performing a sorted search of *.jar files.

The following lines are how I executed the statement.

java 
-jar schemaSpy.jar 
-t mysql 
-o library 
-host localhost 
-db dummyDB 
-u user
-p user
-dp C:\Oracle\Middleware\Oracle_Home\oracle_common\modules\mysql-connector-java-commercial-5.1.22\mysql-connector-java-commercial-5.1.22-bin.jar 
-gv "C:\Program Files (x86)\Graphviz2.38"
Jcc.Sanabria
  • 629
  • 1
  • 12
  • 22
0

This requires installation of GraphViz. Information is available here. https://graphviz.gitlab.io/download/

vikoo
  • 2,451
  • 20
  • 27