1 Reply Latest reply on Mar 25, 2014 10:06 PM by Joseph_R-Oracle

    collect relative path problem with java experiments




      There is an error in way collect writes or analyze/er_print reads java experiments


      for java experiments run with relative paths like


      collect ... -j path_to_java path_to_java/bin/java -cp ../../relative/path/some.jar


      experiment is being written w/o resolving relative paths. So if later I run anzlyzer or er_print from any other directory other than original, stack traces won't contain line numbers. search/map paths do not work for it (or I didn't find a way to specify it in correct way)!


      jar ignorance (needless to say they're not archived either) makes java experiments very fragile and hard to work with...


      am I missing something or it's just the way it's supposed to work?

        • 1. Re: collect relative path problem with java experiments

          When you specify a jar file with a relative class path in the collect command and later run er_print from a different directory, er_print is not able to find the jar file references saved in the expriment - so you see the errors.


          There are two solutions to the issue:

          a) Run er_print in the same directory where collect was run to capture the experiment so the relative paths get resolved correctly.


          b) Add the following to <dot>er<dot>rc  ( .er.rc )

          addpath /FULL_PATH_AND_NAME_OF_JAR_FILE



          addpath /libpath/<blah>/test.jar


          If you had multiple jar files you could specify as follows:

          addpath /libpath/<blah>/test.jar:/libpath/<blah>/test2.jar


          Note there can be a .er.rc in two locations

          a) The home directory

          b) The directory from where you run the analyzer (i.e. er_print) (the current directory)

          The current directory takes precedence.


          This will allow er_print to pickup the jar file from the correct location and report correctly.