Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 66713 invoked from network); 26 Jul 2006 22:49:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Jul 2006 22:49:50 -0000 Received: (qmail 41313 invoked by uid 500); 26 Jul 2006 22:49:42 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 41285 invoked by uid 500); 26 Jul 2006 22:49:42 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 41276 invoked by uid 99); 26 Jul 2006 22:49:42 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Jul 2006 15:49:42 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Jul 2006 15:49:40 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E58A141000A for ; Wed, 26 Jul 2006 22:47:13 +0000 (GMT) Message-ID: <7200928.1153954033937.JavaMail.jira@brutus> Date: Wed, 26 Jul 2006 15:47:13 -0700 (PDT) From: "Ramandeep Kaur (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Created: (DERBY-1597) Scripts in frameworks direcotry needs to be revisted to set up CLASSPATH properly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Scripts in frameworks direcotry needs to be revisted to set up CLASSPATH properly --------------------------------------------------------------------------------- Key: DERBY-1597 URL: http://issues.apache.org/jira/browse/DERBY-1597 Project: Derby Issue Type: Bug Components: Demos/Scripts Affects Versions: 10.2.0.0 Reporter: Ramandeep Kaur Assigned To: Andrew McIntyre Need to revisit scripts in directory frameworks/embedded/bin and frameworks/NetworkServer/bin for setting up CLASSPATH properly. The current problem is as following: If user already has a CLASSPATH set on their system, the CLASSPATH is not set again within the script. Therefore, there are no derby classes in the CLASSPATH which results in java command failing as it can not find the derby class it is calling. Basically, to make the scripts work, user has to either issue command "set CLASSPATH=" or have derby jar files be appended to their system CLASSPATH before running any frameworks batch script. In ksh scripts, there is same problem except that the user has to issue command "export CLASSPATH=" or have derby jar files be appended to their system CLASSPATH only once as whatever CLASSPATH is set up by scripts is not visible once the script is done. So I am proposing the following solution so that frameworks scripts work properly without interfering with system classpath or without any setup from user. In batch scripts:- ---------------------- 1. Before line "call "%DERBY_INSTALL%"/frameworks/embedded/bin/setEmbeddedCP.bat", save the current classpath as follows: set SAVED_CLASSPATH=%CLASSPATH% 2. Replace the following lines: @if !"%CLASSPATH%"==! call "%DERBY_INSTALL%"/frameworks/embedded/bin/setEmbeddedCP.bat @if "%CLASSPATH%" == "" call "%DERBY_INSTALL%"/frameworks/embedded/bin/setEmbeddedCP.bat with call "%DERBY_INSTALL%"/frameworks/embedded/bin/setEmbeddedCP.bat Note: I have given the above as example only. The name of script that is getting called may be different. 3. At the end of script, reset the CLASSPATH to system CLASSPATH as follows: set CLASSPATH=%SAVED_CLASSPATH% In korn scripts:- ---------------------- In ksh script, even though system classpath is only modified within the script and is not effective once script exits, to be consistent with batch scripts, do the following: 1. Before line ". "$DERBY_HOME"/frameworks/embedded/bin/setEmbeddedCP.ksh" save the current classpath as follows: export SAVED_CLASSPATH=$CLASSPATH 2. Replace the following lines: [ -z "$CLASSPATH" ] && { . "$DERBY_HOME"/frameworks/embedded/bin/setEmbeddedCP.ksh } with . "$DERBY_HOME"/frameworks/embedded/bin/setEmbeddedCP.ksh Note: I have given the above as example only. The name of script that is getting called may be different. 3. At the end of script, reset the CLASSPATH to system CLASSPATH as follows: export CLASSPATH=$SAVED_CLASSPATH -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira