Posted on

Creating Oracle Weblogic deployment plans

 

Oracle WebLogic Deployment Descriptors

Oracle WebLogic recognizes several custom deployment descriptors which can be packaged along with your applications. Within this recipe, we will describe the three most common ones which can be packaged along with your application. The custom deployment descriptors are to be packaged in the same folder as the standard Java EE deployment descriptors and they override any setting which has been defined in the Java EE XML descriptors.

weblogic-ejb-jar.xml

The WebLogic Server weblogic-ejb-jar.xml deployment descriptor file can be used to describe elements related to EJB applications. A reference to the weblogic-ejb-jar.xml schema can be read at: http://docs.oracle.com/cd/E24329_01/web.1211/e24973/ejb_jar_ref.htm. Here follows an example of it which configures the maximum allowed of beans in the pool for the SampleEJB:

<wls:weblogic-ejb-jar>

   <wls:weblogic-enterprise-bean>

   <wls:ejb-name>SampleEJB</wls:ejb-name>

      <wls:stateless-session-descriptor>

         <wls:pool>

            <wls:max-beans-in-free-pool>25</wls:max-beans-in-free-pool>

         </wls:pool>

      </wls:stateless-session-descriptor>

   </wls:weblogic-enterprise-bean>

</wls:weblogic-ejb-jar>

weblogic.xml

The WebLogic Server weblogic.xml deployment descriptor file can be used to describe elements related to the configuration of Web applications. A reference to the weblogic.xml schema can be read at: http://docs.oracle.com/cd/E24329_01/web.1211/e21049/weblogic_xml.htm. Here follows an example of it which configures the Context Root for your application:

<wls:weblogic-web-app>

   <wls:weblogic-version>12.1.1</wls:weblogic-version>

   <wls:context-root>wls</wls:context-root>

</wls:weblogic-web-app>

weblogic-application.xml

The WebLogic Server weblogic.xml deployment descriptor file can be used to describe elements related to the configuration of an Enterprise Application Archive (EAR). A reference to the weblogic-application.xml schema can be read at: http://docs.oracle.com/cd/E24329_01/web.1211/e24368/app_xml.htm. Here follows an example of it which configures a JDBC Deployment module and a Work Manager:

<wls:weblogic-application>

   <wls:module>

      <wls:name>JDBCOracleModule</wls:name>

      <wls:type>JDBC</wls:type>

      <wls:path>newmodule-jdbc.xml</wls:path>

   </wls:module>

   <wls:work-manager>

      <wls:name>workmanager1</wls:name>

      <wls:max-threads-constraint>

         <wls:name>100</wls:name>

         <wls:count>1</wls:count>

      </wls:max-threads-constraint>

   </wls:work-manager>

</wls:weblogic-application>