Solaris custom environment variables in crontab

Hi everyone,
I am searching a way to use custom variable on my crontab.
In fact, I need to launch a binary file which will use the "swap" command, but the swap command is not in the PATH of the crontab.
I know that on Linux it's possible to define directly a variable in the crontab, but in solaris it fails....
I tried this (for test) : env > /cron.env
and the output was :
HOME=/
LOGNAME=root
PATH=/usr/sbin:/usr/bin
SHELL=/usr/bin/sh
TZ=Europe/Paris
I also tried : source /etc/profile ; env > /cron.env
but the output was the same.
does anybody knows a way to define custom variable in the solaris crontab?
thx a lot in advance

Hi,
For example you need to set a veriable name IMAP_ROOT
Please follow the steps
1) Make a sciprt in /root (You can save the script as per your required location)
#vi Set_Veriable.sh
#!/bin/bash
IMAP_ROOT=/opt/OMC;
export IMAP_ROOT
2)Set the permission
#chmod 755 Set_Veriable.sh
3) Exectue the script
#. /root/Set_Veriable.sh (There should be a space between dot and /)
4) Now test the result
#echo $IMAP_ROOT
/opt/OMC
5) Now put the /root/Set_Veriable.sh file under cron
Please share your feedback.
Thanks,
Myth

Similar Messages

  • Using custom environment variables in the profile path

    Hi,
    I've created a custom environment variable that I've setup on two computers and the domain controllers.  I want to use this in the profile path in user properties.  However when users log in the variable is taken literally rather than being converted
    into the value.  For example
    \\fileserver\share\user\%myenv%.v2 is generated rather than \\fileserver\share\user\envdata.v2
    If I add in another built-in variable such as %OS%, that converts properly but any time I use a custom variable Windows just doesn't use it during the logon process.  If I open up Explorer and type in the path to my data as it should be it works fine
    so Windows is definitely picking up the variable, just not using during the logon process.  I can't seem to find a TechNet article that states custom variables can't be used in profile paths.
    Has anyone else come across this?
    Thanks,
    Tim

    Hi,
    Thanks for your post.
    So did you create the environment variable using group policy? If yes, i would suggest you use 'Create' and not 'Update', the variable is then held through reboots.
    Please refer to this blog, hope it will be helpful
    http://blogs.technet.com/b/askds/archive/2013/07/31/roaming-profile-compatibility-the-windows-7-to-windows-8-challenge.aspx
    Regards.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Add firewall rule with custom environment variable in program path

    Hi,
    We want to create a firewall rule for a program which is placed in folder which changes sometimes. I know you can add a firewall with the ProgramFiles environment variable like this:
    netsh advfirewall firewall add rule name="Test Firewall rule" dir=in program="%%ProgramFiles%%\Test\Test.exe" action=allow security=notrequired
    The environment variable ProgramFiles isn't expanded and if the Program Files folder is different on a system the rule still works.
    We try to use this with a custom environment variable which we set a system environment variable with this command:
    SETX SomeFolder "D:\Some Folder\Apr 2015" /M
    If we use the command below to add the firewall rule in a batch file the environment variable SomeFolder is expanded correctly and the program path is added as a static path.
    netsh advfirewall firewall add rule name="Some Firewall Rule" dir=in program="%SomeFolder%\AFile.exe" action=allow security=notrequired
    Because the folder changes sometimes we want to change the environment variable SomeFolder and not remove the old firewall rule and create a new one. We want to add the environment variable SomeFolder to the program path as a (dynamic) environment variable
    and not as the expanded path at the moment when the rule is added. If we use this command:
    netsh advfirewall firewall add rule name="Some Firewall Rule" dir=in program="%%SomeFolder%%\AFile.exe" action=allow security=notrequired
    We get the error:
              Windows Firewall with Advanced Security
              An error occurred while adding the rule.
              Error: The parameter is incorrect
              Status: The application name could not be resolved
              OK   
    Why can't we use %%SOMEFOLDER%% like we can use %%PROGRAMFILES%%? The same error is shown when we try to add the firewall rule through the management console 'Windows Firewall with Advanced Security'
    W. Spu

    Hi,
    Based on my plenty of test with this problem, it seems like there is no better method to achieve your requirement. To add new policy to firewall, it would be better using general cmdlet. The path parameter like %%SomeFolder%% do have problem in add firewall
    policy cmdlet. 
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Extract Environment Variable from System Variables

    Hi,
    I want to define a custom environment variable manually and from my code I want to retrieve the value for that system variable which I have created.
    Steps:
    Manual Actions
    1. Right Click "My Computer" >> Properties >> Advanced System Settings >> Advanced >> Environment Variables
    Here I have 2 options. User Variables and System Variables.
    In either of these I have to declare a variable - "Test Region" and its value as "Test1"
    Now, when I run my c# program I have to get "Test1" as output when I provide "Test Region" as parameter.
    Please provide me the code for this.

    Dear Cheong,
    It is working perfect now, when I restarted the PC.
    But the problem is each time when I change the Value of the environment variable, I need to restart the PC to make it effective.
    Is there any solution for this?
    Your support is much appreciated.

  • Help with setting environment variable on solaris 10

    hi, i am new to solaris. i have solaris 10 x86, and as root user, i installed jdk 6 into /usr/jdk/jdk1.6.0_20. now i want to add the path /usr/jdk/jdk1.6.0_20/bin to my path variable. also i want to set JAVA_HOME. but each time i do this, and close the terminal, it resets. i mean when i echo $JAVA_HOME, i get nothing and if i echo $path, the address i aded is no longer there too.
    what can i do to make this permanent. and do i have to set it for every user, or will the one set by root, be seen by all users?
    thanks.

    Assuming you're using tcsh, then I typically place my environment variables in my .login.
    You can also place them in your .tcshrc file.
    Use
    setenv JAVA_HOME <path>
    for tcsh.
    For the Bourne shell, you can put them in the .profile file.
    Use
    JAVA_HOME=<path>
    export JAVA_HOME
    -- Ken

  • How do I clear environment variables in 10.6

    I am having some difficulty in configuring custom paths with my environment variable, environment.plist.  In setting up some of my software, I am trying to configure custom paths so that I can eventually store preferences on the server for all users to access the same tools.  I had this working up until last week, when I installed a second piece of software, that modified my environment.plist file, which now doesn't work at all.
    My original environment.plist file, which is located in ~/MacOSX, was as follows:
    <plist version="1.0">
      <dict>
        <key>NUKE_PATH</key>
        <string>/Users/jamesdavidson/Documents/Nuke_Gizmos/Nuke</string>
        <key>OFX_PLUGIN_PATH</key>
        <string>/Users/jamesdavidson/Documents/Nuke_Gizmos/OFX</string>
      </dict>
    </plist>
    Which worked just fine.  It was then changed to:
    <plist version="1.0">
      <dict>
        <key>NUKE_PATH</key>
        <string>/Users/jamesdavidson/Documents/Nuke_Gizmos/Nuke</string>
        <key>OFX_PLUGIN_PATH</key>
        <string>/Users/jamesdavidson/Documents/Nuke_Gizmos/OFX</string>
        <key>PATH</key>
        <string>/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/Applications/Deadline/Resou rces/bin</string>
      </dict>
    </plist>
    and now, the only variable that shows up is PATH.  I edited the file back to the original, without the PATH variable, restarted my machine, and yet my Variables did not change...  Is there somewhere else that I should be looking?  Some other file?   this is what I get from terminal:
    $ echo $NUKE_PATH
    $ echo $OFX_PLUGIN_PATH
    $ echo $PATH
    /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Applications/Deadline /Resources/bin
    And this even after deleting my environment.plist file.  Any help would be appreciated.
    Thanks,
    James

    I hope you made a typo in your post and meant ~/.MacOSX.  You typed ~/MacOSX, i.e., without the leading dot.
    At any rate $PATH is a predefined shell variable so I suspect you cannot define that one with this environment.plist mechanism.  The "proper" way to set up such things is with a  ~/.bash_profile, ~/.bash_login, ~/.profile, or IMO, best of all. ~/.bashrc.  These are scripts the shell looks for during launch (somewhat depending on whether it's a login shell or not -- see the bash reference manual).
    If bash is executed interactively it will also first look for /etc/profile.  And it will cause a $PATH variable to be created.  So that is probably the definition you are seeing all the time until you create an appropriate startup script of your own (e.g., ~/.bashrc) to override or modifiy the existing $PATH variable.
    Note, I may have paraphrased a lttile too much so see section 6.2 Bash Startup Files in the bash reference documentation for the complete proper description of the order these files are used.  If you have the developer tools installed look for bashref.html.  Otherwise it's online here.
    Finally, if you look at /etc/profile you will see it attempting to execute /usr/libexec/path_helper -s.  Try that in terminal and see if that isn't the $PATH definition you are currently seeing.

  • Library paths and environment variables

    Hello,
    I am using 10g AS 9.0.4 on a Unix system.
    I am trying to convert an old JSP web application to work with 10g. It is not an EAR/WAR file so I am manually trying to set it up under the "default-web-app" folder. It uses a number of java class files which currently reside in $J2EE_HOME/default-web-app/WEB-INF/classes/mystuff.
    These class files require access to a number of libraries. I foolishly believed that they would be accessible if I were to place them in the $J2EE_HOME/default-web-app/WEB-INF/lib folder, but that did not work.
    I read that OC4J uses a "catch all" lib directory at $J2EE_HOME/applib. I copied the library files there and they still did not work.
    Frustrated, I tried to print out the environment variables for the server - only to find that this function is not supported.
    I managed to print out the library path by creating a Java class files which returns the following as a string:
    System.getProperty("java.library.path");
    This (when called from a JSP) prints a number of different library paths, none of which match those found listed in the $J2EE_HOME/config/application.xml file. I placed the library files in one of the paths listed by the "java.library.path" and it worked!
    3 questions:
    1. How do you print the server's environment variables using a JSP? This strikes me as a very useful function for sorting out library and path issues. Do a search on Google for "print environment variables OC4J" or something similar and there are no useful pages suggesting how this can be done.
    2. Why are the default library paths different on the server than to those specified in application.xml?
    3. How do I change the LD_LIBRARY_PATH (or any environment variable for that matter)? I have tried adding the following line to $ORACLE_HOME/Apache/Jserv/etc/jserv.properties without success:
    wrapper.env=LD_LIBRARY_PATH=/my/custom/library/path
    Any help you can offer would be most appreciated.

    >
    Thanks very much for a such a comprehensive response
    - it has helped answer a lot of questions, especially
    being able to print out the system properties. That
    will be really useful!
    No worries at all Rob.
    The main hurdle is that the libraries are indeed
    native (*.so) libraries. I hadn't considered that
    until you pointed it out in your message. Can I
    assume, then, that $J2EE_HOME/applib and
    $J2EE_HOME/default-web-app/WEB-INF/lib are only
    designed to handle Java's .JAR librares? That would
    explain why placing the native libraries in there
    didn't work, but is there a way of getting such
    native libraries recognised and bundled up in a
    WAR/EAR file?
    Yep, that's it.
    Our proprietary applib and the servlet specs web-inf/lib are only dealing with Java archives.
    The J2EE specs don't cover how to deal with native libs like this.
    Now I've NEVER EVER tried it, but it's worth a shot of at least trying -- for simplified packaging purposes, what you may be able to do is to distribute the .so's within the web-inf/lib -- and then just set that directory (where's its realized on the server after the app is deployed) to be referenced witihn the LD_LIBRARY_PATH. I'd expect our deployment manager will just ignore files it doesn't know about, so arguably you should be able to at least distribute them with the standard archive.
    You'll need to specifically set the LD_LIBRARY_PATH as a separate task outside of the deployment operation though.
    >
    This is where things get a bit weird, and is partly
    my fault during the installation of 10g AS.
    We already had an existing installation of Oracle 10g
    Database (10.1.0) at $ORACLE_HOME under the user
    "oracle". I logged in as the user "oracle" to install
    the Application Server into a different location (In
    this case, "$ORACLE_HOME/../ias10g_9.0.4" - let's
    call this $IAS_HOME). So there is no separate user
    account for Oracle Database and Application Server
    (and hence no separate $LD_LIBRARY_PATH).
    If I log into UNIX as the user "oracle" and echo the
    LD_LIBRARY_PATH, I get the following directories:
    $ORACLE_HOME/lib
    /usr/openv/netbackup/bin
    /usr/dt/lib
    /usr/lib
    I use this user to do "opmnctl stopall" and "opmnctl
    startall". If I then print out the library path from
    a JSP using
    "System.getProperty("java.library.path");", I get the
    following paths:
    $IAS_HOME/jdk/jre/lib/sparc/server
    $IAS_HOME/jdk/jre/lib/sparc
    $IAS_HOME/jdk/jre/../lib/sparc
    $IAS_HOME/opmn/lib
    $IAS_HOME/lib
    $IAS_HOME/usr/lib
    Which is totally different to those listed by
    $LD_LIBRARY_PATH at the command line, which means
    they must be coming from somewhere else.
    It gets worse - my application is trying to call a
    native library that is only present in the
    $ORACLE_HOME/lib32 directory (libclntsh.so.10.1), so
    unless I can include this path in the
    "java.library.path" on the Applicaiton Server, then
    my program will not work.
    So, how do I change the "java.library.path" when the
    values aren't coming from $LD_LIBRARY_PATH in the
    first place?
    The utility $IAS_HOME/opmn/bin/opmnctl is actually a shell script.
    It has this section which sets the LD_LIBRARY_PATH:
    if [ -z "$LD_LIBRARY_PATH" ]
    then
    LD_LIBRARY_PATH=$ORACLE_HOME/opmn/lib:$ORACLE_HOME/lib ; export LD_LIBRARY_PATH
    else LD_LIBRARY_PATH=$ORACLE_HOME/opmn/lib:$ORACLE_HOME/lib:${LD_LIBRARY_PATH} ; export LD_LIBRARY_PATH
    fi
    So if you have an existing LD_LIBRARY_PATH env var set, it should just be putting its paths onto the front of it.
    What you could try as a quick test is to edit the opmnctl script (after taking a backup of course) and either appending the path you need to it, or just add some debug statements to output the LD_LIBRARY_PATH value it ends up setting so you can try and work out what's causing it.
    I expect these other entries:
    $IAS_HOME/jdk/jre/lib/sparc/server
    $IAS_HOME/jdk/jre/lib/sparc
    $IAS_HOME/jdk/jre/../lib/sparc
    are coming from the JRE when it is launched, in probably a similar manner to our opmn entries.
    I really appreciate your help, and I bet if anyone
    can answer these questions, you can! ;-)
    You're very welcome.
    cheers
    -steve-

  • Best practice for setting an environment variable used during NW AS startup

    We have installed some code which is running in both the ABAP and JAVA environment, and some functionality of this code is determined by the setting of operating system environment variables. We have therefore changed the .sapenv_<host>.csh and .sapenv_<host>.sh scripts found in the <sid>adm user home directory. This works, but we are wondering what happens when SAP is upgraded, and if these custom shell script changes to the .sh and .csh scripts will be overwritten during such an upgrade. Is there a better way to set environment variables so they can be used by the SAP server software when it has been started from <sid>adm user ?

    Hi,
    Thankyou. I was concerned that if I did that there might be a case where the .profile is not used, e.g. when a non-interactive process is started I was not sure if .profile is used.
    What do you mean with non-interactive?
    If you login to your machine as sidadm the profile is invoked using one of the files you meant. So when you start your Engine the Environment is property set. If another process is spawned or forked from a running process it inherits / uses the same Environment.
    Also, on one of my servers I have a .profile a .login and also a .cshrc file. Do I need to update all of these ?
    the .profile is used by bash and ksh
    The .cshrc is used by csh and it is included via source on every Shell Startup if not invoked with the -f Flag
    the .login is also used by csh and it is included via source from the .cshrc
    So if you want to support all shells you should update the .profile (bash and ksh) and one of .cshrc or .login for csh or tcsh
    In my /etc/passwd the <sid>adm user is configured with /bin/csh shell, so I think this means my .cshrc will be used and not the .profile ? Is this correct ?
    Yes correct, as described above!
    Hope this helps
    Cheers

  • Unix shell: Environment variable works for file system but not for ASM path

    We would like to switch from file system to ASM for data files of Oracle tablespaces. For the path of the data files, we have so far used environment variables, e.g.,
    CREATE TABLESPACE BMA DATAFILE '${ORACLE_DB_DATA}/bma.dbf' SIZE 2M AUTOEXTEND ON;
    This works just fine (from shell scripts, PL/SQL packages, etc.) if ORACLE_DB_DATA denotes a file system path, such as "/home/oracle", but doesn’t work if the environment variable denotes an ASM path like "\+DATA/rac/datafile". I assume that it has something to do with "+" being a special character in the shell. However, escaping "\+" didn’t work. I tried with both bash and ksh.
    Oracle managed files (e.g., set DB_CREATE_FILE_DEST to +DATA/rac/datafile) would be an option. However, this would require changing quite a few scripts and programs. Therefore, I am looking for a solution with the environment variable. Any suggestions?
    The example below is on a RAC Attack system (http://en.wikibooks.org/wiki/RAC_Attack_-OracleCluster_Database_at_Home). I get the same issues on Solaris/AIX/HP-UX on 11.2.0.3 also.
    Thanks,
    Martin
    ==== WORKS JUST FINE WITH ORACLE_DB_DATA DENOTING FILE SYSTEM PATH ====
    collabn1:/home/oracle[RAC1]$ export ORACLE_DB_DATA=/home/oracle
    collabn1:/home/oracle[RAC1]$ sqlplus "/ as sysdba"
    SQL*Plus: Release 11.2.0.1.0 Production on Fri Aug 24 20:57:09 2012
    Copyright (c) 1982, 2009, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Data Mining and Real Application Testing options
    SQL> CREATE TABLESPACE BMA DATAFILE '${ORACLE_DB_DATA}/bma.dbf' SIZE 2M AUTOEXTEND ON;
    Tablespace created.
    SQL> !ls -l ${ORACLE_DB_DATA}/bma.dbf
    -rw-r----- 1 oracle asmadmin 2105344 Aug 24 20:57 /home/oracle/bma.dbf
    SQL> drop tablespace bma including contents and datafiles;
    ==== DOESN’T WORK WITH ORACLE_DB_DATA DENOTING ASM PATH ====
    collabn1:/home/oracle[RAC1]$ export ORACLE_DB_DATA="+DATA/rac/datafile"
    collabn1:/home/oracle[RAC1]$ sqlplus "/ as sysdba"
    SQL*Plus: Release 11.2.0.1.0 Production on Fri Aug 24 21:08:47 2012
    Copyright (c) 1982, 2009, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Data Mining and Real Application Testing options
    SQL> CREATE TABLESPACE BMA DATAFILE '${ORACLE_DB_DATA}/bma.dbf' SIZE 2M AUTOEXTEND ON;
    CREATE TABLESPACE BMA DATAFILE '${ORACLE_DB_DATA}/bma.dbf' SIZE 2M AUTOEXTEND ON
    ERROR at line 1:
    ORA-01119: error in creating database file '${ORACLE_DB_DATA}/bma.dbf'
    ORA-27040: file create error, unable to create file
    Linux Error: 2: No such file or directory
    SQL> -- works if I substitute manually
    SQL> CREATE TABLESPACE BMA DATAFILE '+DATA/rac/datafile/bma.dbf' SIZE 2M AUTOEXTEND ON;
    Tablespace created.
    SQL> drop tablespace bma including contents and datafiles;

    My revised understanding is that it is not a shell issue with replacing +, but an Oracle problem. It appears that Oracle first checks whether the path starts with a "+" or not. If it does not (file system), it performs the normal environment variable resolution. If it does start with a "+" (ASM case), Oracle does not perform environment variable resolution. Escaping, such as "\+" instead of "+" doesn't work either.
    To be more specific regarding my use case: I need the substitution to work from SQL*Plus scripts started with @script, PL/SQL packages with execute immediate, and optionally entered interactively in SQL*Plus.
    Thanks,
    Martin

  • How can I pass environment variables to the child process?

    How can I pass environment variables to the child process? This is what I tried and it didn't work.
         static public void main (String[] args) throws Exception {
              ProcessBuilder b = new ProcessBuilder("java", "-cp", ".", "Child");
              Map<String, String> map = b.environment();
              map.put("custom.property", "my value");
                 b.redirectErrorStream(true);
              Process p = b.start();
              BufferedReader reader = new BufferedReader (new InputStreamReader(p.getInputStream()));
              String line = null;
              while (null != (line = reader.readLine())) {
                   System.out.println(line);
         public static void main(String[] args) {
              System.out.println("The value of custom.property is : " + System.getProperty("custom.property"));
         }and the result is:
    The value of custom.property is : null

    Complete test:
         static public void main (String[] args) throws Exception {
              ProcessBuilder b = new ProcessBuilder("java", "-Dcustom.property=my property value", "-cp", ".", "Child");
              Map<String, String> map = b.environment();
              map.put("custom.property", "my environment value");
                 b.redirectErrorStream(true);
              Process p = b.start();
              BufferedReader reader = new BufferedReader (new InputStreamReader(p.getInputStream()));
              String line = null;
              while (null != (line = reader.readLine())) {
                   System.out.println(line);
         public static void main(String[] args) {
              System.out.println("Property value of custom.property is : " + System.getProperty("custom.property"));
              System.out.println("Environment value of custom.property is : " + System.getenv("custom.property"));          
         }

  • Using environment variables in RMAN command line

    I'm running Oracle 11gR2 and working in a Solaris 10 environment.
    I am trying to run the rman command by connecting to the target, auxiliary, and catalog by catting out the contents of password files where I have my connect strings stored for each database. Also in there I am trying to use environment variables to reference each database.
    rman target "`cat ${HOME}/password_dir/prod_connect.txt`@${PROD_DB}" auxiliary "`cat ${HOME}/password_dir/stage_connect.txt`@`${STAGE_DB}`" catalog "`cat ${HOME}/password_dir/rman_catalog_connect.txt`@${RMAN_CATALOG_DB}"
    The end result I need is:
    rman target "username/password@db" auxiliary "username/password@db" catalog "username/password@db"
    Is this possible?

    Levi,
    Good idea on the variables. I set up a variable with my connect string including the TNS reference (i.e. user/password@XXX)
    So when I run this:
    rman auxiliary ${AUXILIARY}
    I get this:
    Recovery Manager: Release 11.2.0.2.0 - Production on Wed Jun 13 10:19:44 2012
    Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00554: initialization of internal recovery manager package failed
    RMAN-04006: error from auxiliary database: ORA-01031: insufficient privileges
    But if I try to run it without the TNS entry it works. The only issue with that is I need the TNS reference to connect to the database I'm cloning from. Any idea what's going on here?
    Also, the same applies to the TARGET, but oddly enough not the CATALOG. It will connect to my rman catalog using the TNS just fine. The only difference is with the catalog I'm logging in as my rman catalog user. With the TARGET and AUXILIARY I'm logging in as the system user.
    Edited by: Nevin on Jun 13, 2012 8:25 AM

  • Changing environment variables not reflected in axis2.

    Hi,
    I am using axis2(1.2).And my problem is that I am trying to call two or more webservice from the same host .Let me explain.I have a web page .Its take some info to serach and also the parameter to which service to call.Suppose there are two service running (A and B).For A, need the following environment to set before calling :
    System.setProperty("javax.net.ssl.keyStore",keyStore);
    System.setProperty("javax.net.ssl.keyStorePassword", keyPwd);
    System.setProperty("javax.net.ssl.keyStoreType",keyType);
    System.setProperty("javax.net.ssl.trustStoreType",trustType);
    System.setProperty("javax.net.ssl.trustStore",trustStore);
    System.setProperty("javax.net.ssl.trustStorePassword",trustPwd);And for B do not required any environment variable.
    When I try to connect the B(clear all the environment) after accessing the A its throw the following exception :
    org.apache.axis2.AxisFault: sun.security.validator.ValidatorException:
    PKIX path building failed:
    sun.security.provider.certpath.SunCertPathBuilderException: unable to find
    valid certification path to requested targetBut if I restart the webserver and try to call B its working but if I try to access A its failed.
    So its seem to me that once the environment is set its not possible to reset it.
    So is there any solution.
    Thanks & Regrads

    i haven't used axis2 specifically, but i would imagine that it provides a way to configure that connection information for a specific webservice connection (as opposed to globally for the jvm). a quick google for "axis 2 custom keystore" found this link: http://shivendra-tripathi.blogspot.com/2010/11/enabling-ssl-for-axis2-service-and.html which shows how to configured an axis2 client with a custom keystore ("Approach 2", at the very end of the article). actually, looking again at that article, it may be configuring a system-wide setting (the Protocol.registerProtocol() call looks to be static). this looks better: http://wso2.org/library/1646 .
    Edited by: jtahlborn on Jul 11, 2011 2:06 PM

  • Environment variables of Winnt winxp

    I wanna set Environment variables of Winnt or winxp thro' Java

    Actually, if you can get access to the registry, you can view/set the user's environment variables at
    HKEY_CURRENT_USER\Environment
    and the system environment variables at
    HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Evironment
    Note that this is specific to Windows NT 4.0, there's no guarantee that they will be in the same location on other flavours of Windows. Note further that this will certainly work only on Windows machines... there is (AFAIK) no standard way to set environment variables for Linux, BSD or Solaris systems.
    For the particularly brave (or stupid, or both :-), there is a beta(/alpha) registry interface for Java
    http://www.algorekiss.com/wsnE682.html

  • Error submitting environment variable containing spaces

    Hello,
    I need some help passing an environment variable that contains spaces to the JVM when launched via the command line
    I can successfully use the following and read its value in the java application:
    java -DMYVAR=value.cfg myClass
    However, when I try
    java -DMYVAR="value1.cfg, value2.cfg, value3.cfg" myClass
    I get the following exception
    Exception in thread "main" java.lang.NoClassDefFoundError: value2/cfg"
    It looks like the inverted commas are being discarded and the JVM is treating value2.cfg as a class to execute
    I have run this on
    1) a Solaris box with the following details:
    SunOS trafford 5.6 Generic_105181-26 sun4u sparc SUNW,Ultra-4
    and java version
    java version "1.2.1"
    Solaris VM (build Solaris_JDK_1.2.1_04, native threads, sunwjit)
    2) an HP box with the following details:
    HP-UX wpsc02 B.11.00 U 9000/800 105911507 unlimited-user license
    and java version
    java version "1.4.1.00"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1.00-030116-09:58)
    Java HotSpot(TM) Server VM (build 1.4.1 1.4.1.00-030116-11:27-PA_RISC2.0 PA2.0, mixed mode)
    We want to do this so that we can get the value of MYVAR, split up the string using a StringTokenizer on the "," and pick out as many tokens as are present. As a workaround, we can leave out the spaces and it works fine, but it would be useful to be able to allow the spaces
    Thanks in advance to anyone who has any ideas about what is happening or how to solve this

    Try this:
    java "-DMYVAR=value1.cfg, value2.cfg, value3.cfg" myClass
    Notice the quotes are in front of the -D, not the equal sign.
    Juan

  • Use environment variables in logging.properties file

    is there a way to use environment variables in logging.properties file?
    like this -
    java.util.logging.FileHandler.pattern = {$MY_BASE_LOG_FOLDER}/myapp1/log/123%g.logdo I have to write a custom logging.properties loader? if yes, then are there any examples on this?

    I'm sorry, but don't you think your answer is useless?
    Maybe I haven't made my question clear enough. I need to know if java.util.logging recognizes environment variables in logging.properties files.
    If it does not, then there should be a well-known class to use instead of standard loader for logging.properties (java api mention one briefly).

Maybe you are looking for

  • Report Painter for GL balances

    Dear Experts, I would like to create a report through report painter, which gives the GL balances Business Area wise under Profit centers. I'm using the 0FL New General Ledger Library. I'm able to get GL balances either Business area wise or Profit c

  • Reg smartforms -  creating a new page for each customer

    Hai friends, i have selection option for customer(kunnr) in the selection crieria.. Now i am getting the output in the smartfroms related to the customer details.. But i am getting details for only one customer... suppose there are 10  customers.. i

  • How to use Parameter from file in window env

    hi All, Please tell me the how I can get Parameter from Saved file and can use in other file. EX: I want to use Password file for each instance like ORCL-manager ORCL_1-tiger ORCL_2-***** how to call this file in other file. using pasword for instanc

  • How to allocate order by checking the price scales during MRP run

    Hi, Here is a scenario. A material XXXX is being supplied by Vendor A and Vendor B. Vendor A has got price scale as below For Order qty 0-10 pc  --  Rs. 10 per pc For Order qty 11-20pc --  Rs. 10 per pc Vendor B has got price scale as below For Order

  • Setting up SafePoint on NAS, myCloud doesn't ask for username and password

    I couldn't find an answer to this in the forum.  I'm trying to set up a Safepoint on a Synology NAS. I have it configured so that you need a user name and password to access this share the safepoint should go to. When I try to set the Safepoint up in