<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
   <title>Devbits</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/aseembajaj/" />
   <link rel="self" type="application/atom+xml" href="http://blogs.oracle.com/aseembajaj/xml/rss.xml" />
   <id>tag:blogs.oracle.com,2009:/aseembajaj//186</id>
   <updated>2009-07-24T16:49:40Z</updated>
   <subtitle>Posts about application development</subtitle>
   <generator uri="http://www.sixapart.com/movabletype/">Movable Type Enterprise 1.52-en-voltron-r47459-20070213</generator>

<entry>
   <title>Temporary files for application deployment</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/aseembajaj/2009/07/temporary_files_for_applicatio.html" />
   <id>tag:blogs.oracle.com,2009:/aseembajaj//186.13476</id>
   
   <published>2009-07-24T17:49:00Z</published>
   <updated>2009-07-24T16:49:40Z</updated>
   
   <summary>After a user issues a deployment command, the application is wisked away by the deployment sub-system across the cluster to the appropriate managed server for deployment. We have often been asked questions about the fate of application file beyond this point and most of these questions are the in context of security manager configuration. Here is a brief overview of temporary files that are used during deployment of applications.</summary>
   <author>
      <name>Aseem Bajaj</name>
      <uri>http://blogs.oracle.com/aseembajaj/</uri>
   </author>
         <category term="Deployment" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="deployment" label="Deployment" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="wls" label="WLS" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/aseembajaj/">
      <![CDATA[<p>After a user issues a deployment command, the application is whisked away by the deployment sub-system across the cluster to the appropriate managed server for deployment. We have often been asked questions about the fate of application file beyond this point and most of these questions are the in context of security manager configuration. Here is a brief overview of temporary files that are used during deployment of applications.</p>

<p>After handling the staging, the deployment sub-system hands over the file to containers for deployment. The containers assume the file to be available on the same machine and deal with it accordingly.</p>

<p>Archived applications are exploded in a sever-specific temporary directory and only the temporary location is looked at by the class loader. Exploded application directories are not copied to temporary directory. So the class loader for such an application directly looks up the original location. If such an exploded application has some archived modules (say web module), then they are exploded in a temporary directory as described earlier. </p>

<p>Jar files need not be exploded and are directly used by the class loader. But, for Windows, they are copied to a temporary directory and the class loader looks up the jar from the temporary location. This special treatment is done for usability as it lets users overwrite jar files.</p>]]>
      
   </content>
</entry>
<entry>
   <title>Resource filtering configuration</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/aseembajaj/2009/07/resource_filtering_configurati.html" />
   <id>tag:blogs.oracle.com,2009:/aseembajaj//186.13470</id>
   
   <published>2009-07-24T00:10:19Z</published>
   <updated>2009-07-23T23:15:44Z</updated>
   
   <summary>WebLogic Server introduced the concept of filtering class loader with release 9.2. With release 10.3.1, filtering class loader now supports a more fine grained control over resource loading behavior.</summary>
   <author>
      <name>Aseem Bajaj</name>
      <uri>http://blogs.oracle.com/aseembajaj/</uri>
   </author>
         <category term="Class Loaders" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="classloaders" label="Class Loaders" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="wls" label="WLS" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/aseembajaj/">
      <![CDATA[<center><img alt="filter.jpg" src="http://blogs.oracle.com/aseembajaj/pictures/filter.jpg" width="500" height="310" /></center>

<p>WebLogic Server introduced the concept of <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13706/classloading.htm#i1097253">filtering class loader</a> with release 9.2. Filtering class loader is used to filter class loading requests by application. It is configured using prefer-application-packages element in weblogic-application.xml. This configuration also modifies resource loading behavior to some extent. It has been explained in <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13706/classloading.htm#i1097628">resource loading order</a> section of the documentation.</p>

<p>With release 10.3.1, filtering class loader now supports a more fine grained control over resource loading behavior. A new element prefer-application-resources may be used to configure a resource pattern to filter. If this pattern is configured, any resource lookup whose URI matches the pattern will only be looked up in the application.</p>

<p>Consider an application flight.ear that has a jar file in it's APP-INF/lib directory and assume that this jar file contains META-INF/foo.xml. Further consider another jar file in the system class path that too has META-INF/foo.xml. If the application code uses ClassLoader.getResource(String) or ClassLoader.getResources(String) it'll see the resource from the system class path. But if the application were configured using prefer-application-resources element in weblogic-application.xml, the above resource lookup requests wouldn't find any resource from the system class path:</p>

<p>&lt;prefer-application-resources&gt;<br />
&nbsp;&nbsp;&lt;resource-name&gt;META-INF/foo.xml&lt;/resource-name&gt;<br />
&lt;/prefer-application-resources&gt;</p>

<p><u>getResource with no filtering configuration</u><br />
Resource from system class path</p>

<p><u>getResources with no filtering configuration</u><br />
Resource from system class path<br />
Resource from the application</p>

<p><u>getResource with above filtering configuration</u><br />
Resource from application</p>

<p><u>getResources with above filtering configuration</u><br />
Resource from application</p>

<p>Please note that resource-name element supports “*” wild card pattern. So we could have used something like “META-INF/*” as resource name as well. </p>

<p>In case the resource being looked up does not match the pattern configured using prefer-application-resources, the look up behavior reverts to the default resource loading behavior of filtering class loader, as described <a href="http://download.oracle.com/docs/cd/E12839_01/web.1111/e13706/classloading.htm#i1097628">here</a>. If prefer-application-packages is not declared, then resource loading behavior would revert to java default.</p>

<p><small>(Picture licensed from <a href="http://www.flickr.com/photos/roshnii/">Roshnii</a> under creative commons)</small></p>]]>
      
   </content>
</entry>
<entry>
   <title>Configuring context root for web application libraries</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/aseembajaj/2008/12/context_root_for_shared_web_ap.html" />
   <id>tag:blogs.oracle.com,2008:/aseembajaj//186.9225</id>
   
   <published>2008-12-22T18:05:43Z</published>
   <updated>2008-12-22T18:05:50Z</updated>
   
   <summary>There are many ways to configure context root for web applications and modules in WebLogic Server. There are rules around context root configuration of shared web application libraries too. This post intends to put all these configuration settings together. </summary>
   <author>
      <name>Aseem Bajaj</name>
      <uri>http://blogs.oracle.com/aseembajaj/</uri>
   </author>
         <category term="Shared Application Libraries" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="sharedapplicationlibraries" label="Shared Application Libraries" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="sharedjavaeelibraries" label="Shared JavaEE Libraries" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="wls" label="WLS" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/aseembajaj/">
      <![CDATA[<div align="center"><img alt="cardiff-library-under-renovation.jpg" src="http://blogs.oracle.com/aseembajaj/pictures/cardiff-library-under-renovation.jpg" width="500" height="375" /></div>

<p>There are many ways to configure context root for web applications and modules in WebLogic Server. There are rules around context root configuration of shared web application libraries too. This post intends to put all these configuration settings together. To read more about shared Java EE libraries supported by WebLogic Server, please refer to the <a href="http://e-docs.bea.com/wls/docs103/programming/libraries.html">documentation</a>.</p>

<p>To begin with, let's go through context root configuration in non-library scenarios.</p>

<p>1. When a standalone web application is deployed, the context root is the file name sans the .war suffix. This can be overridden by the use of &lt;context-root&gt; setting in weblogic.xml. In such cases the configured value is used.<br />
2. When an enterprise application is deployed without application.xml, enclosed web modules are deployed with context root of module URI sans the .war suffix. This scenario only works with release 10.0 (Java EE 5) onwards. On earlier edition, such an application would not deploy. <br />
3. When an enterprise application is deployed with application.xml no module scanning is performed. The declared web modules are deployed with the value from the declared &lt;context-root&gt; element in application.xml. This element is mandatory according to schema for application.xml. This configuration would override any &lt;context-root&gt; declaration in weblogic.xml of the module. </p>

<p>WebLogic Server supports the use of shared web application libraries that can be referred to from any of the following:</p>

<p>1. Enterprise applications or shared enterprise application libraries<br />
2. Web applications, web modules or shared web application libraries</p>

<p>The meaning of such a reference is different in the two cases. The former implies that the referred shared web application library be added as a module to the enterprise application artifact. In doing so, context-root of this web module is set to the library file name sans the .war suffix. Therefore, any &lt;context-root&gt; declaration in weblogic.xml is ignored. This behavior can be overridden: </p>

<p>1. While referring to a shared web application library using &lt;library-ref&gt; element in weblogic-application.xml, an optional element &lt;context-root&gt; may be used. This declaration ensures that the context root of the library web module is set to the configured value.<br />
2. &lt;context-root&gt; setting in &lt;library-ref&gt; may be further overridden by the use of &lt;library-context-root-override&gt; element in weblogic-application.xml. This overriding configuration element has been added to cater to 3rd party library scenarios. Say customer app A.ear refers to vendor library V.ear which in turn refers to another vendor library V.war. Since customer has no control over &lt;library-ref&gt; declaration in V.ear, &lt;library-context-root-override&gt; gives her a way to override context root for V.war. </p>

<p>When a web application, module or shared library refers to a shared web application library, the latter is merged into the former. In such cases, &lt;context-root&gt; declaration in weblogic.xml of the library is ignored. &lt;context-root&gt; declaration in &lt;library-ref&gt; of weblogic.xml is also ignored. </p>

<p><b>Further clarifications</b><br />
After I sent out the compilation of these rules to a colleague of mine, <a href="http://lt-rider.blogspot.com">Konstantin Komissarchik</a>, he wrote back requesting a few clarifications. I though it'll be useful to share his queries and my responses in this post.</p>

<p>Q. Could you confirm that the library name (as specified in manifest or at deployment) is not considered here and that the starting value is always based on library file name? <br />
A. Yes, the name is NOT considered. </p>

<p>Q. What about the exploded web library case? Is that even supported? <br />
A. It is supported and the same rules apply as archived shared web application libraries. </p>

<p>Q. Could you confirm that library-context-root-override is more generic than just the above scenario? Let's assume an EAR referencing libraries that don't reference other libraries. Can library-context-root-override be used instead of context-root element of library-ref when referencing a war library? <br />
A. No. &lt;library-context-root-override&gt; only overrides &lt;context-root&gt; of &lt;library-ref&gt;. It's not good by itself. In your scenario, you'll have to use &lt;context-root&gt; under &lt;library-ref&gt;. </p>

<p>Q. Can library-context-root-override be used when referencing ear library to override context roots of contained web modules? <br />
A. No. In fact there is no such configuration that could be applied to enterprise shared library reference that would override configuration for all modules.</p>

<p>Q. If you have A.ear referencing library B.war, and you have &lt;context-root&gt; specified in &lt;library-ref&gt; element for B.war, can you then override that context root using &lt;library-context-root-override&gt; in the same <br />
weblogic-application.xml file? Or can only override &lt;context-root&gt; declarations from indirect references.<br />
A. Yes, you can apply &lt;library-context-root-override&gt; to a context-root declared in &lt;context-root&gt; declaration of &lt;library-ref&gt; of the same weblogic-application.xml </p>

<p>Q. Are there any nesting limits on how deep of a reference you can override? Say you have A.ear which references library B.ear which references C.ear which references D.war and specifies &lt;context-root&gt;. Can you use &lt;library-context-root-override&gt; element in A.ear to change the context root that D.war is mapped to? <br />
A. There are no nesting limits on libraries. So there is no nesting limit for this override. In this scenario, the use of &lt;library-context-root-override&gt; would work.</p>

<p>Q. Is it possible to use &lt;library-context-root-override&gt; in an EAR library (rather than EAR application)? In the scenario described in #2 above, can &lt;library-context-root-override&gt; be placed in B.ear or C.ear and have the same effect of placing it in A.ear. If the answer to this question is yes, what happens if you want to override again in A.ear? Is that allowed? If yes, are you overriding the override or the original value specified in the &lt;context-root&gt; element.<br />
A. The schema of weblogic-application.xml is the same for enterprise applications and shared enterprise application libraries. So the presence of &lt;library-context-root-override&gt; is allowed in weblogic-application.xml of shared enterprise application libraries. But it is ignored.</p>

<p><small>(Picture licensed from <a href="http://www.flickr.com/people/keithpatterson">Athanasius</a> under Creative Commons)</small></p>]]>
      
   </content>
</entry>
<entry>
   <title>Schema Namespaces</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/aseembajaj/2008/08/schema_namespaces.html" />
   <id>tag:blogs.oracle.com,2008:/aseembajaj//186.6111</id>
   
   <published>2008-08-29T21:35:02Z</published>
   <updated>2008-08-29T20:37:10Z</updated>
   
   <summary> With WebLogic Server 10.3, there have been some changes in deployment descriptor schemas. This post discusses some of the issues that we faced in maintaining multiple loosely related XML schemas and how we tackled them. Note that none of...</summary>
   <author>
      <name>Aseem Bajaj</name>
      <uri>http://blogs.oracle.com/aseembajaj/</uri>
   </author>
         <category term="WebLogic Server" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="wls" label="WLS" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="xml" label="XML" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/aseembajaj/">
      <![CDATA[<div align="center"><img alt="independent-evolution.jpg" src="http://blogs.oracle.com/aseembajaj/pictures/independent-evolution.jpg" width="500" height="310" /></div>

<p>With WebLogic Server 10.3, there have been some changes in deployment descriptor schemas. This post discusses some of the issues that we faced in maintaining multiple loosely related XML schemas and how we tackled them. Note that none of these changes require changes to deployment descriptors. As always, old applications would continue to deploy and run without any change.</p>

<p><strong>Old Namespace</strong><br />
We started off with a shared & stable set of schema in 9.0, all of which shared a common namespace URI: http://www.bea.com/ns/weblogic/90. Since then we haven’t made any incompatible changes to the schemas, and making any such change seems unlikely. However, the schemas do change across major releases, minor releases and even in maintenance packs. Such changes are almost always independent of each other, that is, it’s highly likely that only one of the schema document changes.</p>

<p>The main problem with http://www.bea.com/ns/weblogic/90 was that it included version information. When schema changes were made for a minor release or for a maintenance pack, we had to update the namespace for that schema. This was usability issue. In such a release, when an application developer wrote new descriptors, she had to deal with similar looking but different namespaces.</p>

<p>We could come up with a solution to schema versioning without changing the namespace within a major release, but we would still have to change the namespace once the schema changes happen for the next major release. This was a tooling issue. An application developer who performed pre-validation on her descriptors would have to change her descriptor to use the new namespace. This was also a maintenance issue for us. Each time we changed the namespace, we had to change our internal components that took care of backward compatibility.</p>

<p>The old convention also forced the same namespace on all the schemas. This contributed to the usability issue mentioned in the previous section. Also, it added to maintenance by forcing us to move the unchanged schemas to a new a namespace, every major release. This model did not fit well with modularity either. As teams owning the schemas spread out, we would need extra communication and co-ordination to avoid type name collisions for new types being added.</p>

<p><strong>New namespaces</strong><br />
With WebLogic Server 10.3, all schemas now declare their own namespaces, none of which have any version in namespace URI. The general pattern of new namespace URIs is http://www.bea.com/ns/weblogic/<root element name>. For example, the namespace URI for weblogic.xml is http://www.bea.com/ns/weblogic/weblogic-web-app</p>

<p>This change addresses the two major problems and lays out a road map for schema versioning in the future. This will help the schemas evolve independently. Representing an entire namespace in one schema also provides a cleaner extensibility model for our application developers and ISVs. </p>

<p>In general, namespace URI wouldn't be changed even across major releases, unless drastic changes occur and we are forced to introduce incompatible changes. Again note that even if drastic changes to schema force us to change the namespace URI, old applications would continue to work without any change.</p>

<p>For documentation and referencing, we do need to capture the version information of the schema, inside the schema. This is done using the “version” attribute of <schema> element at the top of each schema:<br />
<pre><br />
&lt;xsd:schema ..<br />
  version=”1.0”&gt;<br />
..<br />
&lt;/xsd:schema&gt;<br />
</pre><br />
We also introduced “version” attribute at the root element of each descriptor. This is somewhat similar to the version attribute for each of the Java EE descriptors. The Java EE descriptors version attribute is required and is an enumeration of supported versions. But we are not strict about this because our parsing infrastructure does a good job of in-memory conversion of document into the latest schema structure. Also, our schemas are revised more often than those of Java EE. So introducing an enumeration of possible values would be cumbersome to maintain in the future. Hence, our version attribute is optional and and of string type. Containers might use this value in the future. Here is how this would look in a descriptor:<br />
<pre><br />
&lt;weblogic-web-app version=”1.0”&gt;<br />
..<br />
&lt;/weblogic-web-app&gt;<br />
</pre><br />
<strong>Schema Locations</strong><br />
Each version of every schema is published on the web for reference. The same location may also be used for schema validation in case an XML parser or editor honors schemaLocation attribute. To get the URL for a given version of any schema use the namespace URI as a URL and visit this URL using your browser. An index of various versions for that schema would show up. Each of these entries links to the published schema for that version. For example, if you visit <a href="http://www.bea.com/ns/weblogic/weblogic-web-app">http://www.bea.com/ns/weblogic/weblogic-web-app</a> you would find link to version 1.0 of this schema pointing to <a href="http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd</a> </p>

<p>In due course, the schemas would be migrated from BEA domain to Oracle domain. The namespace URIs themselves might be changed too, for branding and consistency purposes. But the pattern of namespace URIs would continue to be the same. Whenever these changes happen, they'll be duly documented.</p>

<p><small>(Picture licensed from <a href="http://www.flickr.com/people/beeteeoh/">Brian Marco</a> under <a href="http://creativecommons.org/licenses/by-nc-nd/2.0/deed.en">Creative Commons</a>)</small></p>]]>
      
   </content>
</entry>
<entry>
   <title>Scala Servlet development</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/aseembajaj/2008/08/scala_servlet_development.html" />
   <id>tag:blogs.oracle.com,2008:/aseembajaj//186.5745</id>
   
   <published>2008-08-05T15:00:00Z</published>
   <updated>2008-08-05T21:49:37Z</updated>
   
   <summary>Scala sources compile to class files that can run on JVM. So there is no doubt that most of Java EE development should be possible in Scala.What is yet not available is a reasonable IDE for Scala based Java EE application development. There is a Scala plugin for Eclipse that works great for Scala applications. So I went ahead and used it along with another plugin to get an effective Java EE development environment for Scala.</summary>
   <author>
      <name>Aseem Bajaj</name>
      <uri>http://blogs.oracle.com/aseembajaj/</uri>
   </author>
         <category term="Web" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="eclipse" label="Eclipse" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="oepe" label="OEPE" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="scala" label="Scala" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="wls" label="WLS" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/aseembajaj/">
      <![CDATA[<div align="center"><img alt="birdsnest.jpg" src="http://blogs.oracle.com/aseembajaj/pictures/birdsnest.jpg" width="500" height="375" /></div>

<p>Scala sources compile to class files that can run on JVM. So there is no doubt that most of Java EE development should be possible in Scala. Here is a simple servlet written in Scala.</p>

<pre>
package net.aseem.tryingoutscala.web
import javax.servlet.http._

<p>class Payroll extends HttpServlet {<br />
  override def doGet(request: HttpServletRequest, response: HttpServletResponse) =<br />
    response.getWriter().println("Hello World")<br />
}<br />
</pre></p>

<p>What is yet not available is a reasonable IDE for Scala based Java EE application development. There is a <a href="http://www.scala-lang.org/tools/eclipse/index.html">Scala plugin for Eclipse</a> that works great for Scala applications. So I went ahead and used it along with another plugin to get an effective Java EE development environment for Scala. I used Oracle Enterprise Pack for Eclipse  (formerly know as <a href="https://dev2devclub.bea.com/updates/wls-tools/">WLS Tools</a>) along with Scala Plugin for Eclipse to develop and deploy aforementioned Scala servlet. I installed these plugins on <a href="http://www.eclipse.org/downloads/packages/">Eclipse IDE for Java EE Developers (version Ganymede)</a> and tested the servlet on <a href="http://www.oracle.com/technology/products/weblogic/index.html">WebLogic Server 10g Release 3 (10.3)</a>.</p>

<p><strong>Scala project</strong><br />
I created a Scala project called TryingOutScala (File &gt; New &gt; Project &gt; Scala Wizards &gt; Scala Project) an added Servlet 2.5 spec jar to it's build path (Project &gt; Properties &gt; Java Build Path &gt; Libraries &gt; Add External JARs). I added the jar from WLS installation at BEA_HOME/modules/javax.servlet_1.0.0.0_2-5.jar. Then I created the above mentioned Scala servlet in this project (File &gt; New &gt; Other &gt; Scala Wizards &gt; Scala Class).</p>

<p><strong>Web project</strong><br />
Next I created a dynamic web project called Payroll (File &gt; New &gt; Project &gt; Web &gt; Dynamic Web Project) and added TryingOutScala project to it's Java EE module dependencies (Project &gt; Properties &gt; Java EE Module Dependencies). To web.xml of this project (located in WebContent/WEB-INF) I added the servlet from the Scala project.</p>

<pre>
&lt;servlet&gt;
  	&lt;servlet-name&gt;Home&lt;/servlet-name&gt;
  	&lt;servlet-class&gt;net.aseem.tryingoutscala.web.Payroll&lt;/servlet-class&gt;
&lt;/servlet&gt;
&lt;servlet-mapping&gt;
  	&lt;servlet-name&gt;Home&lt;/servlet-name&gt;
  	&lt;url-pattern&gt;/&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
</pre>

<p><strong>Scala Library</strong><br />
Our Scala servlet was now ready to be deployed, except Scala compiled classes need at least one library in classpath at runtime: scala-library.jar. For my installation, this file was available at /usr/share/java/scala-library.jar. Though packaging this library inside the web application would have worked, it would have considerably increased the size of the application. So I deployed it as a <a href="http://edocs.bea.com/wls/docs103/programming/libraries.html">shared application library</a> using the following command:<br />
<blockquote>java weblogic.Deployer -username *** -password *** -library -deploy -name scala-library /usr/share/java/scala-library.jar</blockquote></p>

<p>This library could also have been deployed using the console.</p>

<p>I added the following two lines to the top of manifest file of the web project (WebContent/META-INF/MANIFEST.MF) to ensure that the deployed library is available to the deployed application:<br />
<blockquote>Extension-List: scalalib<br />
scalalib-Extension-Name: scala-library</blockquote></p>

<p><strong>Deployment & Testing</strong><br />
To deploy the Scala servlet, I first added my local WLS installation to the available runtimes for the IDE (Window &gt; Preferences &gt; Server &gt; Runtime Environments). After this was done, Payroll project was deployed by simply running it on the server that had just been added (Run &gt; Run &gt; Run on Server).</p>]]>
      
   </content>
</entry>
<entry>
   <title>Faster console with WebLogic Server 10.3</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/aseembajaj/2008/07/faster_console_for_weblogic_se.html" />
   <id>tag:blogs.oracle.com,2008:/aseembajaj//186.5662</id>
   
   <published>2008-08-01T03:00:00Z</published>
   <updated>2008-09-11T17:59:55Z</updated>
   
   <summary>I tend to use more of command line tools for WebLogic Server administration. But I do use console especially when I am examining and debugging domains on remote machines.  It&apos;s great news that WebLogic Server console has become much faster with this release.</summary>
   <author>
      <name>Aseem Bajaj</name>
      <uri>http://blogs.oracle.com/aseembajaj/</uri>
   </author>
         <category term="WebLogic Server" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="wls" label="WLS" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="wlsconsole" label="WLSConsole" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/aseembajaj/">
      <![CDATA[<p>I tend to use more of command line tools for WebLogic Server administration. But I do use console especially when I am examining and debugging domains on remote machines.  It's great news that WebLogic Server console has become much faster with this release. And the configuration locking mechanism is now implicit in development mode. So I can simply go ahead and make the configuration changes without having to explicitly acquire locks.</p>

<div align="center">
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/R2wv9HKpGPw&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/R2wv9HKpGPw&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object>
</div>

<p>This video captures how fast the console works on my laptop. It's a Pentium M 1.8GHz with 2GB RAM running Windows XP SP2. I installed WebLogic Server 10.3 on it, created a new domain and started domain's admin server. In this video, I used the console to deploy and monitor a simple web application.</p>]]>
      
   </content>
</entry>
<entry>
   <title>Out of the (browser) box</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/aseembajaj/2007/05/out_of_the_browser_box.html" />
   <id>tag:blogs.oracle.com,2007:/aseembajaj//186.5366</id>
   
   <published>2007-05-15T22:56:12Z</published>
   <updated>2008-07-15T15:15:26Z</updated>
   
   <summary>The poster children frameworks of &quot;Web 2.0&quot; have been the JavaScript libraries that have made web sites slicker. However there is a new breed of frameworks that promise the experience of desktop, the connectivity of Internet &amp; the ease of web development.</summary>
   <author>
      <name>Aseem Bajaj</name>
      <uri>http://blogs.oracle.com/aseembajaj/</uri>
   </author>
         <category term="Web" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/aseembajaj/">
      <![CDATA[<div align="center"><img alt="View from my old office" src="http://blogs.oracle.com/aseembajaj/pics/old-office-view-medium.jpg" width="500" height="375" /></div>

<p>There were a lot of sessions about Rich Internet Applications at the recent Web 2.0 Expo & JavaOne conferences. The poster children frameworks of "Web 2.0" have been the JavaScript libraries that have made web sites slicker. However there is a new breed of frameworks that promise the experience of desktop, the connectivity of Internet & the ease of web development. Some of the possible advantages that such applications offer over traditional browser based web applications are:</p>

<p><strong>Offline Access:</strong> The often used argument for offline access doesn't stand any good in an increasingly connected world. However, the ability to buffer data in the background to cover up for network jitters makes a good case for usability. </p>

<p><strong>Local Resources:</strong> Applications running from within the browser have restrictions on what they can access on the local machine. They also have limitations in terms of how much can they store temporarily in cookies. Outside the browser, all these restrictions are mostly gone. The applications can cache more data for better performance. </p>

<p><strong>Better Push:</strong> A lot of web applications have alerts as an integral part of application workflow. With desktop applications, it's possible to have a lighter mechanism to alert the user than requiring her to keep the browser running at all the times. </p>

<p><strong>User Controls:</strong> Multimedia applications have a better user experience if they are controllable by non-standard user inputs like volume and channel controls. This is usually not possible from within the browser. </p>

<p><strong>Data Integration:</strong> An application running on the desktop has direct access to local data (like other resources). So they are more suited to mashup a user's online data with the local data. Even if local data is not involved, a desktop is a better place to mashup personal data from two different services.</p>

<p>There is no doubt that the experience could be functionally better for the end-users. But, using any application built on such frameworks would need some form of deployment on the customer desktop. Compare that with the web applications that need no deployment. It'll be interesting to see how the end-users take to this.</p>]]>
      
   </content>
</entry>
<entry>
   <title>Inferring Application Configuration</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/aseembajaj/2007/05/inferring_application_configur.html" />
   <id>tag:blogs.oracle.com,2007:/aseembajaj//186.5365</id>
   
   <published>2007-05-04T19:36:20Z</published>
   <updated>2008-09-11T17:58:59Z</updated>
   
   <summary>With configuration scattered around in source files and packaging details, an administrator might want to examine the consolidated configuration of an application. The developer of the application might also want to examine the container’s view of the configuration for debugging purposes. Two of the build time tools packaged with WebLogic Server help the administrators and the developers do exactly this.</summary>
   <author>
      <name>Aseem Bajaj</name>
      <uri>http://blogs.oracle.com/aseembajaj/</uri>
   </author>
         <category term="WebLogic Server" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="annotations" label="Annotations" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="javaee5" label="JavaEE5" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="wls" label="WLS" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="wlstools" label="WLSTools" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/aseembajaj/">
      <![CDATA[<p>JEE 5 makes most of the deployment descriptors optional. For example, the annotation @Stateless can be used to identify a stateless session bean instead of adding a <session-bean> declaration in META-INF/ejb-jar.xml of an EJB module. To add to this, WebLogic Server 10 has extended the JEE annotation support to include annotations that make web module’s deployment descriptor optional. For example, the @WLServlet annotation can be used as an alternate for <servlet> declaration in WEB-INF/web.xml. Finally, the JEE Spec has made the META-INF/application.xml optional in an enterprise application. In case META-INF/application.xml is absent, the app servers are required to examine the contents and make inference about their types. For example, a module ending with “.war” must be interpreted as a web module and should be deployed as one.</p>

<p>With configuration scattered around in source files and packaging details, an administrator might want to examine the consolidated configuration. The developer of the application might also want to examine the container’s view of the configuration for debugging. Two of the build time tools packaged with WebLogic Server help the administrators & the developers do exactly this. Both <a href="http://edocs.bea.com/wls/docs100/programming/libraries.html#wp1073556">AppMerge</a> & <a href="http://edocs.bea.com/wls/docs100/ejb/appc_ejbc.html">AppC</a> now support a new flag “writeInferredDescriptors”. When this flag is used, these tools write out an updated version of the descriptors that include the configuration information from annotations and packaging. In case, the descriptors does not exist in the source application, these tools write out new descriptors if the flag is used.</p>

<p>Let’s assume we have an application flight.ear that has no descriptors. It has two archived modules:</p>

<pre class="code">
$ jar tf flight.ear
statusApp.war
statusCheck.jar
</pre>

<p>Let’s assume that statusApp.war has no descriptors and has one Servlet that is annotated with @WLServlet annotation.</p>

<pre class="code">
$ jar tf statusApp.war
WEB-INF/
WEB-INF/classes/
WEB-INF/classes/weblogic/
WEB-INF/classes/weblogic/examples/
WEB-INF/classes/weblogic/examples/flight/
WEB-INF/classes/weblogic/examples/flight/Status.class
</pre>

<p>Let’s assume that the statusCheck.jar has no descriptors either. It has some class files, one of which is a Stateless session bean that’s annotated with @Stateless & @Remote annotations</p>

<pre class="code">
$ jar tf statusCheck.jar
weblogic/
weblogic/examples/
weblogic/examples/flight/
weblogic/examples/flight/FlightCheck.class
weblogic/examples/flight/FlightCheckBean.class
</pre>

<p>If we were to invoke AppMerge in the following way, it’ll generate a new version of flight.ear, called flightX.ear. </p>

<pre class="code">
$ java weblogic.appmerge -writeInferredDescriptors -output flightX.ear/ flight.ear
</pre>

<p>(In this example, I appended a ‘/’ at the end of flightX.ear so that the tool creates the output application as a directory. We could drop the '/' in the end (-output flightX.ear) and the tool would generate an archive.)</p>

<p>If we were now to examine flightX.ear, it’ll have a deployment descriptor.</p>

<pre class="code">
$ cat flightX.ear/META-INF/application.xml
&lt;?xml version='1.0' encoding='UTF-8'?&gt;
&lt;jav:application xmlns:jav="http://java.sun.com/xml/ns/javaee"&gt;
  &lt;jav:module&gt;
    &lt;jav:web&gt;
      &lt;jav:web-uri&gt;statusApp.war&lt;/jav:web-uri&gt;
      &lt;jav:context-root&gt;statusApp&lt;/jav:context-root&gt;
    &lt;/jav:web&gt;
  &lt;/jav:module&gt;
  &lt;jav:module&gt;
    &lt;jav:ejb&gt;statusCheck.jar&lt;/jav:ejb&gt;
  &lt;/jav:module&gt;
&lt;/jav:application&gt;
</pre>

<p>Similarly, the two modules in flightX.ear would now have descriptors:</p>

<pre class="code">
$ jar tf flightX.ear/statusApp.war WEB-INF/web.xml
WEB-INF/web.xml
$ jar tf flightX.ear/statusCheck.jar META-INF/ejb-jar.xml
META-INF/ejb-jar.xml
</pre>

<p>These descriptors can now be examined to see how the containers would deal with the module deployment. Note that the descriptors in the modules would have “metadata-complete” attribute on the root element set to true.</p>

<p>The flag "writeInferredDescriptors" can also be used for deployment optimization. If we were to deploy flightX.ear, the annotation processing would not be done because metadata-complete is set to true. Module discovery wouldn’t be done either because META-INF/application.xml would now be present in the application.</p>]]>
      
   </content>
</entry>

</feed>
