{"id":3991,"date":"2014-11-24T12:01:03","date_gmt":"2014-11-24T04:01:03","guid":{"rendered":"http:\/\/rmohan.com\/?p=3991"},"modified":"2014-11-24T12:01:03","modified_gmt":"2014-11-24T04:01:03","slug":"wsadmin-commands","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=3991","title":{"rendered":"wsadmin commands"},"content":{"rendered":"<p>Starting the wsadmin scripting client:<\/p>\n<p>1.Launch the wsadmin tool using Jython:<br \/>\nwsadmin -lang jython <span class=\"skimlinks-unlinked\">wsadmin.sh<\/span> -lang jython<\/p>\n<p>Note OutPut:<br \/>\nWASX7209I: Connected to process \u201cdmgr\u201d on node dnodeV60 using SOAP connector; The type of process is: DeploymentManager<\/p>\n<p>2. Launch the wsadmin tool using Jython when security is enabled:<br \/>\n<span class=\"skimlinks-unlinked\">wsadmin.bat<\/span> -lang jython -user wsadmin -password wsadmin<\/p>\n<p>3. Launch the wsadmin tool using Jacl with no options:<br \/>\n<span class=\"skimlinks-unlinked\">wsadmin.bat<\/span> -lang jacl<\/p>\n<p>4. Run scripting commands as individual commands<br \/>\na. AdminApp object using Jython:<br \/>\nwsadmin -lang jython -c \u201c<span class=\"skimlinks-unlinked\">AdminApp.list<\/span>()\u201d \u2014-&gt;windows<br \/>\n<span class=\"skimlinks-unlinked\">wsadmin.sh<\/span> -lang jython -c \u2018<span class=\"skimlinks-unlinked\">AdminApp.list<\/span>()\u2019 \u2014-&gt; unix<\/p>\n<p>b.AdminApp object using jacl:<br \/>\nwsadmin -c \u201c$AdminApp list\u201d \u2014-&gt;windows<br \/>\n<span class=\"skimlinks-unlinked\">wsadmin.sh<\/span> -c \u201c\\$AdminApp list\u201d (or) <span class=\"skimlinks-unlinked\">wsadmin.sh<\/span> -c \u2018$AdminApp list\u2019 \u2014-&gt; unix<\/p>\n<p>5. To Run the a1.py script using Jython<br \/>\nwsadmin -lang jython -f <span class=\"skimlinks-unlinked\">al.py<\/span> \u2014&gt;windows<br \/>\n<span class=\"skimlinks-unlinked\">wsadmin.sh<\/span> -lang jython -f <span class=\"skimlinks-unlinked\">al.py<\/span> \u2014&gt; unix<br \/>\nwhere the <span class=\"skimlinks-unlinked\">al.py<\/span> file contains the following commands:<br \/>\napps = <span class=\"skimlinks-unlinked\">AdminApp.list<\/span>()<br \/>\nprint \u201cApplications currently installed:\\n \u201d + apps<\/p>\n<p>6. Run the a1prof.py script using Jacl:<br \/>\n<span class=\"skimlinks-unlinked\">wsadmin.bat<\/span> -profile <span class=\"skimlinks-unlinked\">alprof.jacl<\/span> \u2014-&gt; windows<br \/>\n<span class=\"skimlinks-unlinked\">wsadmin.sh<\/span> -profile <span class=\"skimlinks-unlinked\">alprof.jacl<\/span> \u2014\u2013&gt; unix<br \/>\nwhere the <span class=\"skimlinks-unlinked\">alprof.jacl<\/span> file contains the following commands:<br \/>\nset apps [$AdminApp list]<br \/>\nputs \u201cApplications currently installed:\\n$apps\u201d<\/p>\n<p>\u2013&gt; Using the wsadmin scripting objects: Use the AdminConfig, AdminControl, AdminApp, AdminTask, and Help objects to perform administrative tasks.<br \/>\nEach of the management objects have commands that you can use to perform administrative tasks. To use the scripting objects, specify the scripting object, a command, and command parameters. In the following example, AdminConfig is the scripting object, attributes is the command, and ApplicationServer is the command parameter.<\/p>\n<p>Using Jython:<br \/>\nprint AdminConfig.attributes(\u2018ApplicationServer\u2019)<br \/>\nUsing Jacl:<br \/>\n$AdminConfig attributes ApplicationServer<\/p>\n<p>\u2013&gt; Help object for scripted administration:<br \/>\nFor example, using Jacl, $Help AdminApp or using Jython, Help.Adminapp(), provides information about the AdminApp object and the available commands.<\/p>\n<p>You can also use the Help object to obtain information about messages using the message command. The message command provides aid to understand the cause of a warning or error message and find a solution for the problem. For example, you receive a WASX7115E error when running the AdminApp install command to install an application, use the following example:<br \/>\nJacl \u2014&gt; $Help message WASX7115E<br \/>\njython \u2013&gt; print Help.message(\u2018WASX7115E\u2019)<\/p>\n<p>print <span class=\"skimlinks-unlinked\">Help.help<\/span>()<\/p>\n<p>\u2014&gt; Use the AdminConfig object, the AdminTask object, and the AdminApp object to handle configuration functionality.<\/p>\n<p>The AdminConfig object, the AdminTask object, and the AdminApp object are used when you are managing the configuration of the server that resides persistently in a repository on permanent storage. Use these objects to create, query, change, or remove this configuration without starting an application server process. To use the AdminTask object, you must be connected to a running server.<\/p>\n<p>\u2013&gt; Use the AdminControl object to manage running objects on application server installations.<\/p>\n<p>\u2014-&gt;<br \/>\n* AdminControl: Use to run operational commands.<br \/>\n* AdminConfig: Use to run configurational commands to create or modify WebSphere Application Server configurational elements.<br \/>\n* AdminApp: Use to administer applications.<br \/>\n* AdminTask: Use to run administrative commands.<br \/>\n* Help: Use to obtain general help.<\/p>\n<p><a href=\"http:\/\/publib.boulder.ibm.com\/infocenter\/wasinfo\/v6r0\/index.jsp?topic=\/com.ibm.websphere.nd.multiplatform.doc\/info\/ae\/ae\/txml_deployapp.html\">http:\/\/publib.boulder.ibm.com\/infocenter\/wasinfo\/v6r0\/index.jsp?topic=\/com.ibm.websphere.nd.multiplatform.doc\/info\/ae\/ae\/txml_deployapp.html<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u2014-&gt;Installing applications with wsadmin Tool:<\/p>\n<p>On a single server installation, the server must be running before you install an application.<\/p>\n<p>On a network deployment installation, the deployment manager must be running before you install an application.<\/p>\n<p>The application that you install must be an <tt>.ear<\/tt>, <tt>.jar<\/tt>, <tt>.sar<\/tt> or <tt>.war<\/tt> for the wsadmin tool.<\/p>\n<p>For example, if your configuration consists of a node, a cell, and a server,<\/p>\n<p>AdminApp.install(\u2018<span class=\"skimlinks-unlinked\">location_of_ear.ear<\/span>\u2019, \u00a0 \u2018[-node nodeName -cell cellName\u00a0 -server serverName]\u2018)<\/p>\n<p>print AdminApp.options() \u2014&gt; list of supported options for an Enterprise Archive (EAR) file<\/p>\n<p>For a single server installation only, \u2013&gt;\u00a0 AdminApp.install(\u2018c:\/MyStuff\/application1.ear\u2019, \u2018[-server serv2]\u2018)<\/p>\n<p>. For a network deployment installation only, \u2013&gt;\u00a0 AdminApp.install(\u2018c:\/MyStuff\/application1.ear\u2019, \u2018[-cluster cluster1]\u2018)<\/p>\n<p>Save the configuration changes \u2014&gt;\u00a0 <span class=\"skimlinks-unlinked\">AdminConfig.save<\/span>()<\/p>\n<p>In a network deployment environment only, synchronize the node. See the <a href=\"http:\/\/publib.boulder.ibm.com\/infocenter\/wasinfo\/v6r0\/topic\/com.ibm.websphere.nd.multiplatform.doc\/info\/ae\/ae\/txml_sync.html\">Synchronizing nodes with the wsadmin tool<\/a> article for more information.<\/p>\n<p>Set the variable for node synchronization<\/p>\n<p>Sync1 = AdminControl.\u00a0 completeObjectName(\u2018type=NodeSync,node=myNodeName,*\u2019)<\/p>\n<p>Synchronize the node by issuing the following command:<\/p>\n<p>AdminControl.invoke(Sync1, \u2018sync\u2019)<\/p>\n<p>We\u00a0 receive an output value of <tt>true<\/tt>, if the synchronization completes.<\/p>\n<p>=======================================<\/p>\n<p>\u2013&gt; <span class=\"skimlinks-unlinked\">AdminApp.view<\/span>( \u2018appName\u2019 ) : Replace appName with one of the names returned by<span class=\"skimlinks-unlinked\">AdminApp.list<\/span>(). The name must be surrounded by quotes<\/p>\n<p>\u2013&gt; <span class=\"skimlinks-unlinked\">AdminApp.list<\/span>() : Lists every application installed in your cell<\/p>\n<p>\u2014&gt; AdminTask.createApplicationServer(\u2018Node1?, \u2018[-name serverNode1 ]\u2018) : Creates a new application server called \u201cserverNode1? in a node called \u201cNode1?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Starting the wsadmin scripting client:<\/p>\n<p>1.Launch the wsadmin tool using Jython: wsadmin -lang jython wsadmin.sh -lang jython<\/p>\n<p>Note OutPut: WASX7209I: Connected to process \u201cdmgr\u201d on node dnodeV60 using SOAP connector; The type of process is: DeploymentManager<\/p>\n<p>2. Launch the wsadmin tool using Jython when security is enabled: wsadmin.bat -lang jython -user wsadmin -password wsadmin<\/p>\n<p>3. [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3991"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3991"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3991\/revisions"}],"predecessor-version":[{"id":3992,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/3991\/revisions\/3992"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3991"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}