Deploying Applications to WebLogic Server

Under normal circumstances, Workshop builds your files automatically and you can deploy at any time. Before you can deploy your application, you must have a successful build completed.

The following topic explains the basic concepts of deploying and debugging Workshop applications to WebLogic Server running in development mode.

Development Mode

Weblogic Server can be started in one of two modes: development or production mode. (When you start the Workshop server domain using the startup script provided, it runs in development mode.) In development mode, WebLogic Server behaves in ways that make it easier to iteratively develop and test an application: for example, it automatically deploys the current application in an exploded format and certain security restrictions on deployment are relaxed.

What Happens During Deployment

Deployment consists of three steps:

  1. Assembling (e.g., EJB generation and JWS compilation) if required.
  2. Publishing the files to the server.
  3. Running the application.

These three steps are normally done seamlessly. An EAR file is not generated for deployment to a single test server. The table below shows how different applications and application components are deployed both for development and for production.

Development Aim: Implementation: Deployment by Workshop:
  in Workshop IDE for Iterative Test/Debug (Local WebLogic Server) for Production Deployment (WebLogic Production Server)
Enterprise Application EAR project exploded EAR (split source) .EAR file
Web Artifacts (JSPs, web services, web applications) Dynamic web project or web service project exploded .WAR (split source) .WAR file
Shared code Utility project virtual JAR mapped into WEB-INF/lib or APP-INF/lib JAR copied into WEB-INF/lib or APP-INF/lib
Enterprise JavaBean EJB project J2EE EJB module J2EE EJB module
External objects available to projects build path class path class path
J2EE libraries (also called shared J2EE libraries) JARs available on build path virtual merge of libraries with web modules that use them virtual merge of libraries with web modules that use them

What Gets Deployed

When you deploy, all open projects associated with the server are deployed. You can use the Project > Close Project command to close projects. You can also specify working sets (described in the Eclipse help system in the Workbench User Guide) to control how much gets built and deployed.

However, even though an entire application or group of projects was deployed, only the file/folder that you clicked on (to initiate the deploy) will display its results. For example, if you deploy from a page flow component file, that page flow will run in a new browser tab in the editor area. If you deploy a web service, the test client page for that web service will run in a new tab in the editor area. If the page flow or web service relies on other web services to run correctly, it will still work because all components are actually deployed.

You can also manage the projects that get deployed to the server.

Deploying your Application

There are two commands that deploy your application:

  1. Click Run As > Run on Server to deploy your application. This command starts the server in normal mode (if it is not already started), does pre-assembly, and runs the application.
  2. Click Debug As > Debug on Server to deploy your application in debug mode. This command starts the server in debug mode (if it is not already started), does pre-assembly, and runs the application.

If you wish to simply publish your files to the server, you can use the Servers view (described below) to publish only. The Servers view also allows you to un-deploy applications from the server.

Viewing the Results of Deployment

After you deploy your application, the Servers view is displayed automatically and the results of running your application are displayed in the editor area of the workbench.

If you are running a page flow, the initial JSP page will appear in a tab in the editor area. This tab is a test browser that allows you to run your application.

If you are running a web service, the test client appears in a tab in the editor area. This tab allows you to specify the parameters to an operation and make a request to that operation. The response from the operation is displayed in the same tab.

Deploying Applications and Managing Servers with Servers View

The Servers view opens automatically when you deploy/run your application. You can also open it manually by clicking Window > Show View > Other, expand Server and click Servers. There are many commands available from the Servers view for managing your server(s), as shown in the diagram below.

Deployment to WebLogic Server in Production Mode

The following procedure explains how to deploy Workshop applications to WebLogic Server running in production mode. This task is divided into three steps:

  1. To Ensure that Required Resources Exist on the Production Server
  2. To Compile the Application into an EAR File
  3. To Deploy the EAR File to the Production Server

1. To Ensure that Required Resources Exist on the Production Server

Before you deploy a Workshop application to WebLogic Server, you must first ensure that the server domain has the resources expected by the application to be deployed. For example, NetUI and Controls framework-related libraries must be present if the application uses these frameworks and the server must have the appropriate JMS queues configured if the application contains message buffering, reliable messaging, and JMS transport.

General purpose server resources for Workshop applications are provided through the WebLogic Server Configuration Wizard, including support for NetUI and Controls, JMS, Pointbase, Java Server Pages, Java Server Faces, and Struts. See the instructions for creating a new Workshop-enabled server or adding Workshop resources to an existing server.

The configuration wizard is not guaranteed to provide sufficient resources for every application. For example, if your application uses JMS queues other than the default Workshop queues, you will need to manually configure the server to included those non-default JMS queues. For detailed instructions on configuring JMS queues for WebLogic Server see Configuring Basic JMS System Resources in the WebLogic Server documentation. Similarly, if your application uses a datasource other than the default Pointbase datasource, you will need to manually configure the server domain to include that datasource. For more information on configuring datasources see Configuring a Database Service in the WebLogic Server documentation.

2. To Compile the Application into an EAR File

To package your application as an EAR file, select File > Export > EAR file. In the EAR Application field select the name of the EAR project you wish to archive. The EAR archive produced will contain all of the projects that are already components of the selected EAR.

You can also export the build process for projects to an Ant script. For more information see Creating Custom Ant Build Files for an Application.

3. To Deploy the EAR File to the Production Server

Open the WebLogic Server console for the target server running in production mode.

  1. On the left-hand side Change Center pane, click Lock & Edit.
  2. On the left-hand side Domain Structure pane, click Deployments.
  3. On the right-hand content pane, click Install.
    Browse to the directory where the EAR file resides, mark the radio button next to the EAR file you want to deploy, and click Next.
  4. Confirm that the radio button next to Install this deployment as an application is marked and click Next.
  5. Click Finish.
  6. On the left-hand side Change Center pane, click Activate Changes.
  7. On the right-hand content pane, mark the radio button next to the EAR just deployed.
  8. Click Start to view the dropdown list and select Servicing all requests.
  9. In the content pane of the new page, click Yes.

If you click the plus sign in front of the deployed EAR, a list of the application's deployed modules (EJBs and web applications) will appear.

For more information about deploying an application to a server in production mode, see Deploying Applications on WebLogic Server 10.0 in the WebLogic Server documentation.

For information on updating an already deployed application, see Updating Applications in a Production Environment in the WebLogic Server documentation.


Still need help? Post a question on the Workshop newsgroup.