Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic

Weblogic: Article

Application Management with Weblogic Server for Developers Part 2

Application Management with Weblogic Server for Developers Part 2

  • For the first part of this 6-part series, and the final four, please use the links at foot of the article

    Once your BEA WebLogic Server domain is configured, you need to deploy your application.

    This is the second in a series of articles on BEA WebLogic Server administration and management for developers. The first article (WLDJ, Vol. 2, issue 10) introduced the major concepts and terminology for a WebLogic Server domain. Then, we showed you the most commonly used graphical tools for setting up WebLogic Server, and packaging and configuring applications to be deployed on it: the Administration Console, the Configuration Wizard, and WebLogic Builder.

    In this article, we'll discuss application deployment, runtime management, and the monitoring facilities available with WebLogic Server - both graphical and command-line based.

    Application Deployment with the Administration Console
    In the deployment area of the Admin Console, you deploy new applications and modules - J2EE Enterprise applications, EJBs, Web applications, J2EE CA Connectors, and WebLogic Server Startup or Shutdown classes - to servers and clusters in the domain.

    WebLogic Server enables you to deploy an application or module as either an archive file or an exploded archive file that contains the same files and maintains the same directory structure as the archive itself. Archived applications and modules must use the correct file extension for the module type:

  • EJBs are packaged as .jar files.
  • Web applications are packaged as .war files.
  • Resource adapters are packaged as .rar files.
  • Enterprise applications are packaged as .ear files.
  • Web services are packaged as either .war or .ear files.

    Exploded archives are frequently used in a development environment because they allow you to easily change parts of the application, recompile, and redeploy without regenerating the J2EE archive. To target an exploded archive, you select the top-level directory of the application or module, rather than the archive file.

    After you have initially set up and deployed an application or module to one or more servers, you can stop, deploy, or redeploy the application or module without reconfiguring or re-copying its files, and without restarting the server. This is commonly referred to as hot deployment. Figure 1 shows an example of the Admin Console deployment screen.


    When the server runs in development mode, it also supports something known as auto-deployment. With auto-deployment, the server watches the server's applications directory for new or updated files and automatically deploys or redeploys the new or updated archives.

    Application and System Monitoring with the Admin Console
    The BEA WebLogic Server Admin Console provides features for monitoring J2EE application components. The first and most obvious way to make sure all components have deployed correctly and are available to the application is to find them in the JNDI tree. Figure 2 shows the JNDI tree displayed by the Admin Console.


    Next, you can monitor the individual component usage as your application runs to confirm that the application is using the server facilities in the most efficient way. There are multiple places in the Admin Console that allow you to do this. For EJBs, the Admin Console provides extensive statistics about the EJB runtime usage that can help you determine how efficiently the server is able to process requests for each EJB. While the Admin Console provides a default view of a subset of these statistics, it also allows you to customize the view in real time to meet your demands for specific information. An example of a view into the EJB statistics is shown in Figure 3.


    Similar to the EJB statistics, there is also a customizable display of servlets and JSP statistics, as shown in Figure 4.


    You can also monitor many other J2EE and server-specific resources. Figure 5 shows an example of monitoring a JDBC connection pool while Figure 6 shows you how to monitor the general health of the server through the Admin Console.


    Using the statistical and graphical information provided by the Admin Console, you can come up with initial estimates of your application's performance, see potential bottlenecks, and identify possible areas for optimization. While the Admin Console provides valuable application and server monitoring features, it may not provide enough information for all situations. In these cases, you have the following options:

  • Leverage BEA WebLogic Server's open and extensible management framework to add new monitoring features to the Admin Console, or access specific monitoring functionality from your custom applications.
  • Leverage the extensive BEA partner ecosystem, which has numerous administration and management vendors who offer products that plug into WebLogic Server and provide more comprehensive administration, management, and monitoring functionality, in many cases covering the entire enterprise environment, not just applications deployed on WebLogic Server.


    Command-Line Tools: weblogic.Admin and weblogic.Deployer
    Graphical administration and management tools available with BEA WebLogic Server provide a powerful, intuitive, and visual way to administer your WebLogic Server applications. However, in some cases simpler, more focused utilities are more convenient. In a development environment, a command-line interface provides a highly flexible way to automate administrative tasks into your build, deploy, and test process. In a production environment, the command-line interface provides a repeatable process for accomplishing tasks to reduce the opportunities to introduce human error.

    While not as visual and intuitive, the command-line interface does give you access to all of the functions available through the Admin Console, and even provides more flexible ways to access some features that are either hidden by the console or not that easy to use. Most of this access to administrative functionality is through the weblogic.Admin Java program's commands, which give you the ability to manipulate the underlying JMX infrastructure directly. To use these particular commands (GET, SET, CREATE, INVOKE, DELETE, and QUERY), you need to understand both JMX and BEA WebLogic Server's JMX MBeans. We will cover JMX in detail in a later article. The rest of this article will focus on the subset of commands that don't require an understanding of JMX, even though they are accessing the server's JMX infrastructure to accomplish their work.

    The weblogic.Admin utility is a command- line interface that you can use to administer, configure, and monitor WebLogic Server. Like the Admin Console, this utility assumes the role of client that invokes administrative operations on the Admin Server, which is the central management point for all servers in a domain. While the Admin Console does everything through the Admin Server, the weblogic.Admin utility can access the individual managed server directly, as well as access the Admin Server. If the Admin Server is down, you can still use the weblogic.Admin utility to retrieve runtime information from managed servers and invoke some administrative commands. However, BEA WebLogic Server can only save configuration changes to the domain when the Admin Server is available.

    Since weblogic.Admin is a Java program, you need to set up your environment before you can run it. Once it's done, you can run it following this syntax:

    java weblogic.Admin [ [-url | -adminurl] [protocol://]
    -username username [-password password]
    COMMAND-NAME arguments

    If you want weblogic.Admin to use SSL to communicate with your WebLogic Servers, then you'll need to define some additional Java system properties to tell weblogic.Admin certain information. For example, the weblogic.security.SSL.trustedCAKeyStore property tells weblogic.Admin (and any other WebLogic SSL client or server) where to find the trust key store. Setting weblogic.security.- SSL.ignoreHostnameVerification to true disables the normal process of veriying that the hostname in the server's certificate matches the server's IP address.

    There is really no way for us to explain all of the commands available through the WebLogic Server command-line interface - there are just too many of them to fit here. For a comprehensive list of the available commands, see the WebLogic Server documentation at http://edocs.bea.com/wls/docs81/admin_ref/cli.html. We provide just a few examples here for you to get a feel for what you can do.

    The FORCESHUTDOWN command instructs the Admin Server to shut down a managed server:

    java weblogic.Admin -url t3://AdminHost:7001
    -username weblogic -password weblogic
    FORCESHUTDOWN MedRecManagedServer

    After issuing this command, the BEA WebLogic Server instance named MedRecManagedServer will shut itself down without waiting for in-flight requests to complete. When it receives this command, the server will print messages to its log file and to standard out, indicating that the server state is changing and that the shutdown sequence is starting. If the command succeeds, the final message that the target server prints is as follows:

    <Jul 12, 2003 11:28:59 AM EDT> <Alert>
    <WebLogicServer> <000219> <The shutdown sequence
    has been initiated.>

    In addition, if the command succeeds, the weblogic.Admin utility returns the following:

    Server "MedRecManagedServer" was force shutdown successfully ...

    If the Admin Server is not available, you can send the FORCESHUTDOWN command directly to the managed server to have it shut itself down:

    java weblogic.Admin -url t3://ManagedHost:7001
    -username weblogic -password weblogic

    If you want to write scripts that don't require the user to know an administrative username or password, you can tell weblogic.Admin to use the information stored in your boot identity file, also known as the boot.properties file. To do this, you need to tell weblogic.Admin where to find the boot identity file and where the root directory of your server is so that it can find the information it needs to decrypt the boot identity file (the default value is the current directory). The following example provides user credentials by referring to a boot identity file and specifies the server's root directory so that it can be invoked from any directory:

    java Dweblogic.system.BootIdentityFile=c:mydomainoot.properties
    weblogic.Admin -url t3://AdminHost:7001

    BEA WebLogic Server also provides a command-line utility for deploying applications called weblogic.Deployer. As with weblogic.Admin, this utility is a Java program that requires certain arguments. The general syntax for weblogic.Deployer is: java weblogic.Deployer [options] [actions] [file(s)]

    The most important options include the URL of the Admin Server, the username and password of a user with deployment privileges, the name of the application or component being deployed, and the list of targets to which to deploy the application or component. As you would expect, the most important actions are deploy, redeploy, and undeploy. For a full list of the supported options and actions, please see the WebLogic Server documentation at http://edocs.bea.com/wls/docs81/deployment/tools.html.

    To deploy the MedRec enterprise application archive to our managed server, you would use the command shown in Listing 1.

    Just like weblogic.Admin, you can use Java system properties to specify SSL and/or boot identity file information (see Listing 2).

    For a full list of BEA WebLogic Server command-line administration tools and their associated commands, please refer to WebLogic Server online documentation at http://edocs.bea.com.

    This article showed you how to use the WebLogic Server Administration Console for managing BEA WebLogic Server and deploying and monitoring applications deployed on it. Then we introduced you to the command-line tools weblogic.Admin and weblogic.Deployer that provide the full scope of management functionality from the command-line interface.

    In our next article we'll talk about JMX and how to use the tools and scripting facilities provided by BEA WebLogic Server for configuring, managing, and monitoring a WebLogic Server application. In the last installment of this series, we will dive into the Java APIs for building custom JMX programs, creating custom MBeans, and extending the Admin Console.

  • More Stories By Vadim Rosenberg

    Vadim Rosenberg is the product marketing manager for BEA WebLogic Server. Before joining BEA two years ago, Vadim had spent 13 years in business software engineering, most recently at Compaq Computers (Tandem Division) developing a fault-tolerant and highly scalable J2EE framework.

    More Stories By Robert Patrick

    Robert Patrick is a director of technology in BEA's CTO Office and coauthor of the book Mastering BEA WebLogic Server: Best Practices for Building and Deploying J2EE Applications.  Robert has spent his career helping customers design, build, and deploy high performance, fault-tolerant, mission-critical distributed systems using BEA Tuxedo and BEA WebLogic Server.

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.

    IoT & Smart Cities Stories
    The challenges of aggregating data from consumer-oriented devices, such as wearable technologies and smart thermostats, are fairly well-understood. However, there are a new set of challenges for IoT devices that generate megabytes or gigabytes of data per second. Certainly, the infrastructure will have to change, as those volumes of data will likely overwhelm the available bandwidth for aggregating the data into a central repository. Ochandarena discusses a whole new way to think about your next...
    DXWorldEXPO LLC announced today that Big Data Federation to Exhibit at the 22nd International CloudEXPO, colocated with DevOpsSUMMIT and DXWorldEXPO, November 12-13, 2018 in New York City. Big Data Federation, Inc. develops and applies artificial intelligence to predict financial and economic events that matter. The company uncovers patterns and precise drivers of performance and outcomes with the aid of machine-learning algorithms, big data, and fundamental analysis. Their products are deployed...
    Dynatrace is an application performance management software company with products for the information technology departments and digital business owners of medium and large businesses. Building the Future of Monitoring with Artificial Intelligence. Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more busine...
    All in Mobile is a place where we continually maximize their impact by fostering understanding, empathy, insights, creativity and joy. They believe that a truly useful and desirable mobile app doesn't need the brightest idea or the most advanced technology. A great product begins with understanding people. It's easy to think that customers will love your app, but can you justify it? They make sure your final app is something that users truly want and need. The only way to do this is by ...
    CloudEXPO | DevOpsSUMMIT | DXWorldEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
    Digital Transformation and Disruption, Amazon Style - What You Can Learn. Chris Kocher is a co-founder of Grey Heron, a management and strategic marketing consulting firm. He has 25+ years in both strategic and hands-on operating experience helping executives and investors build revenues and shareholder value. He has consulted with over 130 companies on innovating with new business models, product strategies and monetization. Chris has held management positions at HP and Symantec in addition to ...
    Cell networks have the advantage of long-range communications, reaching an estimated 90% of the world. But cell networks such as 2G, 3G and LTE consume lots of power and were designed for connecting people. They are not optimized for low- or battery-powered devices or for IoT applications with infrequently transmitted data. Cell IoT modules that support narrow-band IoT and 4G cell networks will enable cell connectivity, device management, and app enablement for low-power wide-area network IoT. B...
    The hierarchical architecture that distributes "compute" within the network specially at the edge can enable new services by harnessing emerging technologies. But Edge-Compute comes at increased cost that needs to be managed and potentially augmented by creative architecture solutions as there will always a catching-up with the capacity demands. Processing power in smartphones has enhanced YoY and there is increasingly spare compute capacity that can be potentially pooled. Uber has successfully ...
    SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
    When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things'). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing. IoT is not about the devices, its about the data consumed and generated. The devices are tools, mechanisms, conduits. This paper discusses the considerations when dealing with the...