WebLogic 11g: Preparing Applications and Modules for Deployment

 

Packaging Files for Deployment

Using Archived Files

* Packaged with jar utility with different types of file extensions:
– EJBs and client archives: .jar
– Web app: .war
– Resource adapter: .rar
– Enterprise app: .ear
– Web services: .war or .jar (Java or EJB) then .ear
– Java EE libraries: .ear or standard JEE mdoule
– Client applications and optional packages: .jar
* Deployment plan

Using Exploded Archive Directories

* Use exploded archive directories when you want to do:
– partial updates of modules.
– periodical update of static files.
– system I/O on the archive files.

Deploy without Deployment Descriptors

* If no WEB-INF/web.xml, then directory name should have .war suffix.
* If no META-INF/application.xml, then
– directory name should have .ear suffix.
– modules are deployed in the order of File.listFiles() method.

Default Deployment Name

* myear.ear -> myear
* Exploded directory -> directory name

Install Root Directory

* Example:

mkdir c:\deployments\production
mkdir c:\deployments\production\myApplication
mkdir c:\deployments\production\myApplication\91Beta
mkdir c:\deployments\production\myApplication\91Beta\app
mkdir c:\deployments\production\myApplication\91Beta\plan
# Other plan files
mkdir c:\deployments\production\myApplication\91Beta\plan1
mkdir c:\deployments\production\myApplication\91Beta\plan2
cp c:\downloads\myApplication.ear c:\deployments\production\myApplication\91Beta\app
# or exploded form
cp -r c:\downloads\myApplication c:\deployments\production\myApplication\91Beta\app
# Default plan
cp c:\downloads\myApplicationPlans\plan.xml c:\deployments\production\myApplication\91Beta\plan
# If not default plan directory, then must specify plan1 or plan2 directory in config.xml
cp c:\downloads\myApplicationPlans\plan1.xml c:\deployments\production\myApplication\91Beta\plan1
cp c:\downloads\myApplicationPlans\plan2.xml c:\deployments\production\myApplication\91Beta\plan2

FastSwap Deployment

* JEE 5 introduced dynamic class redefinition:
– redefine classes at run time without disturbing running applications.
– requires shape of class remains identical.
* WebLogic FastSwap removes the restriction of identical class shape.

FastSwap restrictions

* Available in Dev mode only.
* Supports following in exploded directories only (not archives):
– POJOs (jars)
– wars
– ears
* See here for more details.

To Enable

* Add to weblogic-application.xml (enterprise app) or weblogic.xml (web app) file:

<fast-swap>
	<enabled>true</enabled>
</fast-swap>

Ant Task

  <taskdef name='fast-swap'  classname='com.bea.wls.redef.ant.FastSwapTask'/>
  <target name='all'>
    <!--
      Redefine classes which have changed since they were last loaded.
      Required parameters:
       adminUrl: Connection url
           user: User name
       password: User password
         server: Managed server name
      application: Deployed application name
      Optional parameters:
          module: Name of the module within the application.
                  If not specified, all modules within the application
                  will be processed.
       failonerror: Default=true. If true, task will fail if fast-swap failed.
                  Otherwise, a message will be displayed and the task will
                    return success.
         timeout: Default=300. Timeout in seconds.
      classnames: Comma separated list of classnames to process. If not
                  specified, all classes within specified modules (if any)
                    in the application will be considered.
    -->
    <fast-swap
      adminUrl='t3://localhost:7001'
      user='weblogic'
      password='weblogic'
      server='myserver'
      application='SimpleApp'
      module='SimpleAppCookie'
      failonerror='false'
      timeout='30'
      classnames='examples.servlets.CookieCounter1,
                  examples.servlets.CookieCounter2,
                    examples.servlets.CookieCounter'
    />
  </target>

[mv_include id=”3569″]
* Preparing Applications and Modules for Deployment

This entry was posted in weblogic11g. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

This site uses Akismet to reduce spam. Learn how your comment data is processed.