{"id":5253,"date":"2012-07-17T23:04:44","date_gmt":"2012-07-18T04:04:44","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=5253"},"modified":"2012-08-25T22:37:05","modified_gmt":"2012-08-26T03:37:05","slug":"1z0-102-deploying-java-ee-applications","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=5253","title":{"rendered":"Deploying Java EE Applications"},"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=\"#Describe_the_structure_and_parts_of_a_Java_web_application\">Describe the structure and parts of a Java web application<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Web_App\">Web App<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Web_Services_App\">Web Services App<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Virtual_Directory_Mappings\">Virtual Directory Mappings<\/a>\n\t\t\t<\/li>\n\t\t<\/ol>\n\t<li>\n\t\t<a href=\"#Describe_the_structure_and_parts_of_a_Java_enterprise_application\">Describe the structure and parts of a Java enterprise application<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#EJB_Applications\">EJB Applications<\/a>\n\t\t\t\t<ol class='toc-odd level-3'>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a href=\"#EJB_Types\">EJB Types<\/a>\n\t\t\t\t\t<\/li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a href=\"#EJB_App_Structure\">EJB App Structure<\/a>\n\t\t\t\t\t<\/li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a href=\"#weblogic-ejb-jar.xml\">weblogic-ejb-jar.xml<\/a>\n\t\t\t\t\t<\/li>\n\t\t\t\t<\/ol>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Enterprise_Application\">Enterprise Application<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#weblogic-application.xml\">weblogic-application.xml<\/a>\n\t\t\t<\/li>\n\t\t\t<li>\n\t\t\t\t<a href=\"#EAR_Class_Libraries\">EAR Class Libraries<\/a>\n\t\t\t<\/li>\n\t\t<\/ol>\n\t<li>\n\t\t<a href=\"#Deploy_WLS_shared_libraries_and_associate_them_with_applications\">Deploy WLS shared libraries and associate them with applications<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Shared_Libraries\">Shared Libraries<\/a>\n\t\t\t<\/li>\n<\/ol>\n<\/ol>\n<\/ol>\n<\/div>\n<div class='wptoc-end'>&nbsp;<\/div>\n<p><< <a href=\"?p=3562\">Previous<\/a><\/p>\n<span id=\"Describe_the_structure_and_parts_of_a_Java_web_application\"><h2>Describe the structure and parts of a Java web application<\/h2><\/span>\n<span id=\"Web_App\"><h3>Web App<\/h3><\/span>\n<p>* Descriptors<br \/>\n&#8211; web.xml<br \/>\n&#8211; weblogic.xml<\/p>\n<span id=\"\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_deploy_webapp_structure.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_deploy_webapp_structure-300x180.jpg\" alt=\"\" title=\"wls11gadmin_deploy_webapp_structure\" width=\"300\" height=\"180\" class=\"aligncenter size-medium wp-image-5254\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_deploy_webapp_structure-300x180.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_deploy_webapp_structure.jpg 705w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<span id=\"Web_Services_App\"><h3>Web Services App<\/h3><\/span>\n<p>* Descriptors<br \/>\n&#8211; web.xml<br \/>\n&#8211; weblogic.xml<br \/>\n&#8211; webservices.xml<br \/>\n&#8211; weblogic-webservices.xml<\/p>\n<span id=\"Virtual_Directory_Mappings\"><h3>Virtual Directory Mappings<\/h3><\/span>\n<p>* Used to refer to physical directories<br \/>\n* Used to avoid hard coding physical directories<br \/>\n* Allow multiple web apps to share common physical directories, e.g. images<br \/>\n* Promotes file sharing across applications<br \/>\n* Configured in weblogic.xml<\/p>\n<pre lang=\"xml\">\r\n<virtual-directory-mapping>\r\n    <local-path>c:\/usr\/gifs<\/local-path>\r\n    <url-pattern>\/images\/*<\/url-pattern>\r\n    <url-pattern>*.jpg<\/url-pattern>\r\n<\/virtual-directory-mapping>\r\n\r\n<virtual-directory-mapping>\r\n    <local-path>c:\/usr\/common_jsps.jar<\/local-path>\r\n    <url-pattern>*.jsp<\/url-pattern>\r\n<\/virtual-directory-mapping>\r\n<\/pre>\n<span id=\"Describe_the_structure_and_parts_of_a_Java_enterprise_application\"><h2>Describe the structure and parts of a Java enterprise application<\/h2><\/span>\n<span id=\"EJB_Applications\"><h3>EJB Applications<\/h3><\/span>\n<p>* Server side distributed components<br \/>\n* Are annotated Java classes<br \/>\n* Packaged with XML deployment descriptors<br \/>\n* Supports the following capabilities<br \/>\n&#8211; remote access over a network<br \/>\n&#8211; object relational mapping (ORM) via JPA<br \/>\n&#8211; transactions<br \/>\n&#8211; messaging integration<br \/>\n&#8211; dependency injection<\/p>\n<span id=\"EJB_Types\"><h4>EJB Types<\/h4><\/span>\n<span id=\"_1\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_ejbs.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_ejbs-300x188.jpg\" alt=\"\" title=\"wls11gadmin_ejbs\" width=\"300\" height=\"188\" class=\"aligncenter size-medium wp-image-5260\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_ejbs-300x188.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_ejbs.jpg 689w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<span id=\"EJB_App_Structure\"><h4>EJB App Structure<\/h4><\/span>\n<span id=\"_2\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_ejb_structure.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_ejb_structure-300x175.jpg\" alt=\"\" title=\"wls11gadmin_ejb_structure\" width=\"300\" height=\"175\" class=\"aligncenter size-medium wp-image-5261\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_ejb_structure-300x175.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_ejb_structure.jpg 691w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<span id=\"weblogic-ejb-jar.xml\"><h4>weblogic-ejb-jar.xml<\/h4><\/span>\n<p>* Security role mapping<br \/>\n* Advanced security role mapping<br \/>\n* EJB clustering<br \/>\n* EJB pooling and caching<br \/>\n* Work managers and threading<\/p>\n<span id=\"Enterprise_Application\"><h3>Enterprise Application<\/h3><\/span>\n<p>* A deployable unit packaged in an .ear file and contains zero or more:<br \/>\n&#8211; web apps (.war)<br \/>\n&#8211; EJB apps (.jar)<br \/>\n&#8211; Java apps (.jar)<br \/>\n&#8211; resource adapters (.rar)<br \/>\n&#8211; application specific JDBC and JMS resources<\/p>\n<span id=\"_3\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_ear_structure.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_ear_structure-300x221.jpg\" alt=\"\" title=\"wls11gadmin_ear_structure\" width=\"300\" height=\"221\" class=\"aligncenter size-medium wp-image-5265\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_ear_structure-300x221.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_ear_structure.jpg 607w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<span id=\"weblogic-application.xml\"><h3>weblogic-application.xml<\/h3><\/span>\n<p>* Used to configure<br \/>\n&#8211; reference to shared libraries<br \/>\n&#8211; work managers and threading<br \/>\n&#8211; default EJB and web app parameter values<br \/>\n&#8211; application wide EJB cache<br \/>\n* Used to configure all web app modules:<br \/>\n&#8211; change default HTTP session timeout<br \/>\n&#8211; default cookie name used to track HTTP sessions<br \/>\n&#8211; enabling clustering features such as in-memory replication and persistence<br \/>\n* Used to achieve application scoping for:<br \/>\n&#8211; XML parsers<br \/>\n&#8211; XML entity mappings<br \/>\n&#8211; JDBC data sources<br \/>\n&#8211; JMS connection factories and destinations<br \/>\n&#8211; security realms (?)<\/p>\n<span id=\"EAR_Class_Libraries\"><h3>EAR Class Libraries<\/h3><\/span>\n<p>* J2EE 1.4<br \/>\n&#8211; <em>APP-INF\/lib<\/em><br \/>\n&#8211; <em>APP-INF\/classes<\/em><\/p>\n<p>* In J2EE 5, use <em>library-directory<\/em> to specify jars to be shared by all applications (default to lib?):<\/p>\n<pre lang=\"xml\">\r\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<application xmlns=\"http:\/\/java.sun.com\/xml\/ns\/javaee\"\r\nxmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" version=\"5\"\r\nxsi:schemaLocation=\"http:\/\/java.sun.com\/xml\/ns\/javaee\r\nhttp:\/\/java.sun.com\/xml\/ns\/javaee\/application_5.xsd\">\r\n <module>\r\n   <ejb>hello-ejb.jar<\/ejb>\r\n <\/module>\r\n \r\n <module>\r\n  <web>\r\n   <web-uri>hello.war<\/web-uri>\r\n   <context-root>hello<\/context-root>\r\n  <\/web>\r\n <\/module>\r\n \r\n <library-directory>shared<\/library-directory>\r\n<\/application>\r\n<\/pre>\n<span id=\"Deploy_WLS_shared_libraries_and_associate_them_with_applications\"><h2>Deploy WLS shared libraries and associate them with applications<\/h2><\/span>\n<span id=\"Shared_Libraries\"><h3>Shared Libraries<\/h3><\/span>\n<p>* For sharing J2EE modules (war, jar, ear)<br \/>\n* Local resources take precedence over shared ones<br \/>\n* Can contain deployment descriptors that are merged with application&#8217;s descriptors<\/p>\n<span id=\"_4\"><h6><a href=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_shared_lib_1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_shared_lib_1-300x91.jpg\" alt=\"\" title=\"wls11gadmin_shared_lib_1\" width=\"300\" height=\"91\" class=\"aligncenter size-medium wp-image-5266\" srcset=\"https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_shared_lib_1-300x91.jpg 300w, https:\/\/jianmingli.com\/wp\/wp-content\/uploads\/2012\/07\/wls11gadmin_shared_lib_1.jpg 676w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/h6><\/span>\n<p>* Configure shared libraries in weblogic.xml (for war) or weblogic-applicaiton.xml (for ear)<\/p>\n<pre lang=\"xml\">\r\n<library-ref>\r\n    <library-name>ajax-tools-lib<\/library-name>\r\n    <!-- J2EE version -->\r\n    <specification-version>1.5.0<\/specification-version>\r\n    <!-- Your implementation version -->\r\n    <implementation-version>2.0.0<\/implementation-version>\r\n<\/library-ref>\r\n<library-ref>\r\n    <library-name>help-web-lib<\/library-name>\r\n    <specification-version>1.5.0<\/specification-version>\r\n    <implementation-version>1.1.0<\/implementation-version>\r\n<\/library-ref>\r\n<\/pre>\n<p><a href=\"?p=5269\">Next <\/a>>><\/p>\n<p>[mv_include id=&#8217;3268&#8242;]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>> [mv_include id=&#8217;3268&#8242;]<\/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":[107,104],"tags":[183,150],"class_list":["post-5253","post","type-post","status-publish","format-standard","hentry","category-certification","category-weblogic11g","tag-1z0","tag-deploy"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-1mJ","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/5253","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=5253"}],"version-history":[{"count":8,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/5253\/revisions"}],"predecessor-version":[{"id":5704,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/5253\/revisions\/5704"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}