YOUR FEEDBACK
NGASI Releases AppServer Manager 8.1
Dave Jenkins wrote: The remote server management is a welcomed added feature...
SOA World Conference
Virtualization Conference
$200 Savings Expire May 16, 2008... – Register Today!

2007 West
GOLD SPONSORS:
Active Endpoints
Your SOA Needs BPEL for Orchestration
BEA
Virtualized SOA: Adaptive Infrastructure for Demanding Applications
Nexaweb
Overcoming Bandwidth Challenges with Nexaweb
TIBCO
What is Service Virtualization?
SILVER SPONSORS:
WSO2
Using Web Services Technologies and FOSS Solutions
Click For 2007 East
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

Digg This!

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
    Microsoft To Keynote 4th International Virtualization Conference & Expo
    Mike Neil is general manager for virtualization strategy in the Windows Server Division at Microsoft. Mike is focused on the delivery of the Windows virtualization technology, including Windows Server 2008 Hyper-V, Microsoft Hyper-V Server and Virtual PC 2007. Mike also directs the tec
    3rd International Virtualization Conference & Expo: Themes & Topics
    From Application Virtualization to Xen, a round-up of the virtualization themes & topics being discussed in NYC June 23-24, 2008 by the world-class speaker faculty at the 3rd International Virtualization Conference & Expo being held by SYS-CON Events in The Roosevelt Hotel, in midtown
    Virtualization Meets DaaS - Desktop-as-a-Service
    After a $1.5 million angel round, Desktone, which was started in 2006 by Eric Pulier, who also started SOA Software, US Interactive and IVT, picked up $17 million in first-round funding about a year ago from Highland Capital Partners, SoftBank Capital, Citrix Systems and the China-base
    Engelbart's Usability Dilemma: Efficiency vs Ease-of-Use
    The mouse was the original idea of Doug Engelbart who was the head of the Augmentation Research Center (ARC) at Stanford Research Institute. Engelbart's philosophy is best embodied, in my opinion, in the design of another device that he invented, the five-finger keyboard - with keys li
    Web 2.0 Is Fundamentally About Empowering People
    'Unlocking content to be remixed into new business value' is the driver of Web 2.0 in the enterprise, says Rod Smith, IBM VP of Emerging Internet Technologies, in this Exclusive Q&A with Jeremy Geelan on the occasion of IBM's release of a new technology created by IBM researchers, code
    Why Do 'Cool Kids' Choose Ruby or PHP to Build Websites Instead of Java?
    Here is a question that I have been pondering on and off for quite a while: Why do 'cool kids' choose Ruby or PHP to build websites instead of Java? I have to admit that I do not have an answer. Why do I even care? Because I am a Java developer. Like many Java developers, I get along w
    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

    MOST READ THIS WEEK
    ADS BY GOOGLE
    BREAKING NEWS FROM THE WIRES
    AmberPoint Extends SOA Governance to Apache ServiceMix, BEA AquaLogic Service Bus 3.0, BEA WebLogic Integration, Cisco ACE XML Gateway, JBoss Enterprise Application Platform and Oracle Fusion
    AmberPoint announced today that it has extended the reach of its runtime SOA governance