This discussion is archived
4 Replies Latest reply: Oct 7, 2013 9:07 AM by h.baer RSS

WLST command line utility "storeUserConfig()"  is not working for 12c OHS

958937 Newbie
Currently Being Moderated
Hi All,

I am facing issue with WLST command line utility with "*storeUserConfig()*" command.


I have installed Standalone OHS 12c (Not managed OHS with WLS), configure and start the Node Manager.

I start the WLST command line utility from : <MW_HOME>/ohs/common/bin/wlst.sh

I connect node manager with : nmConnect('weblogic', 'welcome1', nmType='plain', domainName='base_domain')

wls:/offline> nmConnect('weblogic', 'welcome1', nmType='plain', domainName='base_domain')
Connecting to Node Manager ...
Successfully Connected to Node Manager.

wls:/nm/base_domain> nmStart(serverName='ohs10', serverType='OHS')
Starting server ohs10 ...
Successfully started server ohs10 ...

Now When I am running storeUserConfig(), it's giving me below error :

wls:/nm/base_domain> storeUserConfig()
Traceback (innermost last):
File "<console>", line 1, in ?
NameError: storeUserConfig

I also try with storeUserConfig('/scratch/12cORC/security/myuserconfigfile.secure', '/scratch/12cORC/security/myuserkeyfile.secure') which also give same error.

I am not able to recognize this error. What should I need to do to create the User config file ?

Please suggest me the solution.

I am referring this doc : http://docs.oracle.com/cd/E15586_01/web.1111/e13813/reference.htm#

Thanks,
Amit Nagar
  • 1. Re: WLST command line utility "storeUserConfig()"  is not working for 12c OHS
    RenévanWijk Oracle ACE
    Currently Being Moderated
    When connected to the node manager you can use
    wls:/nm/base_domain> storeUserConfig(nm='true');
    Currently connected to Node Manager to monitor the domain base_domain.
    Creating the key file can reduce the security of your system if it is not kept in a secured location after it is created. Do you want to create the key file? y or ny
    The username and password that were used for this WebLogic NodeManager connection are stored in /home/weblogic/weblogic-WebLogicConfig.properties and /home/weblogic/weblogic-WebLogicKey.properties.
    To use just storeUserConfig() you need to be connected to a WebLogic Server (for example the AdminServer)
    wls:/base_domain/serverConfig> storeUserConfig();
    Creating the key file can reduce the security of your system if it is not kept in a secured location after it is created. Do you want to create the key file? y or ny
    The username and password that were used for this WebLogic Server connection are stored in /home/weblogic/weblogic-WebLogicConfig.properties and /home/weblogic/weblogic-WebLogicKey.properties.
    The error you are getting "NameError: storeUserConfig" indicates that the 'method' could not be found, are starting WLST by using wlst.sh (or .cmd) in this case the necessary classes should be loaded.

    You can also try the deprecated weblogic.Admin utility (http://middlewaremagic.com/weblogic/?p=6547).
  • 2. Re: WLST command line utility "storeUserConfig()"  is not working for 12c OHS
    958937 Newbie
    Currently Being Moderated
    Hi,

    I have installed Standalone Oracle Http Server 12c. Which don't have weblogic related artifacts or classes.

    So on that case, when I run wlst.sh and run below command,

    wls:/offline> storeUserConfig(nm='true')
    Traceback (innermost last):
    File "<console>", line 1, in ?
    NameError: storeUserConfig
    wls:/offline>

    Class path set for wlst.sh *"CLASSPATH=:/scratch/12cORC/ohs/common/wlst/lib/ohs-wlst.jar:/scratch/12cORC/ohs/common/wlst/resources/ohswlsthelp.jar:/scratch/12cORC/wlserver/modules/wlstt3client.jar:/scratch/12cORC/oracle_common/common/lib/config-launch.jar:/scratch/12cORC/oracle_common/common/wlst/lib/*.jar"*

    does storeUserConfig() supported for Standalone Oracle Http Server 12c?

    Thanks,
    Amit Nagar
  • 3. Re: WLST command line utility "storeUserConfig()"  is not working for 12c OHS
    RenévanWijk Oracle ACE
    Currently Being Moderated
    A WebLogic distribution has the necessary classes, when running setWLSEnv, you get the following classpath:
    CLASSPATH=/home/weblogic/weblogic12.1.1/installation/patch_wls1211/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/weblogic/weblogic12.1.1/installation/patch_ocp371/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/weblogic/jrockit-jdk1.6.0_29-R28.2.2-4.1.0/lib/tools.jar:/home/weblogic/weblogic12.1.1/installation/wlserver_12.1/server/lib/weblogic_sp.jar:/home/weblogic/weblogic12.1.1/installation/wlserver_12.1/server/lib/weblogic.jar:/home/weblogic/weblogic12.1.1/installation/modules/features/weblogic.server.modules_12.1.1.0.jar:/home/weblogic/weblogic12.1.1/installation/wlserver_12.1/server/lib/webservices.jar:/home/weblogic/weblogic12.1.1/installation/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/home/weblogic/weblogic12.1.1/installation/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:
    in which weblogic.jar (probably) contains the necessary Jython modules needed to run storeUserConfig. As the default distribution of ' Standalone Oracle Http Server 12c' does not contain these modules it is probably not supported.
  • 4. Re: WLST command line utility "storeUserConfig()"  is not working for 12c OHS
    h.baer Newbie
    Currently Being Moderated

    It's probably a little late for the original poster, but in case anybody else stumbles on this thread (like me today), I found a workable solution to this problem:

    For a Standalone HTTP Server there exists in $domain_home/bin a command startComponent.sh or (on Windows) startComponent.cmd. This accepts as parameter the ComponentName which will typically be ohs1 and as second parameter storeUserConfig. Documentation on this can be found here:

    http://docs.oracle.com/middleware/1212/webtier/HSADM/getstart.htm#CHDJGIII (scroll down to

    4.3.2.3 Starting Oracle HTTP Server Instances from the Command Line).

     

    startComponent.sh ohs1 storeUserConfig

     

    Unfortunately this doesn't tell you where you'll find the config and key-File. However, on a second invocation I found that - at least on windows where I tested this - they get written into c:\users\<username>\.wlst so I'd expect them in the home directory on unix. After copying the files to a more common location, I was able to reference them the usual way (formatted for better readability):

     

    wls:/offline> nmConnect(userConfigFile='C:/app/Middleware/Oracle_Home/user_projects/domains/base_domain/nodemanager/security/nm-cfg-base_domain.props',

    userKeyFile='C:/app/Middleware/Oracle_Home/user_projects/domains/base_domain/nodemanager/security/nm-key-base_domain.props',

    host='localhost',

    port='5556',

    domainName='base_domain')

     

    Connecting to Node Manager ...
    Successfully Connected to Node Manager.

     

    Best Regards

    Holger

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points