{"id":3574,"date":"2011-10-17T09:06:22","date_gmt":"2011-10-17T14:06:22","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=3574"},"modified":"2011-10-17T09:06:22","modified_gmt":"2011-10-17T14:06:22","slug":"weblogic-11g-preparing-applications-and-modules-for-deployment","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=3574","title":{"rendered":"WebLogic 11g: Preparing Applications and Modules for Deployment"},"content":{"rendered":"<div class='toc wptoc'>\n<h2>Contents<\/h2>\n<ol class='toc-odd level-1'>\n\t<li>\n\t\t<a href=\"#Packaging_Files_for_Deployment\">Packaging Files for Deployment<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Using_Archived_Files\">Using Archived Files<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Using_Exploded_Archive_Directories\">Using Exploded Archive Directories<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Deploy_without_Deployment_Descriptors\">Deploy without Deployment Descriptors<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Default_Deployment_Name\">Default Deployment Name<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Install_Root_Directory\">Install Root Directory<\/a>\n\t\t\t<\/li>\n\t\t<\/ol>\n\t<li>\n\t\t<a href=\"#FastSwap_Deployment\">FastSwap Deployment<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#FastSwap_restrictions\">FastSwap restrictions<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#To_Enable\">To Enable<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Ant_Task\">Ant Task<\/a>\n\t\t\t<\/li>\n<\/ol>\n<\/ol>\n<\/ol>\n<\/div>\n<div class='wptoc-end'>&nbsp;<\/div>\n<span id=\"Packaging_Files_for_Deployment\"><h2>Packaging Files for Deployment<\/h2><\/span>\n<span id=\"Using_Archived_Files\"><h3>Using Archived Files<\/h3><\/span>\n<p>* Packaged with jar utility with different types of file extensions:<br \/>\n&#8211; EJBs and client archives: .jar<br \/>\n&#8211; Web app: .war<br \/>\n&#8211; Resource adapter: .rar<br \/>\n&#8211; Enterprise app: .ear<br \/>\n&#8211; Web services: .war or .jar (Java or EJB) then .ear<br \/>\n&#8211; Java EE libraries: .ear or standard JEE mdoule<br \/>\n&#8211; Client applications and optional packages: .jar<br \/>\n* Deployment plan<\/p>\n<span id=\"Using_Exploded_Archive_Directories\"><h3>Using Exploded Archive Directories<\/h3><\/span>\n<p>* Use exploded archive directories when you want to do:<br \/>\n&#8211; partial updates of modules.<br \/>\n&#8211; periodical update of static files.<br \/>\n&#8211; system I\/O on the archive files.<\/p>\n<span id=\"Deploy_without_Deployment_Descriptors\"><h3>Deploy without Deployment Descriptors<\/h3><\/span>\n<p>* If no WEB-INF\/web.xml, then directory name should have .war suffix.<br \/>\n* If no META-INF\/application.xml, then<br \/>\n&#8211; directory name should have .ear suffix.<br \/>\n&#8211; modules are deployed in the order of File.listFiles() method.<\/p>\n<span id=\"Default_Deployment_Name\"><h3>Default Deployment Name<\/h3><\/span>\n<p>* myear.ear -> myear<br \/>\n* Exploded directory -> directory name<\/p>\n<span id=\"Install_Root_Directory\"><h3>Install Root Directory<\/h3><\/span>\n<span id=\"\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/09\/wl11g_deploy_rootdir.gif\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/09\/wl11g_deploy_rootdir-300x240.gif\" alt=\"\" title=\"wl11g_deploy_rootdir\" width=\"300\" height=\"240\" class=\"aligncenter size-medium wp-image-3575\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/09\/wl11g_deploy_rootdir-300x240.gif 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2011\/09\/wl11g_deploy_rootdir.gif 597w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<p>* Example:<\/p>\n<pre lang=\"bash\">\r\nmkdir c:\\deployments\\production\r\nmkdir c:\\deployments\\production\\myApplication\r\nmkdir c:\\deployments\\production\\myApplication\\91Beta\r\nmkdir c:\\deployments\\production\\myApplication\\91Beta\\app\r\nmkdir c:\\deployments\\production\\myApplication\\91Beta\\plan\r\n# Other plan files\r\nmkdir c:\\deployments\\production\\myApplication\\91Beta\\plan1\r\nmkdir c:\\deployments\\production\\myApplication\\91Beta\\plan2\r\ncp c:\\downloads\\myApplication.ear c:\\deployments\\production\\myApplication\\91Beta\\app\r\n# or exploded form\r\ncp -r c:\\downloads\\myApplication c:\\deployments\\production\\myApplication\\91Beta\\app\r\n# Default plan\r\ncp c:\\downloads\\myApplicationPlans\\plan.xml c:\\deployments\\production\\myApplication\\91Beta\\plan\r\n# If not default plan directory, then must specify plan1 or plan2 directory in config.xml\r\ncp c:\\downloads\\myApplicationPlans\\plan1.xml c:\\deployments\\production\\myApplication\\91Beta\\plan1\r\ncp c:\\downloads\\myApplicationPlans\\plan2.xml c:\\deployments\\production\\myApplication\\91Beta\\plan2\r\n<\/pre>\n<span id=\"FastSwap_Deployment\"><h2>FastSwap Deployment<\/h2><\/span>\n<p>* JEE 5 introduced <em>dynamic class redefinition<\/em>:<br \/>\n&#8211; redefine classes at run time without disturbing running applications.<br \/>\n&#8211; requires shape of class remains identical.<br \/>\n* WebLogic FastSwap removes the restriction of identical class shape.<\/p>\n<span id=\"FastSwap_restrictions\"><h3>FastSwap restrictions<\/h3><\/span>\n<p>* Available in Dev mode only.<br \/>\n* Supports following in exploded directories only (not archives):<br \/>\n&#8211; POJOs (jars)<br \/>\n&#8211; wars<br \/>\n&#8211; ears<br \/>\n* See <a href=\"http:\/\/download.oracle.com\/docs\/cd\/E17904_01\/web.1111\/e13702\/deployunits.htm#insertedID6\">here<\/a> for more details.<\/p>\n<span id=\"To_Enable\"><h3>To Enable<\/h3><\/span>\n<p>* Add to weblogic-application.xml (enterprise app) or weblogic.xml (web app) file:<\/p>\n<pre lang=\"xml\">\r\n<fast-swap>\r\n\t<enabled>true<\/enabled>\r\n<\/fast-swap>\r\n<\/pre>\n<span id=\"Ant_Task\"><h3>Ant Task<\/h3><\/span>\n<pre lang=\"xml\">\r\n  <taskdef name='fast-swap'  classname='com.bea.wls.redef.ant.FastSwapTask'\/>\r\n  <target name='all'>\r\n    <!--\r\n      Redefine classes which have changed since they were last loaded.\r\n      Required parameters:\r\n       adminUrl: Connection url\r\n           user: User name\r\n       password: User password\r\n         server: Managed server name\r\n      application: Deployed application name\r\n      Optional parameters:\r\n          module: Name of the module within the application.\r\n                  If not specified, all modules within the application\r\n                  will be processed.\r\n       failonerror: Default=true. If true, task will fail if fast-swap failed.\r\n                  Otherwise, a message will be displayed and the task will\r\n                    return success.\r\n         timeout: Default=300. Timeout in seconds.\r\n      classnames: Comma separated list of classnames to process. If not\r\n                  specified, all classes within specified modules (if any)\r\n                    in the application will be considered.\r\n    -->\r\n    <fast-swap\r\n      adminUrl='t3:\/\/localhost:7001'\r\n      user='weblogic'\r\n      password='weblogic'\r\n      server='myserver'\r\n      application='SimpleApp'\r\n      module='SimpleAppCookie'\r\n      failonerror='false'\r\n      timeout='30'\r\n      classnames='examples.servlets.CookieCounter1,\r\n                  examples.servlets.CookieCounter2,\r\n                    examples.servlets.CookieCounter'\r\n    \/>\r\n  <\/target>\r\n<\/pre>\n<p>[mv_include id=&#8221;3569&#8243;]<br \/>\n* <a href=\"http:\/\/download.oracle.com\/docs\/cd\/E17904_01\/web.1111\/e13702\/deployunits.htm#g1060841\">Preparing Applications and Modules for Deployment<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Packaging Files for Deployment Using Archived Files * Packaged with jar utility with different types of file extensions: &#8211; EJBs and client archives: .jar &#8211; Web app: .war &#8211; Resource adapter: .rar &#8211; Enterprise app: .ear &#8211; Web services: .war &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=3574\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[104],"tags":[],"class_list":["post-3574","post","type-post","status-publish","format-standard","hentry","category-weblogic11g"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-VE","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/3574","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3574"}],"version-history":[{"count":5,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/3574\/revisions"}],"predecessor-version":[{"id":3657,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/3574\/revisions\/3657"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}