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
    Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science," is responsible for setting the strategy and defining the Big Data service offerings and capabilities for EMC Global Services Big Data Practice. As the CTO for the Big Data Practice, he is responsible for working with organizations to help them identify where and how to start their big data journeys. He's written several white papers, is an avid blogge...
    Nicolas Fierro is CEO of MIMIR Blockchain Solutions. He is a programmer, technologist, and operations dev who has worked with Ethereum and blockchain since 2014. His knowledge in blockchain dates to when he performed dev ops services to the Ethereum Foundation as one the privileged few developers to work with the original core team in Switzerland.
    René Bostic is the Technical VP of the IBM Cloud Unit in North America. Enjoying her career with IBM during the modern millennial technological era, she is an expert in cloud computing, DevOps and emerging cloud technologies such as Blockchain. Her strengths and core competencies include a proven record of accomplishments in consensus building at all levels to assess, plan, and implement enterprise and cloud computing solutions. René is a member of the Society of Women Engineers (SWE) and a m...
    Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settlement products to hedge funds and investment banks. After, he co-founded a revenue cycle management company where he learned about Bitcoin and eventually Ethereal. Andrew's role at ConsenSys Enterprise is a mul...
    In his general session at 19th Cloud Expo, Manish Dixit, VP of Product and Engineering at Dice, discussed how Dice leverages data insights and tools to help both tech professionals and recruiters better understand how skills relate to each other and which skills are in high demand using interactive visualizations and salary indicator tools to maximize earning potential. Manish Dixit is VP of Product and Engineering at Dice. As the leader of the Product, Engineering and Data Sciences team at D...
    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...
    Whenever a new technology hits the high points of hype, everyone starts talking about it like it will solve all their business problems. Blockchain is one of those technologies. According to Gartner's latest report on the hype cycle of emerging technologies, blockchain has just passed the peak of their hype cycle curve. If you read the news articles about it, one would think it has taken over the technology world. No disruptive technology is without its challenges and potential impediments t...
    If a machine can invent, does this mean the end of the patent system as we know it? The patent system, both in the US and Europe, allows companies to protect their inventions and helps foster innovation. However, Artificial Intelligence (AI) could be set to disrupt the patent system as we know it. This talk will examine how AI may change the patent landscape in the years to come. Furthermore, ways in which companies can best protect their AI related inventions will be examined from both a US and...
    Bill Schmarzo, Tech Chair of "Big Data | Analytics" of upcoming CloudEXPO | DXWorldEXPO New York (November 12-13, 2018, New York City) today announced the outline and schedule of the track. "The track has been designed in experience/degree order," said Schmarzo. "So, that folks who attend the entire track can leave the conference with some of the skills necessary to get their work done when they get back to their offices. It actually ties back to some work that I'm doing at the University of San...
    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...