WLST library

I want to customize WLST with my own set of commands as a library.
Inside my library I want to use some of the built-in commands, however these are not available inside my library. I'm basically missing an import. Can anyone help?
For example in my library I have this:
addHelpCommandGroup('myLib','myLib_doc')When I run WLST in interactive mode I get the following error:
Initializing WebLogic Scripting Tool (WLST) ...
Error importing the Python script "/opt/oracle/wls/wls1031/wlserver_10.3/common/wlst/lib/myLib.py" caused an error "Traceback (innermost last):
  File "<string>", line 1, in ?
  File "/opt/oracle/wls/wls1031/wlserver_10.3/common/wlst/lib/myLib.py", line 8, in ?
NameError: addHelpCommandGroup
Welcome to WebLogic Server Administration Scripting Shell

Thanks for the reply. I'm using WLST's home directory to customize it:
http://download.oracle.com/docs/cd/E12840_01/wls/docs103/config_scripting/using_WLST.html#wp1093407
There are three options:
- WLST commands (a .py file in WLST's home directory)
- WLST command library (a .py file in the lib directory of WLST's home)
- WLST commands as a Jython module (a .py file in the modules directory of WLST's home)
It works fine if I use the first option, all WLST commands are in the same namespace. I prefer the second option to avoid function name conflicts.
I understand that what you suggest applies to the third option, jython modules, but I will give it a try.

Similar Messages

  • WLST classpath

    I have created an ini file with writeIniFile() in wlst. Now I want to import wlst as a jython module. The problem is that it is not seeing everything in the environment. I have sourced both setDomainEnv.sh and commEnv.sh. I called jython with 'java -jar jython2.5.0/jython.jar -Dpython.path=$CLASSPATH'. But when I import the ini file I get this error message:
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "wlst_ini.py", line 16, in <module>
    theInterpreter = WLSTUtil.ensureInterpreter();
         at weblogic.Home.getInstance(Home.java:90)
         at weblogic.Home.getPath(Home.java:96)
         at weblogic.Home.getFile(Home.java:101)
         at weblogic.management.scripting.utils.WLSTInterpreter.<init>(WLSTInterpreter.java:81)
         at weblogic.management.scripting.utils.WLSTUtil.ensureInterpreter(WLSTUtil.java:131)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
    java.lang.RuntimeException: java.lang.RuntimeException: error in finding weblogic.Home
    I have tried this manually step by step to see where it fails. I can import WLSTUtil no problem. I can also import weblogic.Home. But when I call WLSTUtil.ensureInterpreter(), I get the stack trace. Why can it not find weblogic.Home when calling ensureInterpreter, even after I have imported it?

    It looks like you are using Jython 2.5. We also ran into very similar issues when trying to use this version of Jython. Through a lot of digging and reading, we discovered that WLST was only certified on the version of Jython that is bundled with WL (for us that is WL 10.0 MP1 which ships with Jython 2.1). When we switched to using Jython 2.1 (specifically we use the bundled Jython JAR files from WL), sourced $WLS_HOME/server/bin/setWLSEnv.sh, and added $BEA_HOME/modules/com.bea.cie.config_5.1.3.0.jar to the CLASSPATH to pickup some com.bea.plateng required classes used by the WLST library, everything started to work as expected. We have had no issues with Jython v2.1 (except for missing features that are available in newer Jython releases).
    Hope this helps.

  • WLST code library (exaple scripts)

    Hi there
    I search for wlst example scripts. Is there a good link to find some
    scripts (JDBC, TXDataSource usw.)
    Thank's Ruedi :-)

    Hi there
    I search for wlst example scripts. Is there a good link to find some
    scripts (JDBC, TXDataSource usw.)
    Thank's Ruedi :-)

  • Invoking deployed bpel process using WLST

    Hi All,
    Am new to WLST. So please tolerate with me if i am asking the obvious
    I read through the forums and have successfully deployed a BPEL process using WLST as given below
    ant -f ant-sca-deploy.xml -DserverURL=http://localhost:8001 -DsarLocation=C:\oracle\Middleware\PS3\Oracle_SOA1\bin\sca_esd9_jca_bpel1.1_ccgd_trn_ob_rev1.jar -Doverwrite=true -Duser=weblogic -Dpassword=welcome1 -DforceDefault=true
    And i have also tried un deploying and it works fine.
    But, the problem is, i want to invoke the deployed BPEL process either by accessing the WSDL URL (http://localhost:8001/soa-infra/services/default/esd9_jca_bpel1.1_ccgd_trn_ob/bpelprocess1_client_ep?WSDL) or by any other means using WLST. I have to send an input to this deployed process.
    I have googled it and have found ways to invoke a web service using JAVA or VBS. But is it possible to do it through WLST?
    Thanks in advance.

    Sancho,
    Thanks for the prompt reply. We trying to automate the following process:-
    1. The user select multiple documents from a folder in a library that contains all released documents.
    2. He then locks the documents.
    3. Selects the locked documents and copies it to a folder in the personal library.
    We are trying to lock and copy the documents as a 1 step process, because its difficult for the users to select all of the documents locked earlier and then copy it the personal library.
    We are trying to take the folder name as the user parameter, when the files are locked, so that the process and create the lock the files, create the folder and copy the files in this folder.
    Thanks again for your time and help.
    Hetal

  • Error while starting nodemanager in wlst, but start wit startNodeManager.sh

    Hi,
    I cannot start node manager using wlst, but can start with startNodeManager.sh ( present in webogic_home/server/bin )
    My wlst looks like this :
    bea_home=..
    weblogic_home=...
    nmhome = weblogic_home + '\\common\\nodemanager'
    domaindir = bea_home + '\\user_projects\\domains\\' + sys.argv[2]
    startNodeManager(verbose='true', NodeManagerHome=nmhome)
    #Connect to the node manager
    nmConnect(domainName='myclusterdomain',domainDir=domaindir)
    ==============================================
    I get the following errror:
    [java] Launching NodeManager ...
    [java] Properties: {NodeManagerHome=/home/hkarthig/wl11g/middleware/wlserver_10.3/common/nodemanager,}
    [java] Command: /usr/java/jdk1.6.0_07/jre/bin/java -classpath /usr/java/jdk1.6.0_07/jre/lib/rt.jar:/usr/java/jdk1.6.0_07/jre/lib/i18n.jar:/home/hkarthig/wl11g/middleware/wlserver_10.3/server/lib/weblogic.jar weblogic.NodeManager -v
    [java] NMProcess: <Aug 1, 2009 10:17:17 AM> <INFO> <Loading domains file: /home/hkarthig/wl11g/middleware/wlserver_10.3/common/nodemanager/nodemanager.domains>
    [java] NMProcess: <Aug 1, 2009 10:17:17 AM> <SEVERE> <Fatal error in node manager server>
    [java] NMProcess: weblogic.nodemanager.common.ConfigException: Native version is enabled but node manager native library could not be loaded
    [java] NMProcess: at weblogic.nodemanager.server.NMServerConfig.initProcessControl(NMServerConfig.java:243)
    [java] NMProcess: at weblogic.nodemanager.server.NMServerConfig.<init>(NMServerConfig.java:182)
    [java] NMProcess: at weblogic.nodemanager.server.NMServer.init(NMServer.java:177)
    [java] NMProcess: at weblogic.nodemanager.server.NMServer.<init>(NMServer.java:142)
    [java] NMProcess: at weblogic.nodemanager.server.NMServer.main(NMServer.java:357)
    [java] NMProcess: at weblogic.NodeManager.main(NodeManager.java:31)
    [java] NMProcess: Caused by: java.lang.UnsatisfiedLinkError: no nodemanager in java.library.path
    [java] NMProcess: at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
    [java] NMProcess: at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    [java] NMProcess: at java.lang.System.loadLibrary(System.java:1030)
    [java] NMProcess: at weblogic.nodemanager.util.UnixProcessControl.<init>(UnixProcessControl.java:24)
    [java] NMProcess: at weblogic.nodemanager.util.Platform.getProcessControl(Platform.java:114)
    [java] NMProcess: at weblogic.nodemanager.server.NMServerConfig.initProcessControl(NMServerConfig.java:241)
    [java] NMProcess: ... 5 more
    [java] NMProcess:
    [java] NMProcess: Stopped draining NMProcess
    [java] NMProcess: Stopped draining NMProcess
    [java] Successfully launched the Node Manager.

    What you should do is note the exact java.library.path setting you end up with when you run startNodeManager.sh and set that value manually in the WLST script.

  • Wlst offline - create a new domain in weblogic portal 10.2

    Hi,
    Any one have automation script to create weblogic portal domain, create portlet data base ( not point base).and Domain resources: Machines,Servers, Clusters and data sources. I tried the one which comes with installation ( wlst offlie domain creation script), but it is just configuring weblogic server but not portal.
    Thanks.
    Krishna.

    #=======================================================================================
    # WLST Common Script Library Functions (these functions support both WLS 8.1.x and 9.x)
    #=======================================================================================
    __all__ = []
    import os
    from java.io import FileInputStream
    from java.util import Properties
    from java.lang import String
    import jarray
    #=======================================================================================
    # RAVI enable library functions to see and use WLST functions
    #=======================================================================================
    def initialise(topLevelNamespace):
    for f in ("addTemplate", "closeDomain", "closeTemplate", "exit", "readDomain",
    "readTemplate", "updateDomain", "writeDomain", "cd", "assign",
    "assignAll", "create", "delete", "get", "loadDB", "set", "setOption",
    "unassign", "unassignAll", "dumpStack", "dumpVariables", "help", "ls",
    "prompt", "pwd", "startRecording", "stopRecording", ):
    globals()[f] = topLevelNamespace[f]
    __all__.append(f)
    #=======================================================================================
    # Load Properties
    #=======================================================================================
    def loadPropertiesFromFile(filename):
    props = addPropertiesFromFile(filename, {})
    return props
    #=======================================================================================
    # Load Properties
    #=======================================================================================
    def addPropertiesFromFile(filename, props):
    properties = Properties()
    input = FileInputStream(filename)
    properties.load(input)
    input.close()
    for entry in properties.entrySet(): props[entry.key.strip()] = entry.value.strip()
    return props
    #=======================================================================================
    # Get WebLogic Version (eg. returns '8.1.5.0', '9.1.0.0', '9.2.0.0')
    #=======================================================================================
    def getWebLogicVersion():
    return cd('/').getConfigurationVersion()
    #=======================================================================================
    # Get Machine Create Type (returns 'UnixMachine' or 'Machine')
    #=======================================================================================
    def getMachineCreateType():
    # On Unix, machine type is 'UnixMachine' on Windows it is 'Machine'
    if os.pathsep == ':':
    return 'UnixMachine'
    else:
    return 'Machine'
    #=======================================================================================
    # Get Machine Directory Type (returns 'UnixMachine' or 'Machine')
    #=======================================================================================
    def getMachineDirectoryType():
    # On Unix, machine type is 'UnixMachine' on Windows it is 'Machine'
    if os.pathsep == ':':
    # When moving from WLS 9.1 to WLS 9.2, WLS changed name of unix machines from
    # 'UnixMachine' to just 'Machine'
    wlsVersion = getWebLogicVersion()
    if wlsVersion.startswith('8') or wlsVersion.startswith('9.0') or wlsVersion.startswith('9.1'):
    return 'UnixMachine'
    else:
    return 'Machine'
    else:
    return 'Machine'
    #=======================================================================================
    # Set Domain Options
    #=======================================================================================
    def setDomainOptions(prodMode, javaHome):
    setOption('OverwriteDomain', 'true')
    setOption('ServerStartMode', prodMode)
    setOption('JavaHome', javaHome)
    setOption('CreateStartMenu', 'false')
    #=======================================================================================
    # Set System User
    #=======================================================================================
    def setSystemUser(domainname, username, password):
    sysUser = cd('/Security/%s/User/weblogic' % domainname)
    sysUser.setName(username)
    sysUser.setPassword(password)
    #=======================================================================================
    # Create WLS81 Oracle Database Pool
    #=======================================================================================
    def createWLS81OracleDatabasePool(dbName, dbUsername, dbPassword, dbDriver, dbUrl):
    newPool = create(dbName, 'JDBCConnectionPool')
    newPool.setDriverName(dbDriver)
    newPool.setURL(dbUrl)
    newPool.setPassword(dbPassword)
    newPool.setInitialCapacity(5)
    newPool.setTestFrequencySeconds(60)
    newPool.setTestConnectionsOnRelease(1)
    newPool.setTestConnectionsOnReserve(1)
    newPool.setConnectionReserveTimeoutSeconds(60)
    newPool.setUserName(dbUsername)
    return newPool
    #=======================================================================================
    # Create WLS81 Data Source
    #=======================================================================================
    def createWLS81DataSource(dsType, dsName, jndiName, poolName):
    ds = create(dsName, dsType)
    ds.setJNDIName(jndiName)
    ds.setPoolName(poolName)
    return ds
    #=======================================================================================
    # Configure WLS9 Oracle Database
    #=======================================================================================
    def configureWLS9OracleDatabase(dsName, jndiNames, driver, host, port, sid, username, password, targets):
    cd('/')
    dataSource = create(dsName, 'JDBCSystemResource')
    cd('/JDBCSystemResource/' + dsName + '/JdbcResource/' + dsName)
    dbParam = create('dbParams','JDBCDriverParams')
    cd('JDBCDriverParams/NO_NAME_0')
    dbParam.setDriverName(driver)
    set('URL', 'jdbc:oracle:thin:@' + host + ':' + port + ':' + sid)
    dbParam.setPasswordEncrypted(password)
    dbProps = create('props','Properties')
    cd('Properties/NO_NAME_0')
    dbUser = create('user', 'Property')
    dbUser.setValue(username)
    cd('/JDBCSystemResource/' + dsName + '/JdbcResource/' + dsName)
    create('jdbcDataSourceParams','JDBCDataSourceParams')
    cd('JDBCDataSourceParams/NO_NAME_0')
    set("JNDINames", jndiNames)
    cd('/JDBCSystemResource/' + dsName + '/JdbcResource/' + dsName)
    create('jdbcConnectionPoolParams','JDBCConnectionPoolParams')
    cd('JDBCConnectionPoolParams/NO_NAME_0')
    set('TestTableName','SQL SELECT 1 FROM DUAL')
    set('TestConnectionsOnReserve','true')
    assign('JDBCSystemResource', dsName, 'Target', targets)
    return dataSource
    #=======================================================================================
    # Configure WLS102 DB2
    #=======================================================================================
    def configureWLS102DB2(dsName, jndiNames, driver, host, port, sid, username, password, targets, trans, url, testquery):
    print 'datasource('+dsName+','+ jndiNames+','+ driver+','+ host+','+ port+','+ sid+','+ username+','+ password+','+targets+','+ trans+','+url+',' + testquery +'):'
    cd('/')
    dataSource = create(dsName, 'JDBCSystemResource')
    cd('/JDBCSystemResource/' + dsName + '/JdbcResource/' + dsName)
    dbParam = create('dbParams','JDBCDriverParams')
    cd('JDBCDriverParams/NO_NAME_0')
    dbParam.setDriverName(driver)
    #set('URL', 'jdbc:bea:db2://' + host + ':' + port)
    set('URL', url)
    dbParam.setPasswordEncrypted(password)
    #dbParam.setPassword(password)
    dbProps = create('props','Properties')
    cd('Properties/NO_NAME_0')
    dbUser = create('user', 'Property')
    dbUser.setValue(username)
    dbPortNumber = create('portNumber', 'Property')
    dbPortNumber.setValue(port)
    dbDbName = create('databaseName', 'Property')
    dbDbName.setValue(sid)
    dbHost = create('serverName', 'Property')
    dbHost.setValue(host)
    dbBatch = create('batchPerformanceWorkaround', 'Property')
    dbBatch.setValue('true')
    cd('/JDBCSystemResource/' + dsName + '/JdbcResource/' + dsName)
    create('jdbcDataSourceParams','JDBCDataSourceParams')
    cd('JDBCDataSourceParams/NO_NAME_0')
    jndiNamesAray=jndiNames.split(',')
    set('JNDINames', jndiNamesAray)
    set('GlobalTransactionsProtocol', trans)
    #cd('/JDBCSystemResources/ttttt/JDBCResource/ttttt/JDBCDataSourceParams/ttttt')
    #cd('/JDBCSystemResource/' + dsName + '/JdbcResource/' + dsName)
    #cd('JDBCDataSourceParams/NO_NAME_0')
    #dbDatasource = cmo
    #dbDatasource.setGlobalTransactionsProtocol(trans)
    cd('/JDBCSystemResource/' + dsName + '/JdbcResource/' + dsName)
    create('jdbcConnectionPoolParams','JDBCConnectionPoolParams')
    cd('JDBCConnectionPoolParams/NO_NAME_0')
    #set('TestTableName','SQL SELECT COUNT(*) FROM SYSIBM.SYSTABLES')
    set('TestTableName',testquery)
    set('TestConnectionsOnReserve','true')
    assign('JDBCSystemResource', dsName, 'Target', targets)
    cd('/JDBCSystemResources/'+dsName)
    #targetsAray=[targets]
    #set('Targets',targetsAray)
    return dataSource
    #=======================================================================================
    # Set Common Server Settings
    #=======================================================================================
    def setCommonServerSettings(server):
    server.setNativeIOEnabled(1)
    server.setWeblogicPluginEnabled(1)
    #=======================================================================================
    # Set Server Logging
    #=======================================================================================
    def setServerLogging(server, logpath, level):
    cd('/Server/' + server.getName())
    log = create(server.getName(), 'Log')
    log.setFileName(logpath + '/' + server.getName() + '.log')
    log.setRotationType('byTime')
    log.setRotationTime('02:00')
    log.setFileTimeSpan(24)
    log.setFileCount(7)
    log.setLogFileSeverity(level)
    #=======================================================================================
    # Set Web Server
    #=======================================================================================
    def setWebServer(server, logpath, frontEndHost, frontEndPort, frontEndSSLPort):
    cd('/Server/' + server.getName())
    webServer = create(server.getName(), 'WebServer')
    webServer.setFrontendHost(frontEndHost)
    webServer.setFrontendHTTPPort(frontEndPort)
    webServer.setFrontendHTTPSPort(frontEndSSLPort)
    wlsVersion = getWebLogicVersion()
    if wlsVersion.startswith('9') or wlsVersion.startswith('10'):
    cd('/Server/' + server.getName() + '/WebServer/' + server.getName())
    webServerLog = create(server.getName(),'WebServerLog')
    webServerLog.setFileName(logpath + '/' + server.getName() + '_access.log')
    webServerLog.setRotationType('byTime')
    webServerLog.setRotationTime('02:00')
    webServerLog.setFileTimeSpan(24)
    webServerLog.setFileCount(7)
    else:
    webServer.setLogFileName(logpath + '/' + server.getName() + '_access.log')
    webServer.setLogRotationType('date')
    webServer.setLogRotationTimeBegin('01-01-2006-2:00:00')
    webServer.setLogRotationPeriodMins(1440)
    webServer.setLogFileCount(7)
    #=======================================================================================
    # Create Boot Properties File
    #=======================================================================================
    def createBootPropertiesFile(directoryPath, username, password):
    file = open (directoryPath + '/boot.properties', 'w')
    file.write('username=%s\n' % username)
    file.write('password=%s\n' % password)
    file.flush()
    file.close()
    Hopefully this will work for you

  • Running wlst command in embeded mode results in error for deleteMetadata()

    I need to use wlst command deleteMetadata() in embeded mode.
    I had followed instruction at http://download.oracle.com/docs/cd/E12840_01/wls/docs103/config_scripting/using_WLST.html, to import the wlst interpreter,
    The command I use is:
    deleteMetadata(application='SetupApp', server='FunctionalSetupServer_1', docs='/META-INF/**/adf-config.xml.xml', restrictCustTo='%')
    This command works fine in wlst interactive mode, but when I put it in java, it errors out with the following. Looks like the:
    Caused by: Traceback (innermost last):
    File "<string>", line 2, in ?
    NameError: deleteMetadata
    at org.python.core.Py.NameError(Unknown Source)
    at org.python.core.PyFrame.getglobal(Unknown Source)
    at org.python.core.PyFrame.getname(Unknown Source)
    at org.python.pycode._pyx11.f$0(<string>:2)
    at org.python.pycode._pyx11.call_function(<string>)
    at org.python.core.PyTableCode.call(Unknown Source)
    at org.python.core.PyCode.call(Unknown Source)
    at org.python.core.Py.runCode(Unknown Source)
    at org.python.core.Py.exec(Unknown Source)
    at org.python.util.PythonInterpreter.exec(Unknown Source)
    at weblogic.management.scripting.utils.WLSTInterpreter.exec(WLSTInterpreter.java:509)
    at oracle.as.install.famigratet2p.cli.cmd.CleanupAdfConfigXml.connect(CleanupAdfConfigXml.java:130)
    at oracle.as.install.famigratet2p.cli.cmd.CleanupAdfConfigXml.executeCmd(CleanupAdfConfigXml.java:77)
    at oracle.apps.fnd.provisioning.ovm.sdk.cli.FAOVMCLICmd.execute(FAOVMCLICmd.java:709)
    ... 2 more
    My code looks like this:
    import weblogic.management.scripting.utils.WLSTInterpreter;
    import org.python.util.InteractiveInterpreter;
    String conString = "connect('" + mTestAdminServerUserName + "','" +
    mTestAdminServerPassword + "','" + mTestAdminServerConnectString + "')\n";
    String delString="deleteMetadata(application='SetupApp',server='FunctionalSetupServer_1', docs='/META-INF/**/adf-config.xml.xml', restrictCustTo='%')\n";
    interpreter.exec(conString+delString);
    Connect() works fine, only failing at deleteMetadata. Is there another jar/library that I need to include?

    Try excuting the command below before invoking MDS commands:
    interpreter.execfile($MW_HOME/oracle_common/common/wlst/mdsWLSTCommands.py);
    Thanks,
    --Daniel                                                                                                                                                                                                                                                                                                                                   

  • WLST script to activate/decativate MDB in side an EAR file

    Hi
    we have an ear file deployed to a cluster and that ear file has got MDB s inside it.
    I need to disable and enable this MD while the EAR file is in active state.
    I am able to perform the task via console but I need to script it.
    the WLST recording of the actions shows nothing.
    and I am not able to browse through the deployment in the wlst interactive commands.
    any help?

    Hi,
    If you want to dynamicall make any Modifications in your Deployment Descriptors like "application.xml"..."weblogic.xml"...etc then you can use *"Plan.xml"* feature provided bu WebLogic....
    Example : http://jaysensharma.wordpress.com/2009/11/29/shared-library-with-plan-xml/
    Example : http://jaysensharma.wordpress.com/2009/12/16/updating-cookiename-using-plan-xml/
    Thanks
    Jay SenSharma

  • Can't figure out why I can't undeploy an application using WLST

    Hi,
    I have WebLogic 9.2.2 installed locally on my WinXP machine. I am running a WLST script (through Ant 1.6) to attempt to undeploy my application. This line
    undeploy("RoutingEngine (v1.0)")
    is causing this error,
    [wlst] Undeploying application RoutingEngine (v1.0) ...
    [wlst] <Mar 4, 2009 1:04:40 PM MST> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating undeploy operation for application, RoutingEngine (v1.0) [archive: null], to AdminServer .>
    [wlst] Failed to undeploy the application with status failed
    [wlst] Current Status of your Deployment:
    [wlst] Deployment command type: undeploy
    [wlst] Deployment State : failed
    [wlst] Deployment Message : weblogic.management.ManagementException: [Deployer:149001]No application named 'RoutingEngine (v1.0)' exists for operation undeploy
    If I log in to my WebLogic admin console under "Deployments", there is an application named "RoutingEngine (v1.0)" listed. Should I be naming this something else or referencing it under another name?
    Thanks, - Dave

    Hi, something similar has happened in an oracle weblogic 10.3.5, when i tried to delete an application deployed as library, the adminserver responded with error “[Deployer:149001]No application named ‘my-web-9(9.2.1)’ exists for operation undeploy”.
    I solved this problem, using weblogic.Deployer but specifying the appversion like this:
    java weblogic.Deployer -verbose -noexit -name my-web-9 -appversion 9.2.1 -adminurl t3://192.168.40.66:7000 -user weblogic -undeploy

  • Import meta data wlst command from Java

    Hi All,
    Can any one please provide me a java code for importing meta data file using WLST commands.

    HI Joe,
    As a professional news and sports photographer I cannot use Aperture for this problem alone. I live and die by my captions and if a photo isn't captioned, or incorrectly captioned, it might as well not exist at all. Fixing the IPTC import problem is No 1 priority for me.
    As it is at the moment only half of the caption (description) comes in and some fields are missing entirely. This is only with RAW files, JPEG files import perfectly.
    Whilst we wait for this issue to be resolved (and PLEASE can it be soon!) is there anyway of working with the IPTC from the JPEG?
    If I shoot RAW and JPEG together can Aperture show both the RAW and the JPEG side by side so that I can lift from JPEG and stamp the RAW with the IPTC data? Even better, can something be written into Aperture where I can select all the RAW & JPEG images and just select a command saying 'copy IPTC data from RAW to JPEG'? This would be a very helpful temporary workaround.
    Finally, and I've put this in the feedback, can we have a much bigger window for IPTC data entry? Personally I would like a pop-up window similar to PhotoMechanic, and I'd like to be able to save my caption so that the next time I import images I can just selected the saved caption instead of going through all the fields setting it up again.
    For Aperture to be used as a DAM for my huge library I need the IPTC to be fully featured.
    Power Mac G5 Duel 2Ghz, 30" Cinema Display Mac OS X (10.4.7) MacBook
    Power Mac G5 Duel 2Ghz, 30" Cinema Display   Mac OS X (10.4.7)   MacBook

  • WLST crashed on getting non-existing attribute in runtime()

    After downloading the latest WLST package (April 14th, 2005) from the dev2dev site, I'm experiencing WLST crashs after attempting to get an attribute on a non-existing object instead of seeing a normal syntax error message.
    Before updating my jython.jar and wlst.jar for dev2dev:
    wls:/dizzyworld/runtime/ServerRuntime/dizzy1/ApplicationRuntimes/dizzy1_mbeanlis
    ter/ComponentRuntimes/dizzy1_dizzy1_mbeanlister_mbeanlister> get('SessionsOpenTo
    talCount')
    Traceback (innermost last):
    File "<input>", line 1, in ?
    File "<iostream>", line 191, in get
    WLSTException: 'Error occured while performing get : AttributeNotFound Exception
    while doing a getAttribute for attribute SessionsOpenTotalCount. Use dumpStack(
    ) to view the error stack trace'
    After:
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x8072644
    Function=[Unknown.]
    Library=D:\bea\jdk142_05\jre\bin\client\jvm.dll
    NOTE: We are unable to locate the function name symbol for the error
    just occurred. Please refer to release documentation for possible
    reason and solutions.
    Current Java thread:
         at java.lang.Throwable.getStackTraceDepth(Native Method)
         at java.lang.Throwable.getOurStackTrace(Throwable.java:588)
         - locked <0x10462cf0> (a java.lang.Throwable)
         at java.lang.Throwable.getStackTrace(Throwable.java:582)
         at weblogic.utils.StackTraceUtils.getThrowableWithCause(StackTraceUtils.java:180)
         at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
         at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:137)
         at weblogic.management.internal.RemoteMBeanServerImpl_814_WLStub.getAttribute(Unknown Source)
         at weblogic.management.scripting.BrowseHandler.handleRuntime(BrowseHandler.java:1596)
         at weblogic.management.scripting.BrowseHandler.regularPush(BrowseHandler.java:981)
         at weblogic.management.scripting.BrowseHandler.splitPush(BrowseHandler.java:139)
         at weblogic.management.scripting.BrowseHandler.cd(BrowseHandler.java:1693)
         at weblogic.management.scripting.BrowseHandler.cd(BrowseHandler.java:1683)
         at weblogic.management.scripting.BrowseHandler.resetCD(BrowseHandler.java:1664)
         at weblogic.management.scripting.BrowseHandler.splitPush(BrowseHandler.java:141)
         at weblogic.management.scripting.BrowseHandler.cd(BrowseHandler.java:1693)
         at weblogic.management.scripting.BrowseHandler.cd(BrowseHandler.java:1683)
         at weblogic.management.scripting.BrowseHandler.resetCD(BrowseHandler.java:1664)
         at weblogic.management.scripting.BrowseHandler.splitPush(BrowseHandler.java:141)
         at weblogic.management.scripting.BrowseHandler.cd(BrowseHandler.java:1693)
         at weblogic.management.scripting.BrowseHandler.cd(BrowseHandler.java:1683)
         at weblogic.management.scripting.EditHandler.get(EditHandler.java:66)
         at weblogic.management.scripting.EditHandler.get(EditHandler.java:57)
         at weblogic.management.scripting.EditHandler.get(EditHandler.java:57)
         at weblogic.management.scripting.EditHandler.get(EditHandler.java:57)
         at weblogic.management.scripting.EditHandler.get(EditHandler.java:57)
    Dynamic libraries:
    0x00400000 - 0x0040B000      D:\bea\jdk142_05\bin\java.exe
    0x77F80000 - 0x77FFD000      C:\WINNT\system32\ntdll.dll
    0x7C2D0000 - 0x7C332000      C:\WINNT\system32\ADVAPI32.dll
    0x7C570000 - 0x7C623000      C:\WINNT\system32\KERNEL32.DLL
    0x77D30000 - 0x77DA1000      C:\WINNT\system32\RPCRT4.DLL
    0x78000000 - 0x78045000      C:\WINNT\system32\MSVCRT.dll
    0x08000000 - 0x08139000      D:\bea\jdk142_05\jre\bin\client\jvm.dll
    0x77E10000 - 0x77E6F000      C:\WINNT\system32\USER32.dll
    0x77F40000 - 0x77F7B000      C:\WINNT\system32\GDI32.dll
    0x77570000 - 0x775A0000      C:\WINNT\system32\WINMM.dll
    0x6BD00000 - 0x6BD0D000      C:\WINNT\system32\SYNCOR11.DLL
    0x10000000 - 0x10007000      D:\bea\jdk142_05\jre\bin\hpi.dll
    0x007C0000 - 0x007CE000      D:\bea\jdk142_05\jre\bin\verify.dll
    0x007D0000 - 0x007E9000      D:\bea\jdk142_05\jre\bin\java.dll
    0x007F0000 - 0x007FD000      D:\bea\jdk142_05\jre\bin\zip.dll
    0x18BE0000 - 0x18BEF000      D:\bea\jdk142_05\jre\bin\net.dll
    0x75030000 - 0x75044000      C:\WINNT\system32\WS2_32.dll
    0x75020000 - 0x75028000      C:\WINNT\system32\WS2HELP.DLL
    0x782C0000 - 0x782CC000      C:\WINNT\System32\rnr20.dll
    0x77980000 - 0x779A4000      C:\WINNT\system32\DNSAPI.DLL
    0x75050000 - 0x75058000      C:\WINNT\system32\WSOCK32.DLL
    0x77340000 - 0x77353000      C:\WINNT\system32\iphlpapi.dll
    0x77520000 - 0x77525000      C:\WINNT\system32\ICMP.DLL
    0x77320000 - 0x77337000      C:\WINNT\system32\MPRAPI.DLL
    0x75150000 - 0x7515F000      C:\WINNT\system32\SAMLIB.DLL
    0x75170000 - 0x751BF000      C:\WINNT\system32\NETAPI32.DLL
    0x7C340000 - 0x7C34F000      C:\WINNT\system32\Secur32.dll
    0x77BF0000 - 0x77C01000      C:\WINNT\system32\NTDSAPI.dll
    0x77950000 - 0x7797A000      C:\WINNT\system32\WLDAP32.DLL
    0x751C0000 - 0x751C6000      C:\WINNT\system32\NETRAP.dll
    0x77A50000 - 0x77B3F000      C:\WINNT\system32\OLE32.DLL
    0x779B0000 - 0x77A4B000      C:\WINNT\system32\OLEAUT32.DLL
    0x773B0000 - 0x773DF000      C:\WINNT\system32\ACTIVEDS.DLL
    0x77380000 - 0x773A3000      C:\WINNT\system32\ADSLDPC.DLL
    0x77830000 - 0x7783E000      C:\WINNT\system32\RTUTILS.DLL
    0x77880000 - 0x7790E000      C:\WINNT\system32\SETUPAPI.DLL
    0x7C0F0000 - 0x7C151000      C:\WINNT\system32\USERENV.DLL
    0x774E0000 - 0x77513000      C:\WINNT\system32\RASAPI32.DLL
    0x774C0000 - 0x774D1000      C:\WINNT\system32\RASMAN.DLL
    0x77530000 - 0x77552000      C:\WINNT\system32\TAPI32.DLL
    0x71710000 - 0x71794000      C:\WINNT\system32\COMCTL32.DLL
    0x70A70000 - 0x70AD6000      C:\WINNT\system32\SHLWAPI.DLL
    0x77360000 - 0x77379000      C:\WINNT\system32\DHCPCSVC.DLL
    0x777E0000 - 0x777E8000      C:\WINNT\System32\winrnr.dll
    0x777F0000 - 0x777F5000      C:\WINNT\system32\rasadhlp.dll
    0x19070000 - 0x19075000      D:\bea\weblogic81\server\bin\stackdump.dll
    0x74FD0000 - 0x74FEE000      C:\WINNT\system32\msafd.dll
    0x75010000 - 0x75017000      C:\WINNT\System32\wshtcpip.dll
    0x77920000 - 0x77943000      C:\WINNT\system32\imagehlp.dll
    0x72A00000 - 0x72A2D000      C:\WINNT\system32\DBGHELP.dll
    0x690A0000 - 0x690AB000      C:\WINNT\system32\PSAPI.DLL
    Heap at VM Abort:
    Heap
    def new generation total 4544K, used 4428K [0x10010000, 0x104f0000, 0x104f0000)
    eden space 4096K, 100% used [0x10010000, 0x10410000, 0x10410000)
    from space 448K, 74% used [0x10410000, 0x10463190, 0x10480000)
    to space 448K, 0% used [0x10480000, 0x10480000, 0x104f0000)
    tenured generation total 60544K, used 60543K [0x104f0000, 0x14010000, 0x14010000)
    the space 60544K, 99% used [0x104f0000, 0x1400ffc0, 0x14010000, 0x14010000)
    compacting perm gen total 8960K, used 8801K [0x14010000, 0x148d0000, 0x18010000)
    the space 8960K, 98% used [0x14010000, 0x148a8630, 0x148a8800, 0x148d0000)
    Local Time = Tue Aug 09 11:22:51 2005
    Elapsed Time = 133
    # HotSpot Virtual Machine Error : EXCEPTION_ACCESS_VIOLATION
    # Error ID : 4F530E43505002EF
    # Please report this error at
    # http://java.sun.com/cgi-bin/bugreport.cgi
    # Java VM: Java HotSpot(TM) Client VM (1.4.2_05-b04 mixed mode)
    Regards,
    Zachary Slaybaugh
    Sr. Application Administrator
    Time Warner Cable, Inc.

    This has been fixed in the latest version of wlst. You can get it from
    https://codesamples.projects.dev2dev.bea.com/servlets/Scarab/id/S13
    Thanks,
    -satya

  • Some WLST Goodies

    In this post we will use WLST to create a WebLogic domain (cluster, web server, resources, security and deployment). WLST is a scripting language, which can be used to create, monitor and manage domains. WLST is based on Jython and provides next to the default Jython functionality, functions which are WebLogic Server specific. WLST can be used in two ways: online and offline. The offline mode has no connection with the admin server, the online mode has. The offline mode can be used for creating domains. To configure the created domain we must connect to the admin server. WLST online is a Java Management Extensions (JMX) client, which communicates with the server's managed beans collections. A managed bean is a Java object that provides an interface for a particular resource. An overview of the available managed beans can be found here.
    Before we start walking through the individual configuration steps, we define a few helpful parameters
    beahome = '/home/oracle/bea';
    linux = true;
    adminusername = 'username';
    adminpassword = 'password';
    servername = 'AdminServer';
    domainname = 'ScriptDomain';
    pathseparator = '/';
    if not linux:
         pathseparator = '\\';
    # set paths
    domaintemplate = beahome + pathseparator + 'wlserver_10.3' + pathseparator + 'common' + pathseparator + 'templates' + pathseparator + 'domains' + pathseparator + 'wls.jar';
    domainlocation = beahome + pathseparator + 'user_projects' + pathseparator + 'domains' + pathseparator + domainname;
    nodemanagerhomelocation = beahome + pathseparator + 'wlserver_10.3' + pathseparator + 'common' + pathseparator + 'nodemanager';
    jvmlocation = beahome + pathseparator + 'jrockit_160_05_R27.6.2-20';
    jsfrilibrary = beahome + pathseparator + 'wlserver_10.3' + pathseparator + 'common' + pathseparator + 'deployable-libraries' + pathseparator + 'jsf-ri-1.1.1.war';
    trinidadlibrary = beahome + pathseparator + 'wlserver_10.3' + pathseparator + 'common' + pathseparator + 'deployable-libraries' + pathseparator + 'trinidad.war';
    coherencelibrary = beahome + pathseparator + 'wlserver_10.3' + pathseparator + 'coherence' + pathseparator + 'coherence-web-spi.war';
    videotheekproxypath = beahome + pathseparator + 'deploy' + pathseparator + 'videotheekproxy' + pathseparator + 'VideotheekProxy.war';
    videotheekproxyplanpath = beahome + pathseparator + 'deploy' + pathseparator + 'videotheekproxy' + pathseparator + 'Plan.xml';
    videotheekpath = beahome + pathseparator + 'deploy' + pathseparator + 'videotheek' + pathseparator + 'Videotheek.ear';
    videotheekplanpath = beahome + pathseparator + 'deploy' + pathseparator + 'videotheek' + pathseparator + 'Plan.xml';
    Create a domain
    By using a domain template, we can create a new domain. Some default templates are available in the directory: <middleware-home>/wlserver_10.3/common/templates/domains. In the example, we use the template wls.jar
    createDomain(domaintemplate, domainlocation, adminusername, adminpassword);
    WLST online
    Before we are able to create resources, we must first connect to the admin server
    print 'START NODE MANAGER';
    startNodeManager(verbose='true', NodeManagerHome=nodemanagerhomelocation, ListenPort='5556', ListenAddress='localhost');
    print 'CONNECT TO NODE MANAGER';
    nmConnect(adminusername, adminpassword, 'localhost', '5556', domainname, domainlocation, 'ssl');
    print 'START ADMIN SERVER';
    nmStart(servername);
    print 'CONNECT TO ADMIN SERVER';
    connect(adminusername, adminpassword);
    Edit mode
    Changes are made in the WLST edit mode
    print 'START EDIT MODE';
    edit();
    startEdit();
    Create server environment
    First, we create a machine
    print 'CREATE MACHINE: VIDEOTHEEKMACHINE';
    videotheekMachine = cmo.createUnixMachine('VideotheekMachine');
    videotheekMachine.setPostBindUIDEnabled(true);
    videotheekMachine.setPostBindUID('oracle');
    videotheekMachine.setPostBindGIDEnabled(true);
    videotheekMachine.setPostBindGID('oracle');
    videotheekMachine.getNodeManager().setNMType('ssl');The variable cmo contains the current management object. (The methode ls() provides the functionality to print a tree containing all child objects of the current management object. By using cd('naamManagementBean') we can change the current management object.) Note that, in the example above a machine object of type MachineMBean is created. This management bean has related management beans such a NodeManager of type NodeManagerMBean. Using the method getNodeManager() we obtain an instance of this bean. By using accessors such as setNMType(), we can change the node manager type.
    In a same manner, we create a cluster
    print 'CREATE CLUSTER: VIDEOTHEEKCLUSTER';
    videotheekCluster = cmo.createCluster('VideotheekCluster');
    videotheekCluster.setClusterMessagingMode('unicast');
    videotheekCluster.setWeblogicPluginEnabled(true);In the next step, we create a managed server and add this to the machine and cluster
    print 'CREATE MANAGED SERVER: VIDEOTHEEKSERVER1';
    videotheekServer1 = cmo.createServer('VideotheekServer1');
    videotheekServer1.setListenPort(7002);
    videotheekServer1.setAutoRestart(true);
    videotheekServer1.setAutoKillIfFailed(true);
    videotheekServer1.setRestartMax(2);
    videotheekServer1.setRestartDelaySeconds(10);
    videotheekServer1.getServerStart().setJavaHome(jvmlocation);
    videotheekServer1.getServerStart().setJavaVendor('Oracle');
    videotheekServer1.getServerStart().setArguments('-Xms128m -Xmx256m -Xns64m -Xgcprio:pausetime');
    print 'ADD MANAGED SERVERS TO CLUSTER';
    videotheekServer1.setCluster(videotheekCluster);
    print 'ADD MANAGED SERVERS TO MACHINE';
    videotheekServer1.setMachine(videotheekMachine);Creating the web server is identical, except that we do not add this server to the cluster
    print 'CREATE MANAGED SERVER: VIDEOTHEEKWEBSERVER';
    videotheekWebServer = cmo.createServer('VideotheekServer2');
    videotheekWebServer.setListenPort(7004);
    videotheekWebServer.setAutoRestart(true);
    videotheekWebServer.setAutoKillIfFailed(true);
    videotheekWebServer.setRestartMax(2);
    videotheekWebServer.setRestartDelaySeconds(10);
    videotheekWebServer.getServerStart().setJavaHome(jvmlocation);
    videotheekWebServer.getServerStart().setJavaVendor('Oracle');
    videotheekWebServer.getServerStart().setArguments('-Xms128m -Xmx128m -Xns32m -Xgcprio:throughput');
    print 'ADD MANAGED SERVER TO MACHINE';
    videotheekWebServer.setMachine(videotheekMachine);
    Save and activate changes
    Changes can be save and activated as follows
    save();
    activate(block='true');
    Create a Java messaging environment
    First, we create a file store to save messages
    videotheekFileStore = cmo.createFileStore('VideotheekFileStore');
    targets = videotheekFileStore.getTargets();
    targets.append(videotheekServer1);
    videotheekFileStore.setTargets(targets);The methode getTargets() returns a management bean of type TargetMBean. This management bean represents a targets list. All management beans that represent resources implement this TargetMBean. Targets can only be servers or clusters. The targets list is a Jython array and thus can be manipulated as such. The methode append() adds a target to the list, in this case: VideotheekServer1.
    Next, we create a JMS Server and map this to the filestore
    videotheekJMSServer = cmo.createJMSServer('VideotheekJMSServer');
    videotheekJMSServer.setPersistentStore(videotheekFileStore);
    videotheekJMSServer.setTargets(targets);Note that we target the JMS Server to the same target as the filestore. A JMS module can be created as follows
    videotheekModule = cmo.createJMSSystemResource('VideotheekModule');
    targets.remove(videotheekServer1);
    targets.append(videotheekCluster);
    videotheekModule.setTargets(targets);The JMS Module is targeted to the cluster (note that we first remove the managed server from the target list). Using a sub deployment all the resources in the JMS module are deployed to the JMS Server
    videotheekModule.createSubDeployment('VideotheekSubDeployment');
    videotheekSubDeployment = videotheekModule.lookupSubDeployment('VideotheekSubDeployment');
    targets.remove(videotheekCluster);
    targets.append(videotheekJMSServer);
    videotheekSubDeployment.setTargets(targets);JMS Resources, such as Connection Factories and Queues can be created as follows
    jmsResource = videotheekModule.getJMSResource();
    jmsResource.createConnectionFactory('VideotheekConnectionFactory');
    videotheekConnectionFactory = jmsResource.lookupConnectionFactory('VideotheekConnectionFactory');
    videotheekConnectionFactory.setJNDIName('jms/ConnectionFactory');
    videotheekConnectionFactory.setSubDeploymentName('VideotheekSubDeployment');
    jmsResource.createQueue('VideotheekQueue');
    videotheekQueue = jmsResource.lookupQueue('VideotheekQueue');
    videotheekQueue.setJNDIName('jms/VideotheekQueue');
    videotheekQueue.setSubDeploymentName('VideotheekSubDeployment');
    videotheekQueue.getDeliveryParamsOverrides().setRedeliveryDelay(100);
    videotheekQueue.getDeliveryFailureParams().setRedeliveryLimit(5);
    videotheekQueue.getDeliveryFailureParams().setExpirationPolicy('Log');
    videotheekQueue.getDeliveryFailureParams().setExpirationLoggingPolicy('%headers%);
    videotheekQueue.getMessageLoggingParams().setMessageLoggingEnabled(true);
    videotheekQueue.getMessageLoggingParams().setMessageLoggingFormat('%headers%');In the example above, the management bean JMSResource is resolved. The factory method createConnectionFactory() is used to create a connection factory. Note that this mehtod does not return an instance of connection factory. Using the method lookupConnectionFactory() we cobtain the desired instance. Next, we modify some connection factory parameters. The creation of a queue goes along the same lines.
    Create a Connection Pool
    First, we create a data source
    videotheekDataSource = cmo.createJDBCSystemResource('VideotheekDataSource');
    targets.remove(videotheekJMSServer);
    targets.append(videotheekCluster);
    videotheekDataSource.setTargets(targets);
    jdbcResource = videotheekDataSource.getJDBCResource();
    jdbcResource.setName('VideotheekDataSource');
    names = ['jdbc/exampleDS'];
    dataSourceParams = jdbcResource.getJDBCDataSourceParams();
    dataSourceParams.setJNDINames(names);
    dataSourceParams.setGlobalTransactionsProtocol('none');Next, we modify some driver parameters, linked to this data source
    driverParams = jdbcResource.getJDBCDriverParams();
    driverParams.setUrl('jdbc:oracle:thin:@hostname:1521:sid');
    driverParams.setDriverName('oracle.jdbc.OracleDriver');
    driverParams.setPassword('password');
    driverProperties = driverParams.getProperties();
    driverProperties.createProperty('user');
    userProperty = driverProperties.lookupProperty('user');
    userProperty.setValue('username');The property user is specific for the used driver. This property can be added by using the JDBCPropertiesBean. Finally, we modify some connection pool parameters
    connectionPoolParams = jdbcResource.getJDBCConnectionPoolParams();
    connectionPoolParams.setTestTableName('SQL SELECT 1 FROM DUAL');
    connectionPoolParams.setConnectionCreationRetryFrequencySeconds(100);
    Create Mail Session
    The final resource we create is a mail session
    videotheekMailSession = cmo.createMailSession('VideotheekMailSession');
    videotheekMailSession.setTargets(targets);
    videotheekMailSession.setJNDIName('mail/VideotheekMailSession');
    import java.util.Properties;
    properties = java.util.Properties();
    properties.put('mail.smtp.password','password');
    properties.put('mail.smtp.port','25');
    properties.put('mail.transport.protocol','smtp');
    properties.put('mail.smtp.host','mail.some-company.com');
    properties.put('mail.smtp.user','username');
    properties.put('mail.to','[email protected]');
    properties.put('mail.from','[email protected]');
    videotheekMailSession.setProperties(properties);To add properties, we use the module java.util.Properties. A properties variable is instantiated using java.util.Properties(). As a final step this properties variable is added to the management bean instance.
    Security
    Creating a security realm
    securityConfiguration = cmo.getSecurityConfiguration();
    securityConfiguration.createRealm('VideotheekRealm');
    realm = securityConfiguration.lookupRealm('VideotheekRealm');
    realm.createAuthenticationProvider('weblogic.security.providers.authentication.DefaultAuthenticator');
    authenticator = realm.lookupAuthenticationProvider('DefaultAuthenticator');
    authenticator.setControlFlag('optional');
    realm.createAuthorizer('weblogic.security.providers.authorization.DefaultAuthorizer');
    realm.createAdjudicator('weblogic.security.providers.authorization.DefaultAdjudicator');
    realm.createRoleMapper('weblogic.security.providers.authorization.DefaultRoleMapper');
    realm.createCredentialMapper('weblogic.security.providers.credentials.DefaultCredentialMapper');
    realm.createCertPathProvider('weblogic.security.providers.pk.WebLogicCertPathProvider');By using WLST it is not possible to set the created certpath provider as the current builder. It is also not possible to set a created security realm as the default realm. To do this we must resort to the admin console.
    Adding users and groups to the default realm
    print 'START SERVER CONFIG';
    serverConfig();
    print 'ADD USERS AND GROUPS TO DEFAULT SECURITY REALM';
    securityRealm = cmo.getSecurityConfiguration().getDefaultRealm();
    authProvider = securityRealm.lookupAuthenticationProvider('DefaultAuthenticator');
    authProvider.createUser('anemployee', 'welcome1', 'an employee of the videotheek');
    authProvider.createUser('amanager', 'welcome1', 'a manager of the videotheek');
    authProvider.createGroup('employees', 'employee group of the videotheek');
    authProvider.createGroup('managers', 'manager group of the videotheek');
    authProvider.addMemberToGroup('employees', 'anemployee');
    authProvider.addMemberToGroup('managers', 'amanager');Changes concerning security must be performed in the serverConfig environment. Now we are able to obtain an instance of the default realm. Using this instance, the authentication provider can be looked up, to which users and groups are added. It is also possible to add groups or users to defined roles, for example,
    sr = cmo.getSecurityConfiguration().getDefaultRealm();
    rm = sr.lookupRoleMapper('XACMLRoleMapper');
    expr = rm.getRoleExpression(None,'Admin');
    rm.setRoleExpression(None,'Admin',expr+'|Usr(employee)');
    rm.setRoleExpression(None,'Anonymous','Usr(employee)|Grp(everyone)');
    rm.setRoleExpression(None,'Anonymous','Usr(employee)&Grp(everyone)');
    Deployment
    First, we start the managed servers
    print 'START MANAGED SERVERS';
    start('VideotheekWebServer','Server');
    start('VideotheekCluster','Cluster');Next, we deploy the libraries and the applications
    print 'DEPLOY LIBRARIES';
    deploy('jsf-ri', path=jsfrilibrary, targets='VideotheekCluster', libraryModule='true');
    deploy('trinidad', path=trinidadlibrary, targets='VideotheekCluster', libraryModule='true');
    deploy('coherence-web-spi', path=coherencelibrary, targets='VideotheekCluster', libraryModule='true');
    print 'START EDIT MODE';
    edit();
    startEdit();
    print 'CHANGE DEPLOYMENT ORDER OF DEPLOYED LIBRARIES';
    libraries = cmo.getLibraries();
    for library in libraries:
        library.setDeploymentOrder(1);
    print 'SAVE AND ACTIVATE CHANGES';
    save();
    activate(block='true');The attribute libaryModule indicates, we are dealing with a library deployment. To deploy some applications we can use
    print 'DEPLOY PROXY SERVLET TO MANAGED WEB SERVER';
    deploy('VideotheekProxy', path=videotheekproxypath, targets='VideotheekWebServer', planPath=videotheekproxyplanpath, securityModel='Advanced');
    print 'DEPLOY APPLICATION VIDEOTHEEK TO CLUSTER';
    deploy('Videotheek', path=videotheekpath, targets='VideotheekCluster', planPath=videotheekplanpath, securityModel='Advanced');The attribuut planPath points to the location of the deployment plans, which were created before hand.
    Running a WLST script
    Open a command shell and set the WebLogic environment by running the command: source ./setWLSEnv.sh (or the short version: . ./setWLSEnv.sh). The script setWLSEnv.sh is located in the directory <middleware-home>/wlserver_10.3/server/bin. To run a WLST script we can something like: java weblogic.WLST bea/path_to_script/ScriptName.py

    Shameless plug.
    And if you really want to feel good about ordering, please order Lightroom via the LightroomExtra.com home page and you will help me pay for all the bandwidth.
    Sid
    The LightroomExtra home page is right here.

  • Weblogic 10, WLST and Admin Console Classpath Exceptions

    I've been deploying an application to Weblogic 10 (not 10.3 from Oracle, the last version under the BEA logo) for a few weeks now without a problem. We're going to upgrade to 10.3 from Oracle in our development environment and play around with that hopefully today but I can't imagine a dot-version being much different so I figured I'd post the issue anyway.
    Recently, we've been having some issues with the WLST script we use to deploy/redeploy the application. It seems to have just started happening randomly which is odd because the script has not been modified since the get-go. What's happening is the application is compiled, staged and then the WLST script kicks off, log into the application server, looks to see if the app is already deployed, if it is, it redploys it with the latest code and then starts it up and then exits. Every now and again, the next time we go to deploy the application, the WLST fails saying that someone currently has a lock on the admin console. When we log in to the admin console, we see that the user the WLST script uses to log into the admin console currently has a lock on the console and we have the option to take the lock from this user.
    When we click the button to take the lock, we get a HUGE exception in the lefthand panel where the Lock & Edit button typically is that says something along the lines of:
    Error opening ...
    The source of this error is javax.servlet.ServletException: javax.xml.transform.TransformerFactoryConfigurationError: Provider net.sf.saxon.TransformerFactoryImpl not found at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:324) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175) at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:528) at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:454) at org.apache.beehive.netui.pageflow.scoping.internal.ScopedRequestDispatcher.include(ScopedRequestDispatcher.java:119) at com.bea.netuix.servlets.controls.content.JspContent.beginRender(JspContent.java:551) at ...
    If I click on the 'Home' button along the upper righthand corner to go back to the home page of the admin console, the error goes away, the 'Activate Changes' button reappears, and then I click that and the Lock & Edit button reappears, then if I go back to my WLST script and run it, it runs successfully. If I log back into the admin console, everything appears normally. This happens intermittently and I'm not sure why it's happening some times and not others. If my WLST script is incorrect I would assume it would behave this way EVERY time.
    I also don't get why the xml transformer factory SOMETIMES throws the exception and sometimes it doesn't. It also happens when I try to click on a JDBC data source. Same exact exception is thrown on the default configuration tab, if I click on any of the other tabs available after clicking on my JDBC data source, those all appear fine, just the initial default Configuration > General tab shows this huge exception. If I stop and restart the application server, these exceptions magically go away...the odd thing is this exception being thrown seems to be referencing libraries made available by my deployed application (the whole net.sf.saxon.TransformerFactoryImpl class is in a library we deploy with our application). These jar files containing these libraries should ONLY be available to the deployed application, I'm not putting these files on the classpath of the application server, so why the application server's admin console have any knowledge of these libraries? Could these be mucking with the overall functionality of the admin server's behavior?
    Here is my WLST script I use the deploy the application. If you see something wrong with it, any feedback would be greatly appreciated. Any thoughts on the whole classpath of my application being used by the Weblogic Admin console would be helpful too.
    WLST Script:
    connect("merlin", "merlin595")
    # check to see if the apb data source exists and if so, make sure it's targeting the AdminServer
    try:
         # Either deploy or redeploy application
         try:
              print 'Checking for the existence of the APB application.'
              cd('/AppDeployments/apbEar')
              print 'The APB application will be redeployed.'
              progress=redeploy('apbEar')
              print 'Status of redeployment: ' + progress.getState()
         except WLSTException:
              print 'The APB application has not yet been deployed to this server, so application will be deployed for the first time now.'
              progress=deploy(appName='apbEar', path='/opt/weblogic/merlinpb/merlinpbEar/apbEar', targets='AdminServer')
              print 'Status of initial deployment: ' + progress.getState()
         # Start application
         try:
              print 'Starting APB application'
              startApplication(appName='apbEar')
         except WLSTException:
              pass
         disconnect()
         print 'End of script, exiting WLST...'
         exit()
    except WLSTException:
         print 'Could not deploy apb. Please log into the admin console and attempt the deployment manually.'
    Oh, one final thing I've noticed when I use this script. The last thing the script says WHEN it actually runs successfully is:
    <Nov 13, 2008 10:57:13 AM EST> <Warning> <JNDI> <BEA-050001> <WLContext.close() was called in a different thread than the one in which it was created.>
    Why does it say that? What does that mean? Is my script mot structure correctly above?
    Any help is greatly appreciated. Thanks again!
    Rob

    Hey Mike,
    The problem I was experiencing was that we had code that was applying an XSL stylesheet against XML we are getting from the database. In order for this stylesheet to work, we had to set code that does the following:
    System.setProperty("javax.xml.transform.TransformerFactory", "net.sf.saxon.TransformerFactoryImpl");
    Now the first time this code was called, and someone subsequently went to the Weblogic admin console, the screens would be completely unreachable...we were experiencing loads of compilation errors. So I did some digging and tried various other ways to set the TransformerFactory class that wouldn't affect the system as a whole. I found, by sheer luck, the fact that you can set this parameter in the weblogic-application.xml file located in the META-INF directory of your root EAR folder. The very first element in the XML of my weblogic-application.xml file is now:
    <wls:xml>
         <wls:parser-factory>
              <wls:transformer-factory>net.sf.saxon.TransformerFactoryImpl</wls:transformer-factory>
         </wls:parser-factory>
    </wls:xml>
    I now deploy the application with this and my reports are transformed properly and the admin console and command-line WLST scripts are all working uninterrupted as well without any adverse side-effects. Hope that helps. Just an aside, in preparation for the upgrade to WLS10, I restructured our application to a split development directory structure...this structure in combination with Workshop 10 really has made development and deployment much easier.
    Best of luck. Cheers!
    Rob

  • WLST Libraries

    I have a number of WLST scripts which all use a number of common functions I've written such as:
    common.py:
    import sys
    import os
    import shutil
    import re
    def offline_createManagedServer(Name, Port, ListenAddress):
         cd('/')
         create(Name, 'Server')
         cd('Server/'+Name)
         set('ListenPort', int(Port))
         set('ListenAddress', ListenAddress)     
    This is called by createDomain.py
         readTemplate('D:\\common\\bin\\osb1031' + '/wlserver_10.3/common/templates/domains/wls.jar')
         common.offline_createManagedServer('ManagedServer1', '7001', 'localhost')
    I have been attempting to use the instructions at:
    http://download.oracle.com/docs/cd/E12840_01/wls/docs103/config_scripting/using_WLST.html#wp1093407
    Using the above code I get 'NameError: cd' at the first line in offline_createManagedServer -->     cd('/')
    I then created the wl.py and import that and now get a different error:
    Error: No domain or domain template has been read.
    Error: set() cannot be applied at this point of path
    I want to keep all the common functions in a library style script file so they can be shared.
    Has anyone actually got this to work?
    Edit:
    I call the createDomain.py as follows:
    set WL_HOME=D:\common\bin\osb1031\wlserver_10.3
    call %WL_HOME%\server\bin\setWLSEnv.cmd
    java weblogic.WLST createDomain.py
    Edited by: user10074087 on Dec 13, 2009 10:20 PM

    In case anyone finds this useful, I ended up using:
         jpythonScriptsDir = os.environ.get("SCRIPTS_PYTHON")
         execfile(jpythonScriptsDir + '/common/' + 'import.py')
    I run this at the start of all scripts that need access to the common functions.
    execfile loads the definitions in import.py into the namespace that has all of the WLST functions.

  • Clean libraries not referencing in weblogic, WLST

    Hi,
    How can I do to clean all libraries that they are not referencing to any application in WLST?
    Thanks!

    I solved in this way:
    domainRuntime()
    cd('ServerRuntimes')
    servers = domainRuntimeService.getServerRuntimes()
    for server in servers:
      print('')
      print '--------------------------------------------------'
      print '--------------- ServerName -----------------------'
      print '--------------------------------------------------'
      print('')
      print('')
      print 'SERVER NAME: ' + server.getName()
      print 'SERVER STATE: ' + server.getState()
      print 'SERVER HEALTH STATE: ' + str(server.getHealthState())
      print('')
      libraries = server.getLibraryRuntimes()
      for library in libraries :
      libName = library.getLibraryName()
      libIdentifier = library.getLibraryIdentifier()
      if libName.startswith('com.edisa.libra.'):
      referencingNames = library.getReferencingNames()
      if referencingNames != 'null' and  len(referencingNames) > 0:
      print('libName ' + libName+' libIdentifier '+libIdentifier)
      for ref in referencingNames:
      print(' ---> Referenced in : '+ ref)
      print('')
      else:
      print('libName ' + libName + ' is not referenced')
      status = undeploy(libName)
      print(status)
      print('')

Maybe you are looking for

  • Possible to recover data from dead HD?

    in July of this year, my HD stopped working for whatever reason. i got the folder icon when i started my Mac mini that day and did lots of troubleshooting with no luck. i ended up putting a new one in and all is fine now. EXCEPT all my pics and whatn

  • URGENT:::::::::::::::::posting extended idoc

    i have extended orders05... created a purchase order and idoc was successully generated . i've generated an inbound idoc using we19 tool. my idoc shows status 51.. the error msg reads that there are entries to be made in required fields.... i've alre

  • How to make a widget like "gorongosa landscapes", featured in ibooks author gallery of widgets?

    Dear all, I would like to make a widget, similar to "Gorongosa landscapes" demo in author gallery of widgets: http://www.apple.com/ibooks-author/gallery.html Any idea? Best, M

  • Will a new 320gb hard Drive work in a T60p?

    I have a T60P, Vista Business, latest bios. Specifically, I would like to install a Western Digital Scorpio, 320gb, 7200rpmm sata drive. It is the same dimensions and has the same connections as the origional drive. Any suggestions would really be ap

  • Bind message type and process code

    Hi everyone, I want to bind one message type with two procee code,How can I do this?Thanks in advance! Best Regars, Yu