Oracle® Enterprise Pack for Eclipse User's Guide
Release 12.1.2.4
E50456-03
  Go To Table Of Contents
Contents

Previous
Previous
 
Next
Next
 

4 Oracle WebLogic Server Support

Oracle WebLogic Server Tools is a set of plugins for the Eclipse IDE designed to help develop, deploy, and debug applications for Oracle WebLogic Server.

This document contains the following sections:

4.1 Feature Overview

The information in this section describes how to use WebLogic Server with the Eclipse IDE.

The following versions of Oracle WebLogic Server are supported:

4.2 WebLogic Shared Libraries

A WebLogic Shared Library is an Enterprise Application Archive, a stand-alone EJB, a Web Application module, or a JAR file that is registered with Oracle WebLogic Server as a shared library. The library resources can be shared between multiple applications, alleviating the need to have duplicate copies of the resources in each application. For an overview of WebLogic Shared Libraries, see "Deploying Shared Java EE Libraries and Dependent Applications" in Deploying Applications to Oracle WebLogic Server.

WebLogic shared libraries provide an easy way to share one or more types of Java EE modules among multiple applications.

A shared library can be one of the following:

After the library has been registered, you can deploy multiple applications that reference the library. Each referencing application can use the library as if it were packaged as part of the referencing application itself. The shared library classes are added to the classpath of the referencing application, and the referencing application's deployment descriptors are merged (in memory) with those of the library.

A registry of shared libraries can be viewed and edited using the workspace Preference page at Window > Preferences > WebLogic > Shared Libraries. At run time, the registry is described in the domain's config.xml file.

These are terms used when working with WebLogic Shared Libraries:

Library reference: WebLogic Shared Libraries are referenced indirectly by specifying the name of the library, the specification version (optional), the implementation version (optional) and whether a newer version of the library should be used if present. The library references are used on the project classpath and in the deployment descriptors (weblogic-application.xml and weblogic.xml). Library references are resolved against the libraries registry when necessary.

Libraries registry (or registry): The list of known WebLogic Shared Libraries which is used to resolve a library reference.

4.2.1 Common Operations

This section describes the following common operations associated with WebLogic shared libraries.

4.2.1.1 Adding a New Library to the Registry

You can add new libraries to the registry.

To add a new library to the registry:

  1. From the top-level menu, select Window > Preferences.

  2. Find the WebLogic node in the tree on the left-hand-side of the dialog.

  3. Select WebLogic > Shared Libraries from the list of preferences on the left.

  4. Click Add.

  5. Click Browse to select the library location.

  6. Find the library archive where it is located on the disk, and select the library.

  7. Verify the information presented in the Attributes section of the Add WebLogic Shared Library dialog. You can modify the library name, the specification version, and implementation version by using the Attributes table as long as they are not specified in the library's manifest.mf file.

  8. Click OK.

4.2.1.2 Adding a Library Reference to the Project Classpath

You can add a library reference to the project classpath.

To add a library reference to the project classpath:

  1. Right-click on the project in the Project Explorer view and select Properties from the drop-down menu.This will open the Properties dialog.

  2. In the Properties dialog, select the Java Build Path from the list of properties.

  3. In the Java Build Path part of the dialog, select the Libraries tab.

  4. Click Add Library.

  5. Select WebLogic Shared Library, and then click Next.

  6. Click Browse, and choose the library that you want to reference.

  7. Modify the reference information, if necessary.

  8. Click Finish.

4.2.1.3 Modifying a Library Reference on the Project Classpath

You can modify library references.

To modify a library reference on the project classpath:

  1. Select the project in the Project Explorer view.

  2. Choose Project > Project Properties.

  3. Locate the Java Build Path node in the tree on the left-hand-side of the dialog and select it.

  4. Open the Libraries tab.

  5. Find the entry in the list of libraries called Shared Library library-name and select it.

  6. Click Edit.

  7. Review the library reference. If any changes are necessary, make the changes and click Finish.

4.2.1.4 Removing a Library Reference from the Project Classpath

You can remove library references.

To remove a library reference from the project classpath:

  1. On the Properties dialog, select the Java Build Path from the list of properties.

  2. On the Java Build Path part of the dialog, select the Libraries tab.

  3. Find the entry in the list of libraries called Shared Library library-name, and then select it.

  4. Click Remove.

4.2.2 Validation Problems

This section lists error and warning messages that may appear in the Problems view. Resolutions are provided for each error/warning message.

4.2.2.1 Validation Errors

  • Unable to resolve library reference on project classpath

  • Unable to resolve library reference in the deployment descriptor

  • Library on classpath but not in weblogic-application.xml

  • Library on classpath but not in weblogic.xml

  • Web library referenced by a non-Web project

  • Non-Web library referenced in weblogic.xml

  • Project must be part of an EAR to use this library

  • Project must be part of a web application to use this library

Unable to resolve the reference to "<library-name>" library on project classpath.

Problem: The library reference to a WebLogic Shared Library on the project classpath cannot be resolved using the workspace libraries registry. The project cannot be build.

Resolution 1: Add the appropriate library to the libraries registry. For instructions on how to do this, see Adding a new library to the registry.

Resolution 2: Modify the library reference to match what is present in the registry. For instructions on how to do this, see Modifying a library reference on the project classpath.

Resolution 3: Remove the library from the project classpath. For instructions on how to do this, see Removing a library reference from the project classpath.

Unable to resolve the reference to "<library-name>" library in the deployment descriptor.

Problem: The library reference to a WebLogic Java EE Library in the deployment descriptor (the weblogic.xml or weblogic-application.xml file depending on project type) cannot be resolved using the workspace libraries registry. The project many not run once deployed.

Resolution: Add the appropriate library to the libraries registry. For instructions on how to do this, see Section 4.2.1.1, "Adding a New Library to the Registry."

"<library-name>" library is on the classpath of this project, but is not in the weblogic-application.xml file of the EAR project "<EAR-project-name>".

Problem: The project contains a reference to a WebLogic Shared Library, but the weblogic-application.xml file of the EAR project that this project belongs to does not reference the library. This could lead to problems at run time since Oracle WebLogic Server will not know how to make this library available for use by this module.

Resolution: Remove the library from the project classpath. For instructions on how to do this, see Section 4.2.1.4, "Removing a Library Reference from the Project Classpath."

"<library-name>" library is on the classpath of this project, but is not in the weblogic.xml file.

Problem: The project contains a reference to a WebLogic Shared Library, but the weblogic.xml file does not reference this library. This could lead to problems at run time since Oracle WebLogic Server will not know how to make this library available for use by this module.

Resolution: Remove the library from the project classpath. For instructions on how to do this, see Section 4.2.1.4, "Removing a Library Reference from the Project Classpath."

"<library-name>" library is a web library and cannot be referenced by this project.

Problem: Oracle WebLogic Server only allows classes in a WAR-type WebLogic Shared Library to be visible to Web modules. While an EAR can reference such a library in the weblogic-application.xml, none of the classes in the referenced library will be visible to the classes in the EAR.

Resolution: Remove the library from the project classpath. For instructions on how to do this, see Section 4.2.1.4, "Removing a Library Reference from the Project Classpath."

"<library-name>" library reference is not allowed in the weblogic.xml file. Only WAR libraries are allowed.

Problem: Oracle WebLogic Server only supports WAR libraries to be referenced from the weblogic.xml deployment descriptor. A non-WAR library has been referenced in the descriptor.

Resolution: Remove the library from the weblogic.xml deployment descriptor.

This project must be part of an EAR in order to use "<library-name>" library.

Problem: The library referenced on the classpath of this project can only be accessed at run time if this project is part of an EAR and the EAR's weblogic-application.xml deployment descriptor references this library.

Resolution 1: Remove the library from the project classpath. For instructions on how to do this, see Section 4.2.1.4, "Removing a Library Reference from the Project Classpath."

Resolution 2: Create a new EAR project (or use an existing one). In the EAR project's Properties (right-click the EAR and select Properties) select the page labeled Java EE Module Dependencies. Select the project from the list, and then click Finish to associate the project with the EAR project.

This project must be part of a web application in order to use "<library-name>" library.

Problem: The library referenced on the classpath of this project can only be accessed at run time if this project is part of a Web application, and the Web application's weblogic.xml deployment descriptor references this library.

Resolution 1: Remove the library from the project classpath. For instructions on how to do this, see Section 4.2.1.4, "Removing a Library Reference from the Project Classpath."

Resolution 2: Create a new Dynamic Web project (or use an existing one). In the Web project's Properties (right-click the Web project, and select Properties) select the page labeled Java EE Module Dependencies. Select the Web Libraries tab. Select the project from the list, and then click Finish to associate the project with the Web project.

4.2.2.2 Validation Warnings

This section lists warning messages that may appear in the Problems view. Resolutions are provided for each warning message.

  • Classpath reference differs from weblogic-application.xml

  • Classpath reference differs from weblogic.xml

The reference to the "<library-name>" library on this project's classpath differs from the reference to this library in the weblogic-application.xml file of the EAR project "<EAR-project-name>".

Problem: The library reference on the module project's classpath differs from the library reference in the weblogic-application.xml file of the EAR project that this module project belongs to. This could lead to problems at run time, because the project could be compiled against a different version of the library than what will be used at run time.

Resolution: Modify the library reference on the project classpath so it matches the library reference in the EAR project's weblogic-application.xml file. For instructions on how to do this, see Section 4.2.1.3, "Modifying a Library Reference on the Project Classpath."

The reference to the "<library-name>" library on this project's classpath differs from the reference to this library in the weblogic.xml file.

Problem: The library reference on this project's classpath differs from the library reference in the weblogic.xml file. This could lead to problems at run time, because the project could be compiled against a different version of the library than what will be used at run time.

Resolution: Modify the library reference on the project classpath so it matches the library reference in the weblogic.xml file. For instructions on how to do this, see Section 4.2.1.3, "Modifying a Library Reference on the Project Classpath."

4.3 Support for WebLogic SCA

OEPE provides support for WebLogic SCA container. You use it to populate the Spring context file and bundle as part of any regular Java EE deployment bundles, such as EAR or WAR.


Note:

Prior to using OEPE support for WebLogic SCA in your Eclipse project, you need to configure Oracle WebLogic Server 11g Release 1 (10.3.2) or later at localhost.


4.3.1 Configuring Projects to Use WebLogic SCA

You enable your project for WebLogic SCA by adding a facet provided by OEPE.

To configure a project:

  1. Create a dynamic Web project by right-clicking the Project Explorer and choosing New > Dynamic Web Project. This opens the New Dynamic Web Project dialog:

    • Specify the name for your project.

    • Set the dynamic Web module version.

    • Set the target runtime to Oracle WebLogic Server 11gR1 (10.3.2) or later.

    • Select Add project to an EAR and provide a new EAR name.

    • Click Modify on the Configuration field to open the Project Facets page of the Properties dialog:

      • Ensure that WebLogic Web App Extensions facet is selected.

      • Select Spring facet with version 2.0 or later.

      • Select WebLogic SCA facet, and then click OK to close the Project Facets dialog.

  2. Click Next on the New Dynamic Web Project dialog.

  3. You may accept or modify default settings on the next New Dynamic Web Project > Web Module screen, and then click Next. This opens the New Dynamic Web Project > Spring screen.

  4. If you do not see Spring Framework 2.5.6 listed, click Download Library. On the Download Library dialog, select Spring Framework 2.5.6 library provided by Oracle, and then click Next. Accept the terms of the Apache License, and then click Finish.


    Note:

    If your machine is located inside of a network which requires a proxy to access outside resource such as the Internet, the download may fail due to the fact that Eclipse IDE includes a Web browser to let you access the Internet from within the IDE. In this case, reconfigure your Eclipse IDE proxy settings using Window > Preferences > General > Network Connections, and try again.


  5. Upon the completion of the Spring library download, make sure the Spring Framework 2.5.6 library is selected on the New Dynamic Web Project > Spring dialog. You may choose to select Create a Spring bean definitions file to generated the applicationContext.xml file and trigger the update of web.xml file to load the Spring bean configuration file, and then click Next.

  6. Click Finish on the New Dynamic Web Project > WebLogic SCA screen that to complete your configuration.

Upon the completion of the configuration, OEPE adds WebLogic SCA shared library and Spring library to your project, as well as creates the spring-context.xml file in your project's META-INF/jsca directory.

You can open the spring-context.xml file either in source view by double-clicking the file name in the Project Explorer, or in graphical view by right-clicking the file name and selecting Open Graph from the drop-down menu.

You use the spring-context.xml file to define new beans, specify services, bindings, and so on. OEPE provides templates to facilitate these definitions. For more information, see Section 4.3.3, "Creating Complex Properties Using XML Template."

4.3.2 Using Context Help for WebLogic SCA XML Attributes

OEPE provides context help for each SCA XML element and attribute. To access help topics, hover the mouse over elements in the XML editor.

4.3.3 Creating Complex Properties Using XML Template

OEPE provides a set of XML templates that you can use to populate a predefined group of XML elements. This facilitates creating of complex properties in binding specification, such as, for example, the PolicyReference.

To invoke an XML template, you type the name of the template (for example, "SCA"), and then press CTRL+Space.

You can use the following XML templates for creating WebLogic SCA definitions:

  • SCA service with Web services binding

  • SCA service with EJB binding

  • SCA reference with Web services binding

  • SCA reference with EJB binding

Inside of WebLogic SCA Service with Web services binding, you can invoke the PolicyReference template to further customize the binding security setting, as follows:

  • PolicyReference: Username token with message protection: WSS 1.0 X509 with asymmetric binding.

  • PolicyReference: Username token with message protection: WSS 1.1 symmetric binding and authentication with plain-text Username Token which is encrypted and signed using the Symmetric key.

  • PolicyReference: X509 certificate authentication with message protection (WSS 11).

  • PolicyReference: Anonymous with message protection (WSS 11).

  • PolicyReference: ID Propagation using SAML token [sender-vouches] with message protection (WSS 11).

  • PolicyReference: Username token over SSL.

  • PolicyReference: SAML token (Sender Vouches) over SSL.

Applicable to both WebLogic SCA Service and SCA Reference, the Property template is also available to further customize the binding security setting, as follows:

  • Property: SDO schema file location.

  • Property: External customization file.

  • Property: WSDL cache timeout. Note that this Property (weblogic.sca.binding.ws.referenceWsdlCacheTimeoutMins) applies to references only.

  • Property: Enable using Owsm policies.

4.3.4 Creating WebLogic SCA Data-Binding Customization Descriptor

With OEPE, you can create WebLogic SCA data-binding customization descriptor for which the schema file is bundled. This descriptor defines the external mapping metadata for the data-binding framework. The data is used to define the attributes of a particular Java Web service endpoint interface. Each change that you make to the XML will be validated against the schema.

To create a WebLogic SCA data-binding customization descriptor:

  1. In the Project Explorer, right-click a Java directory in within your Web project and select New > Other from the drop-down menu to open the Select a wizard dialog.

  2. From the list of available wizards, select WebLogic Configuration Files > WebLogic SCA Databinding Customization Descriptor, and then click Next.

  3. In the New WebLogic SCA Databinding Customization Descriptor dialog, provide the name for the descriptor, specify the Java type by completing the Select Java Type, then click Finish.

    The databinding_cust.xml file is added to your project.

4.3.5 Deploying a WebLogic SCA Application

You use Oracle WebLogic Server 11g Release 1 (10.3.2) or later to deploy your dynamic Web project configured for WebLogic SCA.

To deploy the dynamic Web project:

  1. Start an instance of Oracle WebLogic Server 11g Release 1 (10.3.2) or later at localhost.

  2. Open the server configuration (Overview) page by double-clicking on the server name in the Servers view. Ensure that the information is correct. Notice that the domain area does not contain your project's name.

  3. Add your configured project's EAR to the server. To do so, right-click Oracle WebLogic Server 12c (12.1.1) at localhost in Servers view, select Add and Remove Projects from the drop-down menu, find your the EAR in the list of projects, and then click Add followed by Finish on the Add and Remove Projects dialog.

Now the server configuration page displays the project and its EAR under the base_domain.

The server console displays the deployment logging information.

4.3.6 Running a WebLogic SCA Application

After deploying the application, you can run it.

To run the application:

  • In the Project Explorer, right-click a sca:service node listed under beans in the spring-context.xml file and choose Run As > Run On Server.

Upon completion of the Run On Server dialogs, a WSDL file, which you can use with other OEPE features, is created by the WebLogic SCA deployment process and loaded in a browser.

4.4 Support for WebLogic Scripting Tool (WLST)

WLST is a scripting tool for monitoring, managing, and configuring Oracle WebLogic Server from the command line. WLST is based on Jython programming language with WebLogic WLST libraries. The execution can happen in the following three modes: scripting, interactive, and embedded. WLST can be enabled for online and offline connection modes and can act as a JMX client.

OEPE provides tooling for WLST that enable editing, executing, debugging, WebLogic MBean access and navigation, as well as a built-in help for WLST commands.

4.5 Using WebLogic Scripting Tool (WLST)

This section describes how to use WLST.

4.5.1 Configuring Projects for WLST

Using OEPE, you can add WLST facet to your Java projects that run on Oracle WebLogic Server. Note that Utility projects are most suitable for this functionality.

To configure your project for WLST:

  1. Either add the WLST facet when you create a faceted project, or add the facet to an existing project by right-clicking your project in the Project Explorer and selecting Properties from the drop-down menu. This opens the Properties dialog.

  2. In the Properties dialog, select Project Facets on the left panel, and then select WLST from the Project Facet list.

  3. Optionally, click Further configuration available to open the Configure WebLogic Scripting Tools dialog. This dialog allows you to configure WLST script source path and targeted runtime. When you have finished, click OK.

  4. To complete adding WLST support to your project click Apply > OK on the Properties dialog.

4.5.2 Creating New WLST Files

You can create a new WLST script as follows:

  1. In the Project Explorer, right-click your WLST-enabled project and select New > Other from the drop-down menu.

  2. On the New dialog, select WebLogic > WLST Script and then click Next to open the WLST Script dialog.

  3. Specify the location for the new WLST file.

  4. To specify the template to use, click Browse browse to open the TemplateName dialog, where you can choose one of the standard templates such as a default one, or specify a custom template of a module scope that you defined yourself. For more information, see Section 4.5.4, "Adding WLST Templates."Click OK.

  5. In the WLST dialog click Finish.

A new WLST script file is created in the specified location. You can execute this file, as well as edit it using either the source editor, or a WLST file editor provided by OEPE. For more information, see Section 4.5.7, "Executing WLST" and Section 4.5.3, "Editing WLST Script."

4.5.3 Editing WLST Script

OEPE provides an editor for WLST files. The editor features the following:

  • Syntax highlighting.

  • Code completion for Jython and WLST built-in functions.

  • WLST Help view that includes detailed WLST command reference materials.

To edit a WLST script:

  • In the Project Explorer, double-click the WLST file. It opens in the editor.

4.5.4 Adding WLST Templates

OEPE provides templates that you can use to create WLST files.

To add a new WLST template:

  1. Select Window > Preferences from the top-level menu to open the Preferences dialog.

  2. On the Preferences dialog expand the Pydev > Editor node, and then select Templates to open the list of available templates.

  3. Click New on the Preferences > Templates screen to open the New Template dialog.

  4. Enter the following information about your new template:

    • The template's name.

    • The template's scope: editor or module. If you select the module scope, your new template will appear in the selection list of templates when you create a new WLST script.

    • A brief description.

    • A pattern on which to base the template. You can define a custom pattern, or select one from the list of predefined patterns by clicking Insert Variable.

  5. Click OK to close the completed New Template dialog.

    Notice that your new template is now listed in the Preferences > Templates dialog.

  6. Click Apply > OK on the Preferences > Templates dialog.

4.5.5 Navigating MBean Structures

When writing WLST script, you often need to navigate WebLogic runtime MBean structures. OEPE enables you to view the MBean hierarchy in the Servers pane.

To add or generate WLST code from MBean Hierarchy:

  1. Open your WSLT file.

  2. Click the Servers tab to open the Servers pane.

  3. Start WLS by choosing Start from the context menu.

  4. In the Servers view, expand the MBean Hierarchy node.

  5. Right-click any child node and select Generate WSLT Code from the context menu.


    Note:

    This menu item is enabled only when the WSLT file is in focus.


4.5.6 Using WLST Console

You can launch WLST in interactive mode in the Console view. This allows you to manage the Oracle WebLogic Server life cycle, monitor the server status, and prototype WLST script using WLST commands in the command line.

You use WLST console, activate the Console tab, and then select WLST > Oracle WebLogic Server Version from the tab menu.

To interact with the server, type WLST commands, for example help().

To stop WLST, click Terminate on the Console menu.

4.5.7 Executing WLST

To execute the WLST script, right-click the file in the Project Explorer, and select Run As > WLST Run.

WLST will be launched and the output displayed on the Console view.

4.5.8 Debugging WLST Script

To debug the WLST script, right-click the file in the Project Explorer, and then select Debug As > WLST Run.

WLST debugger will start and the output will be displayed on the Console view.

The Pydev debugger allows you to do the following:

  • Set break point in the WLST source file.

  • Step over.

  • Examine variables using the Variables view.


Note:

The WLST script is executed with Jython interpreter in debug mode, as opposed to the weblogic.WLST interpreter.


4.5.9 Importing Existing WLST Script into OEPE

If you import wlstModule into default name space using the from wlstModule import * statement, the global object cmo will not be available in this mode. You can work around this condition by either importing wlstModule with its own namespace:

import wlstModule as wl

or by creating a local cmo object from the return of cd() statement:

cmo=cd( MBEAN_PATH )

When importing existing WLST scripts into OEPE, be aware of the fact that Eclipse may flag WLST commands with "undefined variable" error.

To work around this problem, add following conditional import statement in the beginning of the file:

if __name__ == '__main__':
       from wlstModule import *

This statement is intended to help the builder to locate the WLST command. The wlstModule will be imported only when the script is executed with Jython interpreter.

4.5.10 Known Issues and Limitations

If you use WebLogic Server 9.2 on Windows Vista or Windows 7 operating system, you should avoid using Jython variable os.environ in your WLST script. Instead, you have to manually change the value of BEA_HOME and WL_HOME variables in the generated WLST script.

4.6 Editing Deployment Descriptors

OEPE provides a graphical design view that you can use to edit Oracle WebLogic Server-specific deployment descriptors in the form of weblogic.xml, weblogic-application.xml, weblogic-ejb-jar.xml, and NN-jms.xml files.

4.6.1 Using Deployment Descriptor Editors

To open your deployment descriptor files in the editor, either double-click on the file name, or right-click the file and select one of the following from the drop-down menu:

  • Open With > WebLogic Web Module Deployment Descriptor Editor to open weblogic.xml.

  • Open With > WebLogic Application Deployment Descriptor Editor to open weblogic-application.xml.

  • Open With > WebLogic Application Client Deployment Descriptor Editor to open weblogic-application-client.xml.

  • Open With > WebLogic EJB Jar Editor to open weblogic-ejb-jar.xml.

  • Open With > WebLogic JDBC Configuration Editor to open weblogic-jdbc.xml.

  • Open With > JMS Descriptor Editor to open NN-jms.xml.

You can specify values, as well as enable or disable various descriptor elements by making selections on the Outline pane, and then modifying values on the right side of the editor. To obtain information about fields and possible settings for each of them, consult the online help by moving the focus to the subject field, and then pressing F1.


Note:

The setting in the Server version field in the General section of the editor is particularly important to the rest of the editor: some functionality in the editor may be enabled or disabled depending on which Oracle WebLogic Server version you specify, so you must be accurate in setting your target environment.


The descriptor editor has the following features:

  • Every field is enabled for online help, which you can access by moving the focus to the subject field and pressing F1.

  • There is a field-level validation on every field.

  • Clicking on a linked field name takes you to the element or object (such as a class, for example) that is entered in this field.

  • You can restore default settings by clicking the Restore Defaults button located at the top right corner of the editor.

  • Table cells are equipped with a cell editor: when working with tables in the editor, double-clicking on a cell activates a cell editor. Some cells have a browse button when the cell is in the edit mode.

  • A limited keyboard navigation is enabled on the editor.

4.6.1.1 Editor Keyboard Navigation

The deployment descriptor editors allow you to use the following keys or key combinations to perform some of the operations that can also be done through mouse actions.

Tab Navigates through editor fields.

Arrow Keys Navigate through the content outline and tables.

ESC Closes many of the dialogs opened by the editor, including the property editor assistance popup.

Enter Selects items in combo boxes and deactivates cell editors in tables.

Ctrl+L Opens the Browse dialog when focus is on a browsable field.

Ctrl+I Opens the property editor assistance popup.

Ctrl+J Jumps to the entity referenced by the value contained in the current field. The value can be a class name, a file path, etc.

Ctrl+Up Moves the selected entity towards the head of the list by one position.

Ctrl+Down Moves the selected entity towards the tail of the list by one position.

4.6.2 Creating JMS Descriptors

You can create a JMS descriptor for Oracle WebLogic Server by following this procedure:

  1. Ensure that the EAR project to which you are planning to add a JMS descriptor has a WebLogic EAR Extensions facet enabled. If the facet is disabled, enable it as follows:

    1. Right-click the project in the Project Explorer.

    2. Select Properties from the drop-down menu.

    3. Select Project Facets from the list of properties.

    4. Select WebLogic EAR Extensions.

    5. Click Apply and OK to finalize your configuration.

  2. In the Project Explorer, right-click your EAR project and select New > Other from the drop-down menu. On the New dialog, select WebLogic Descriptors > WebLogic JMS Descriptor, and then click Next. This will open the New WebLogic JMS Descriptor > File Name and Location dialog.

  3. On the New WebLogic JMS Descriptor > File Name and Location dialog, set the following:

    • select the parent folder for your descriptor;

    • make an appropriate selection in the Register a corresponding JMS module in weblogic-application.xml field: if you enable this option, the following code will be added to your project's weblogic-application.xml source file:

      <wls:module>
          <wls:name>module-jms</wls:name>
          <wls:type>JMS</wls:type>
          <wls:path>../module-jms.xml</wls:path>
      </wls:module>
      
  4. Click Finish.

Upon completion, your new JMS descriptor opens in the appropriate editor view.

4.7 Using Deployment Plan Editor

Using a deployment plan, you can optionally define or override Oracle WebLogic Server tuning parameters to optimize the use of resources in the target environment.

4.7.1 Creating a New Deployment Plan

Using OEPE, you can create a new deployment plan by following this procedure:

  1. Open the Java EE perspective by selecting Window > Open Perspective > Other > Java EE from the Eclipse IDE main menu.

  2. Right-click the Project Explorer and select New > Other from the drop-down menu. On the New dialog, select WebLogic Descriptors > WebLogic Deployment Plan, and then click Next. This opens the File Name and Location dialog.

  3. On the File Name and Location dialog, select the parent folder and provide the name for your deployment plan, and then click Next.

  4. On the next Target Application and Options screen, select the target application, target Oracle WebLogic Server runtime, optionally specify whether or not to invoke weblogic.PlanGenerator to generate default variable definitions, and then click Finish.

    For more information about weblogic.PlanGenerator, see "weblogic.PlanGenerator Command Line Reference" in Deploying Applications to Oracle WebLogic Server.

Upon the completion, the New WebLogic Deployment Plan wizard opens the deployment plan in the deployment plan editor for further modifications.

4.7.2 Editing a Deployment Plan

OEPE provides a graphical design view that you can use to edit your WebLogic deployment plan.

The editor consists of the following parts:

  • A tree control on the left.

  • An edit page on the right - when you select a node in the tree, the editor will display an appropriate edit page.

The tree control is represented by the following main nodes:

  • General - lets you modify the application name, server and deployment plan versions, the external configuration root, and provide the deployment plan description.

  • Variable Definitions - lets you define new variables. To create a new variable, select the Variable Definitions node, and then click + (Add) on the edit page to expand the area

  • Modules - lets you specify existing or add new modules by clicking Add a module override.

Click Browse next to the Module Name field to open the Module Name dialog. Select an existing module or add a module override to the deployment plan.

To add a deployment descriptor, click Add a descriptor on the Modules editor page.

Specify the descriptor URI by clicking Browse next to the URI field on the Descriptor editor page. This will display the Select the URI of the descriptor dialog,.

Using the Select the URI of the descriptor dialog, select the weblogic.xml file, and then click OK.

To add a new variable assignment, click + (Add) on the Variable Assignments > Specify the XPath area.

Use the XPath Expression Builder dialog to navigate the element that you want to override in the descriptor, and then click OK to select the XPath.

Click Browse next to the Variable name field to display the Variable Name dialog and select the variable name to assign.

Select the Replace operation on the Variable Assignments edit page.

Use the Clean Up Deployment Plan utility to remove unassigned variables from your plan's XML file. To do so, click the Clean Up button represented by a green check mark icon located in the top right corner of the editor. Make your selection from the list of the potential clean up candidates, and then click Finish to remove these elements from your deployment plan.

You can also switch to the source view of your WebLogic deployment plan to edit it manually.

4.7.3 Using an Existing Deployment Plan to Configure an Application

You can use an existing deployment plan from the command line, or from the IDE.

To use a generated deployment plan from the command line use the following syntax in a prompt:

java weblogic.Deployer -adminurl t3://localhost:7001 -username weblogic -password weblogic7001 -plan plan.xml -deploy MyNewWSProjectEAR.ear

To deploy your application from the IDE to WebLogic either locally or remotely, go to Server Properties > WLS, expand WebLogic Publishing and choose Advanced.