{"id":3456,"date":"2012-07-14T21:06:59","date_gmt":"2012-07-15T02:06:59","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=3456"},"modified":"2012-07-24T15:09:17","modified_gmt":"2012-07-24T20:09:17","slug":"wlst-information-commands","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=3456","title":{"rendered":"WLST: Information Commands"},"content":{"rendered":"<span id=\"Overview\"><h2>Overview<\/h2><\/span>\n<p>* Use the WLST information commands to<br \/>\n&#8211; interrogate domains, servers, and variables,<br \/>\n&#8211; and provide configuration bean, runtime bean, and WLST-related information.<\/p>\n<span id=\"Commands\"><h2>Commands<\/h2><\/span>\n<span id=\"addListener\"><h3>addListener<\/h3><\/span>\n<p>* Add a JMX listener to the specified MBean.<br \/>\n* Online.<br \/>\n* Syntax:<\/p>\n<pre lang=\"bash\">\r\naddListener(mbean, [attributeNames], [logFile], [listenerName])\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\naddListener(cmo, \"Notes,ArchiveConfigurationCount\",\".\/listeners\/domain.log\",\"domain-listener\")\r\n<\/pre>\n<span id=\"configToScript\"><h3>configToScript<\/h3><\/span>\n<p>* Convert an existing server configuration (config directory) to an executable WLST script.<br \/>\n* Online or Offline.<br \/>\n* Syntax:<\/p>\n<pre lang=\"bash\">\r\nconfigToScript([configPath], [pyPath], [overwrite], [propertiesFile], [createDeploymentScript])\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/offline> configToScript() \r\nwls:\/offline> configToScript('c:\/Oracle\/Middleware\/user_projects\/domains\/mydomain','c:\/Oracle\/Middleware\/myscripts')\r\n<\/pre>\n<span id=\"dumpStack\"><h3>dumpStack<\/h3><\/span>\n<p>* Display stack trace from the last exception that occurred while performing a WLST action, and reset the stack trace.<br \/>\n* Online or Offline.<br \/>\n* Syntax: <\/p>\n<pre lang=\"bash\">\r\ndumpStack()\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/offline> dumpStack()\r\nThis Exception occurred at Wed Sep 21 11:54:18 EDT 2011.\r\nweblogic.management.scripting.ScriptException: Error occured while performing configToScript : Error making set beans.\r\nUse dumpStack() to view the full stacktrace\r\n        at weblogic.management.scripting.ExceptionHandler.handleException(ExceptionHandler.java:50)\r\n<\/pre>\n<span id=\"dumpVariables\"><h3>dumpVariables<\/h3><\/span>\n<p>* Display all variables used by WLST, including their name and value.<br \/>\n* Online or Offline.<br \/>\n* Syntax:<\/p>\n<pre lang=\"bash\">\r\ndumpVariables()\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/basicWLSDomain\/serverConfig> dumpVariables()\r\nadminHome                     weblogic.rmi.internal.BasicRemoteRef - hostID: '-757338143456366624S:127.0.0.1:[7001,7001,-1,-1,-1,-1,-1]:basicWLSDomain:AdminServer', oid: '259', channel: 'null'\r\ncmgr                          [MBeanServerInvocationHandler]com.bea:Name=ConfigurationManager,Type=weblogic.management.mbeanservers.edit.ConfigurationManagerMBean\r\ncmo                           [MBeanServerInvocationHandler]com.bea:Name=basicWLSDomain,Type=Domain\r\nconnected                     true\r\ndomainName                    basicWLSDomain\r\n<\/pre>\n<span id=\"find\"><h3>find<\/h3><\/span>\n<p>* Find MBeans and attributes in the current hierarchy.<br \/>\n* Online.<br \/>\n* Syntax:<\/p>\n<pre lang=\"bash\">\r\nfind([name], [type], [searchInstancesOnly])\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/basicWLSDomain\/serverConfig> find(name = 'JavaCompiler')\r\nFinding 'JavaCompiler' in all registered MBean instances ...\r\n\/Servers\/AdminServer                           JavaCompiler\r\n                  javac\r\n\/Servers\/AdminServer                           JavaCompilerPostClassPath\r\n                  null\r\n\/Servers\/AdminServer                           JavaCompilerPreClassPath\r\n                  null\r\n\/AppDeployments\/mejb\/AppMBean\/mejb\/Components\/mejb JavaCompiler\r\n                      null\r\n\/AppDeployments\/mejb\/AppMBean\/mejb\/Components\/mejb JavaCompilerPreClassPath\r\n                      null\r\n\/AppDeployments\/mejb\/AppMBean\/mejb\/Components\/mejb JavaCompilerPostClassPath\r\n                      null\r\n\r\nwls:\/basicWLSDomain\/serverConfig> find(type='JMSRuntime')\r\nFinding MBean of type JMSRuntime in all the instances ...\r\nNo results found in MBean Instances\r\n\r\nwls:\/basicWLSDomain\/serverConfig> find(name='execute', searchInstancesOnly='false')\r\nFinding 'execute' in all registered MBean instances ...\r\n\/Servers\/AdminServer                           Use81StyleExecuteQueues\r\n                  false\r\n\/Servers\/AdminServer                           ExecuteQueues\r\n                  [Ljavax.management.ObjectName;@1c53725\r\n\r\nNow finding 'execute' in all MBean Types that can be instantiated ...\r\n<\/pre>\n<span id=\"getConfigManager\"><h3>getConfigManager<\/h3><\/span>\n<p>* Return the latest ConfigurationManagerBean MBean which manages the change process.<br \/>\n* Online.<br \/>\n* Syntax:<\/p>\n<pre lang=\"bash\">\r\ngetConfigManager()\r\n\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/basicWLSDomain\/serverConfig> cm=getConfigManager()\r\nwls:\/basicWLSDomain\/serverConfig> cm.getType()\r\n'weblogic.management.mbeanservers.edit.ConfigurationManagerMBean'\r\n<\/pre>\n<span id=\"getMBean\"><h3>getMBean<\/h3><\/span>\n<p>* Return the MBean by browsing to the specified path.<br \/>\n* Online.<br \/>\n* Syntax: <\/p>\n<pre lang=\"bash\">\r\ngetMBean(mbeanPath)\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/basicWLSDomain\/serverConfig> com=getMBean('Servers\/AdminServer\/COM\/AdminServer')\r\nwls:\/basicWLSDomain\/serverConfig> com.getType()\r\n'COM'\r\n<\/pre>\n<span id=\"getMBI\"><h3>getMBI<\/h3><\/span>\n<p>* Return the MBeanInfo for the specified MBeanType or the cmo variable.<br \/>\n* Online.<br \/>\n* Syntax: <\/p>\n<pre lang=\"bash\">\r\ngetMBI([mbeanType])\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/basicWLSDomain\/serverConfig> svrMbi=getMBI('weblogic.management.configuration.ServerMBean')\r\nwls:\/basicWLSDomain\/serverConfig>\r\n<\/pre>\n<span id=\"getPath\"><h3>getPath<\/h3><\/span>\n<p>* Return the MBean path for the specified MBean instance.<br \/>\n* Online.<br \/>\n* Syntax: <\/p>\n<pre lang=\"bash\">\r\ngetPath(mbean)\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/basicWLSDomain\/serverConfig> path=getPath('com.bea:Name=AdminServer,Type=Server')\r\nwls:\/basicWLSDomain\/serverConfig> print path\r\nServers\/AdminServer\r\n<\/pre>\n<span id=\"listChildTypes\"><h3>listChildTypes<\/h3><\/span>\n<p>* List all the children MBeans that can be created or deleted for the cmo type.<br \/>\n* Online.<br \/>\n* Syntax: <\/p>\n<pre lang=\"bash\">\r\nlistChildTypes([parent])\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/basicWLSDomain\/serverConfig> listChildTypes()\r\nBridgeDestinations\r\nCachingRealms\r\nClusters\r\nCoherenceClusterSystemResources\r\nCoherenceServers\r\nCustomRealms\r\nCustomResources\r\n<\/pre>\n<span id=\"lookup\"><h3>lookup<\/h3><\/span>\n<p>* Look up the specified MBean.<br \/>\n* Online.<br \/>\n* Syntax: <\/p>\n<pre lang=\"bash\">\r\nlookup(name, [childMBeanType])\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/basicWLSDomain\/serverConfig> sbean=lookup('AdminServer','Server')\r\nwls:\/basicWLSDomain\/serverConfig> sbean.getType()\r\n'Server'\r\nwls:\/basicWLSDomain\/serverConfig>\r\n<\/pre>\n<span id=\"ls\"><h3>ls<\/h3><\/span>\n<p>* List all child beans and\/or attributes for the current configuration or runtime bean.<br \/>\n* Online or Offline.<br \/>\n* Syntax: <\/p>\n<pre lang=\"bash\">\r\nls( [ a | c | o ] [ moPath ])\r\nls( [ moPath ] returnMap [ returnType ] )\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nls()\r\nls('a')\r\nls('Servers')\r\n<\/pre>\n<span id=\"man\"><h3>man<\/h3><\/span>\n<p>* Display help from MBeanInfo for the current MBean or its specified attribute.<br \/>\n* Online.<br \/>\n* Syntax: <\/p>\n<pre lang=\"bash\">\r\nman([attrName])\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/basicWLSDomain\/serverConfig> man('Servers')\r\ncom.bea.creator : createServer\r\ncom.bea.description : <p>Returns the ServerMBeans representing the servers thathave been configured to be part of this domain.<\/p>\r\ncom.bea.destroyer : destroyServer\r\ncom.bea.dynamic : true\r\ncom.bea.relationship : containment\r\ndescriptorType : Attribute\r\ndisplayName : Servers\r\ninterfaceclassname : [Lweblogic.management.configuration.ServerMBean;\r\nName : Servers\r\n<\/pre>\n<span id=\"redirect\"><h3>redirect<\/h3><\/span>\n<p>* Redirect WLST output to the specified filename.<br \/>\n* Online.<br \/>\n* Syntax: <\/p>\n<pre lang=\"bash\">\r\n<pre lang=\"bash\">\r\nredirect(outputFile, [toStdOut])\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/mydomain\/serverConfig> redirect('.\/logs\/wlst.log') \r\n<\/pre>\n<span id=\"removeListener\"><h3>removeListener<\/h3><\/span>\n<p>* Remove a listener that was previously defined.<br \/>\n* Online.<br \/>\n* Syntax:<\/p>\n<pre lang=\"bash\">\r\nremoveListener([mbean], [listenerName])\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/mydomain\/serverConfig> removeListener(listenerName=\"mylistener\") \r\n<\/pre>\n<span id=\"showListeners\"><h3>showListeners<\/h3><\/span>\n<p>* Show all listeners that are currently defined.<br \/>\n* Online.<br \/>\n* Syntax:<\/p>\n<pre lang=\"bash\">\r\nshowListeners()\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/basicWLSDomain\/serverConfig> showListeners()\r\ndomain-listener: Listener for MBean com.bea:Name=basicWLSDomain,Type=Domain for attribute(s) Notes,ArchiveConfigurationCount\r\ndomain-listener2: Listener for MBean com.bea:Name=basicWLSDomain,Type=Domain for attribute(s) Notes,ArchiveConfigurationCount\r\n<\/pre>\n<span id=\"startRecording\"><h3>startRecording<\/h3><\/span>\n<p>* Record all user interactions with WLST; useful for capturing commands to replay.<br \/>\n* Online or Offline.<br \/>\n* Syntax:<\/p>\n<pre lang=\"bash\">\r\nstartRecording(recordFile, [recordAll])\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/mydomain\/serverConfig> startRecording('c:\/myScripts\/record.py') \r\nStarting recording to c:\/myScripts\/record.py\r\nwls:\/mydomain\/serverConfig>\r\n<\/pre>\n<span id=\"state\"><h3>state<\/h3><\/span>\n<p>* Returns a map of servers or clusters and their state using Node Manager.<br \/>\n* Online.<br \/>\n* Syntax:<\/p>\n<pre lang=\"bash\">\r\nstate(name, [type])\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/mydomain\/serverConfig> state('managed1','Server') \r\nCurrent state of \"managed1\": SUSPENDED \r\nwls:\/mydomain\/serverConfig>\r\n\r\nwls:\/mydomain\/serverConfig> state('mycluster','Cluster') \r\nThere are 3 server(s) in cluster: mycluster\r\n\r\nStates of the servers are\r\nMServer1---SHUTDOWN\r\nMServer2---SHUTDOWN\r\nMServer3---SHUTDOWN\r\nwls:\/mydomain\/serverConfig>\r\n<\/pre>\n<span id=\"stopRecording\"><h3>stopRecording<\/h3><\/span>\n<p>* Stop recording WLST commands.<br \/>\n* Online or Offline.<br \/>\n* Syntax:<\/p>\n<pre lang=\"bash\">\r\nstopRecording()\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/mydomain\/serverConfig> stopRecording() \r\nStopping recording to c:\\myScripts\\record.py\r\nwls:\/mydomain\/serverConfig>\r\n<\/pre>\n<span id=\"stopRedirect\"><h3>stopRedirect<\/h3><\/span>\n<p>* Stop redirection of WLST output to a file.<br \/>\n* Online or Offline.<br \/>\n* Syntax:<\/p>\n<pre lang=\"bash\">\r\nstopRedirect()\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/mydomain\/serverConfig> stopRedirect() \r\nWLST output will not be redirected to myfile.txt any more\r\n<\/pre>\n<span id=\"storeUserConfig\"><h3>storeUserConfig<\/h3><\/span>\n<p>* Create a user configuration file and an associated key file.<br \/>\n* Online.<br \/>\n* Syntax:<\/p>\n<pre lang=\"bash\">\r\nstoreUserConfig([userConfigFile], [userKeyFile], [nm])\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/basicWLSDomain\/serverConfig> storeUserConfig('c:\/TEMP\/myuserconfigfile.secure', 'c:\/TEMP\/myuserkeyfile.secure')\r\nCreating 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 n\r\ny\r\nThe username and password that were used for this WebLogic Server connection are stored in c:\/TEMP\/myuserconfigfile.secure and c:\/TEMP\/myuserkeyfile.secure.\r\nwls:\/basicWLSDomain\/serverConfig>\r\n<\/pre>\n<span id=\"threadDump\"><h3>threadDump<\/h3><\/span>\n<p>* Display a thread dump for the specified server.<br \/>\n* Online or Offline.<br \/>\n* Syntax:<\/p>\n<pre lang=\"bash\">\r\nthreadDump([writeToFile], [fileName], [serverName])\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/mydomain\/serverConfig> threadDump() \r\nwls:\/mydomain\/serverConfig> threadDump(writeToFile='false', serverName='managedServer') \r\n<\/pre>\n<span id=\"viewMBean\"><h3>viewMBean<\/h3><\/span>\n<p>* Display information about an MBean, such as the attribute names and values, and operations.<br \/>\n* Online.<br \/>\n* Syntax:<\/p>\n<pre lang=\"bash\">\r\nviewMBean(mbean)\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/basicWLSDomain\/serverConfig> viewMBean(cmo)\r\nAttribute Names and Values\r\n--------------------------\r\nVirtualHosts                                 null\r\nDomainVersion                                10.3.4.0\r\nClusterConstraintsEnabled                    false\r\nCoherenceClusterSystemResources              null\r\nServers                                      javax.management.ObjectName[com.bea:Name=AdminServer,Type=Server]\r\nMigratableTargets                            null\r\n<\/pre>\n<span id=\"writeIniFile\"><h3>writeIniFile<\/h3><\/span>\n<p>* Convert WLST definitions and method declarations to a Python (.py) file.<br \/>\n* Online or Offline.<br \/>\n* Syntax:<\/p>\n<pre lang=\"bash\">\r\nwriteIniFile(filePath)\r\n<\/pre>\n<p>* Examples:<\/p>\n<pre lang=\"bash\">\r\nwls:\/basicWLSDomain\/serverConfig> writeIniFile(\"wl.py\")\r\nThe Ini file is successfully written to wl.py\r\nwls:\/basicWLSDomain\/serverConfig>\r\n<\/pre>\n<span id=\"References\"><h2>References<\/h2><\/span>\n<p>* <a href=\"http:\/\/download.oracle.com\/docs\/cd\/E17904_01\/web.1111\/e13813\/reference.htm#insertedID8\">Information Commands<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview * Use the WLST information commands to &#8211; interrogate domains, servers, and variables, &#8211; and provide configuration bean, runtime bean, and WLST-related information. Commands addListener * Add a JMX listener to the specified MBean. * Online. * Syntax: addListener(mbean, &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=3456\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[104],"tags":[588,590,164],"class_list":["post-3456","post","type-post","status-publish","format-standard","hentry","category-weblogic11g","tag-11g","tag-weblogic","tag-wlst"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-TK","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/3456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3456"}],"version-history":[{"count":8,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/3456\/revisions"}],"predecessor-version":[{"id":5468,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/3456\/revisions\/5468"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}