YOUR FEEDBACK
Bill Miller wrote: Good article. Data Services is a great place to get value from SOA, and a great...
AJAXWorld RIA Conference
Early Bird Savings Expire Friday Register Today and SAVE !..

2008 East
DIAMOND SPONSOR:
Data Direct
Frontiers in Data Access: The Coming Wave in Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
Intel
Virtualization – Path to Predictive Enterprise
Green Hills
IT Security in a Hostile World
JBoss / freedom oss
Practical SOA Approach
GOLD SPONSORS:
Software AG
The Art & Science of SOA: How Governance Enables Adoption
PlateSpin
Effective Planning for Virtual Infrastructure Growth
Fujitsu
Automated Business Process Discovery & Virtualization Service
Ceedo
Workspace Virtualization
Click For 2007 West
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts

SYS-CON.TV
TOP THREE LINKS YOU MUST CLICK ON


Administrative Tasks Using the weblogic.Admin Command-Line Utility
Administrative Tasks Using the weblogic.Admin Command-Line Utility

WebLogic Server (WLS) provides several ways to configure servers, clusters, machines, JDBC connection pools, JMS servers, and so on, using the following:

  • Domain Configuration wizard: GUI tool
  • Admin console: Browser-based GUI interface
  • Programmatic JMX API interface
  • weblogic.Admin command-line utility
The command-line interface comes in handy if you want to integrate this tool into Perl or Ant scripts for administration and management efficiency, if you can't access the Admin console through a browser, or if you prefer using command-line tools over a GUI interface.

In this section we'll focus on doing admin tasks using the weblogic.Admin command-line utility. I've assumed that you're using WLS 7.0, although the same syntax should work fine in the 6.x release.

Before invoking the weblogic.Admin utility, set the WLS development environment. In Windows it's setWLSEnv.cmd; in Unix platforms it's setWLSEnv.sh. These files are located under $WL_HOME/user_projects/your-domain folder.Let's try some basic MBean commands using WebLogic. Admin utility.

1.   To create a server named "WLDJServer", use the following example:

<<Note: for the blue text, set apart and use different font but not code font>>

java weblogic.Admin -url {admin-serverl url} -username {admin-user} -password {admin-password} CREATE -mbean {object_name}

where object_name is in the form of

"domain-name:Name={server name}:Name,Type={type of Mbean}"

Example:

java weblogic. Admin -url {admin-serverl url} -username {admin-user} -password
{admin-password} CREATE -mbean "WLDJDomain: Name=WLDJServer, Type=Server"

where "WLDJDomain" is your domain name. After executing the above command, write the entries shown in Listing 1 into config.xml.

2.   To create a cluster named "WLDJCluster", use the following example:

java weblogic. Admin -url {admin-serverl url} -username {admin-user} -password
{admin-password} CREATE -mbean {object_name}

where object_name is in the form of

"domain-name:Name={cluster name}:Name,Type={type of Mbean}"

Example:

java weblogic.Admin -url {admin-serverl url} -username {admin-user} -password
{admin-password} CREATE -mbean WLDJDomain:Name=WLDJluster,Type=Cluster"

After executing the above command, write the following into config.xml:

<Cluster Name="WLDJCluster"/>

3.   To set/change the configuration attributes of this Mbean, use the weblogic.Admin SET option:

java weblogic.Admin -url {admin-serverl url} -username {admin user} -password
{admin password} SET -mbean "{object_name}" -property {property_name} {property_value}

where property_name can be one of the Mbean attributes, such as MulticastAddress, ClusterAddress, and InterfaceAddress, and so on.

Example:

java weblogic. Admin -url {admin-server url} -username {admin user} -password
{admin password} SET -mbean "mydomain:Name=WLDJCluster,Type=Cluster"
-property "MulticastAddress" "224.0.0.1"

After executing the above command, write the following entries into config.xml:

<Cluster MulticastAddress="224.0.0.1" Name="WLDJCluster"/>

4.   To assign the managed server created in step 1 to a cluster, use weblogic.Admin SET:

java weblogic. Admin -url {admin-serverl url} -username {admin user} -password
{admin password} SET -mbean "{object_name}" -property {property_name} {property_value}

Example:

java weblogic. Admin -url {admin-server url} -username {admin-user} -password
{admin-password} SET -mbean "mydomain:Name=WLDJServer,Type=Server"
-property Cluster "WLDJDomain:Name=WLDJCluster,Type=Cluster"

The above command will update the config.xml with the following entries:

<Server Cluster="WLDJCluster" Name="WLDJServer">
</Server>

5.   To view configuration attributes of a particular Mbean, use weblogic.Admin GET:

java weblogic.Admin -url {admin-server url} -username {admin-user} -password
{admin-password} -pretty GET -type {Config Mbean}

where ConfigMBean could be ServerConfig, ExecuteQueueConfig, DomainConfig, and so on.

Example:

java weblogic.Admin -url {admin-server url} -username {admin-user} -password
{admin-password} -pretty GET -type ServerConfig.

6.   To view runtime statistics of a particular Mbean, use weblogic.Admin GET:

java weblogic.Admin -url {admin-server url} -username {admin-user} -password
{admin-password} -pretty GET -type {ConfigMbean}

where ConfigMBean could be ServerConfig, ExecuteQueueConfig, DomainConfig, and so on.

Example:

java weblogic. Admin -url {admin-server url} -username {admin-user} -password
{admin-password} -pretty GET -type ServerRuntime.

7.   To create a connection pool, use weblogic.Admin CREATE_POOL:

java weblogic. Admin -url {admin-server url} -username
{admin-user} -password
{admin-password} -pretty CREATE_POOL {pool_string}

Example:

java weblogic. Admin -url {admin-server url} -username
{admin-user} -password
{admin-password} -pretty CREATE_POOL WLDJ817ThinPool
"url=jdbc:oracle: thin:
@baybridge:1521:bay817,driver=oracle.jdbc.driver.OracleDriver,
initialCapacity=1,maxCapacity=1,
props=user=SCOTT;password=tiger;"

Summary
The weblogic.Admin utility provides a powerful command-line interface to accomplish administrative tasks that can be done using the WebLogic console. This tool comes in handy for administrators and infrastructure teams who can use it to integrate with Ant or Perl scripts, thereby automating the build process.

References

  • http://e-docs.bea.com/wls/docs70/ adminguide/cli.html#1146603
    About Kumar Allamraju
    Kumar Allamraju is a Sr. Developer Relations Engineer at BEA Systems in WebLogic server support division based in San Francisco. Kumar has 5 yrs of experience in object oriented programming and in J2EE related technologies. He has a Bachelors degree in Computer Science

  • BEA WEBLOGIC LATEST STORIES
    Since its emergence, Web Service technology has gone a long way towards perfecting itself and finding its right application in the real world. With the maturity of the specifications, Web Service technology, with its power of interoperability, is now the major enabling technology of SO...
    Join Scott Guthrie as he discusses Microsoft’s commitment to web standards development, Rich Internet Applications and how Microsoft is contributing to help move the web forward. Join Adobe’s Kevin Lynch as he demonstrates how Flash and HTML come together to make the most engaging,...
    Virtualization has become a critical part of Enterprise IT strategy. Why and how has it become one of the most important change agents in our industry? To answer these questions I had the good fortune recently to be able to speak to a select group of top IT industry executives who join...
    Watching VMware stock and its market cap spike since it IPO'd must have had Red Hat positively pea green with envyWatching VMware stock and its market cap spike since it IPO'd must have had Red Hat positively pea green with envy - so green in fact that it's gonna try taking VMware on b...
    A standard from OASIS called Web Services for Remote Portlets (WSRP) is used so portlets can be decoupled from a portal. In part one (JDJ, Volume. 13, issue 3) of this article, we introduced the relevant standards and specifications and then demonstrated WSRP's capabilities by consumin...
    SYS-CON's upcoming '3rd International Virtualization Conference & Expo' faculty includes such distinguished speakers as: Al Aghili (Managed Methods), Alan Chhabra (Egenera), Andi Mann (Enterprise Management Associates), Andrew Conte (APC), Andy Astor (EnterpriseDB), Ariel Cohen (Xsigo ...
    SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
    SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
    Click to Add our RSS Feeds to the Service of Your Choice:
    Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
    myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
    Publish Your Article! Please send it to editorial(at)sys-con.com!

    Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

    SYS-CON FEATURED WHITEPAPERS

    ADS BY GOOGLE
    BREAKING NEWS FROM THE WIRES

    Autodesk, Inc. (NASDAQ:ADSK) today announced that its Autodesk LocationLogic platfo...