Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 202777

Summary: Hard coded paths in shell scripts SetConfig.sh
Product: z_Archived Reporter: Youmm P. <kototamo>
Component: TPTPAssignee: Bing Xu <xubing>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: igor.alelekov, jcayne, jkubasta
Version: unspecifiedKeywords: plan
Target Milestone: ---Flags: jcayne: review+
Hardware: PC   
OS: Linux   
Whiteboard: closed460
Attachments:
Description Flags
Patch to add new error message when config.jar can't be found none

Description Youmm P. CLA 2007-09-10 06:26:02 EDT
Build ID: I20070621-1340

Steps To Reproduce:


More information:
Some users have the following problem "ERROR: The Java Runtime in use does not contain a suitable JAXP feature
RESOLUTION: Use a JRE which supports the JAXP feature
". This is due to an hardcoded "../lib" path in the SetConfig.sh . Such paths should not be used. A workaround is to launch the script from the 'bin' directory. The script should rely on the value of TPTP_AC_HOME.
Comment 1 Samson Wai CLA 2007-09-10 11:45:33 EDT
The script cannot be dependent on the TPTP_AC_HOME environment variable since this may be undefined. For example: when the Agent Controller is being repackaged and installed via InstallShield. We purposely remove the need for users to define any environment variable when setting up the AC. This will prevent the config generator from pointing to an older, possibly uninstalled AC due to a system-defined TPTP_AC_HOME environment variable.
Comment 2 Youmm P. CLA 2007-09-11 03:52:21 EDT
OK. Then at least not harcoding "../lib" by using another variable or by using the position of the executable (in 'bin') to find the corresponding 'lib' directory.
Comment 3 Samson Wai CLA 2007-09-11 09:43:04 EDT
Adjust sizing.
Comment 4 Samson Wai CLA 2007-09-11 10:13:40 EDT
The relative path problem is common across Windows and Linux. It may be fixed on Linux using bash scripts but not as trivial on Windows. I am open to suggestions on how to get this fixed on Windows.

On Linux, I can use the $0 operator to determine the path of the SetConfig.sh script. Unfortunately this may not always return a fully qualified path. This may cause the config generator to insert relative paths into the config file. The current design of the AC config file requires fully qualified paths in order for the AC to be started by any user from any directory. I may be able to workaround this by prepending the $PWD operator as well but this will requires a significant change in the SetConfig.sh script which is a risky change considering we are closing down TPTP 4.4.1.

We will need a common solution to cover both Windows and Linux. In the meantime, since we have a workaround available, can we agree on having this deferred to TPTP 4.5?
Comment 5 Youmm P. CLA 2007-09-11 11:26:18 EDT
For Linux something like this would be fine:

FULL_PATH=`cd "\`dirname "$0"\`" > /dev/null; pwd; cd - > /dev/null  `

For Windows I don't know neither.

"In the
meantime, since we have a workaround available, can we agree on having this
deferred to TPTP 4.5?" => I suppose the question is not intended for me but if it this yes, of course, you can deferred the fix.
Comment 6 Samson Wai CLA 2007-11-27 09:30:39 EST
Hi Bing. I have transferred my bugs to you for triage. Thanks.
Comment 7 Bing Xu CLA 2008-01-16 16:16:21 EST
On Windows, the setconfig should only be run from the <Agent Controller Installation Dir>/bin.  This was specified in the getting_started.html shipped with AC. 

TPTP AC is installed by unzipping the file and the setconfig.bat script won't be able to find out the installation directory. Using '../lib/config.jar' in setconfig.bat seems reasonable.  The other choice is to ask user to specify the AC installation directory at the beginning of setconfig.

If there is no clean solution to this problem and given that the getting_started.html guide has stated that the setconfig must be run from the <install dir>/bin, I think we should close this defect.  


Comment 8 jkubasta CLA 2008-02-06 21:03:16 EST
Igor, do you have a preference?
Comment 9 Igor Alelekov CLA 2008-02-07 04:45:55 EST
I agree with Bing that SetConfig should be run from the %TPTP_AC_HOME%\bin directory as it is recommended in the getting_started.html.

But I would suggest to change this script and error messag which confuses users ("JAXP not found.."). This is also important for IAC where config.jar resides in another plugin.

I suggest to add check if ../lib/config.jar is present and print corresponding message before JAXP checking.

Comment 10 Bing Xu CLA 2008-03-04 13:35:26 EST
Created attachment 91547 [details]
Patch to add new error message when config.jar can't be found
Comment 11 Bing Xu CLA 2008-03-04 13:36:12 EST
Joe, can you review this patch.  Thanks.
Comment 12 Joel Cayne CLA 2008-03-05 15:48:39 EST
Patch looks good. Patch checked into HEAD.
Comment 13 Paul Slauenwhite CLA 2009-06-30 12:10:36 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since this enhancement/defect has been resolved and unverified for more than 1 year and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.