<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>My Wiki</title>
	<atom:link href="http://jaikiran.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jaikiran.wordpress.com</link>
	<description>Just another Wordpress.com weblog</description>
	<lastBuildDate>Thu, 26 Jan 2012 04:00:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='jaikiran.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>My Wiki</title>
		<link>http://jaikiran.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jaikiran.wordpress.com/osd.xml" title="My Wiki" />
	<atom:link rel='hub' href='http://jaikiran.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Moved this blog to a new site</title>
		<link>http://jaikiran.wordpress.com/2006/08/28/moved-this-blog-to-a-new-site/</link>
		<comments>http://jaikiran.wordpress.com/2006/08/28/moved-this-blog-to-a-new-site/#comments</comments>
		<pubDate>Mon, 28 Aug 2006 08:10:13 +0000</pubDate>
		<dc:creator>jaikiran</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://jaikiran.wordpress.com/2006/08/28/moved-this-blog-to-a-new-site/</guid>
		<description><![CDATA[Have moved this blog to http://jaitechwriteups.blogspot.com/, which provides support of custom css, which helps me in handling the code contents in my posts more elegantly. Currently, i am in the process of evaluating the same. The new blog however, does not have support for tagging the posts(or maybe i am unaware of the same). Will [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=21&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Have moved this blog to <a target="_blank" href="http://jaitechwriteups.blogspot.com/" title="MyWiki">http://jaitechwriteups.blogspot.com/</a>, which provides support of custom css, which helps me in handling the code contents in my posts more elegantly. Currently, i am in the process of evaluating the same. The new blog however, does not have support for tagging the posts(or maybe i am unaware of the same). Will post here once i completely move to that blog. I have already moved all my posts from here to the new blog.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jaikiran.wordpress.com/21/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jaikiran.wordpress.com/21/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaikiran.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaikiran.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaikiran.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaikiran.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jaikiran.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jaikiran.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jaikiran.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jaikiran.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaikiran.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaikiran.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaikiran.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaikiran.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaikiran.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaikiran.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=21&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jaikiran.wordpress.com/2006/08/28/moved-this-blog-to-a-new-site/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/53d825816593839f037b235d897aaaef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jaikiran</media:title>
		</media:content>
	</item>
		<item>
		<title>Evict collection from Hibernate second level cache</title>
		<link>http://jaikiran.wordpress.com/2006/08/17/evict-collection-from-hibernate-second-level-cache/</link>
		<comments>http://jaikiran.wordpress.com/2006/08/17/evict-collection-from-hibernate-second-level-cache/#comments</comments>
		<pubDate>Thu, 17 Aug 2006 15:59:37 +0000</pubDate>
		<dc:creator>jaikiran</dc:creator>
				<category><![CDATA[Hibernate]]></category>

		<guid isPermaLink="false">https://jaikiran.wordpress.com/2006/08/17/evict-collection-from-hibernate-second-level-cache/</guid>
		<description><![CDATA[Hibernate allows persistent objects to be cached in its second level cache(The first level cache in Hibernate is the Session object which is ON by default). Applications can switch on the second level cache.  When a object is being retrieved by the application through Hibernate, Hibernate first checks in its Session cache and then the Second level cache to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=17&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hibernate allows persistent objects to be cached in its second level cache(The first level cache in Hibernate is the Session object which is ON by default). Applications can switch on the second level cache.  When a object is being retrieved by the application through Hibernate, Hibernate first checks in its Session cache and then the Second level cache to see if the object has be retrieved already. If it finds it either the Session cache or the Second level cache, it will NOT fire a query to the database.</p>
<p>While configuring second level cache, the object can be cached and also the collections contained in the object can be cached. Have a look at the following example:</p>
<pre>&lt;hibernate-mapping default-lazy="false" &gt; 

 &lt;class name="org.myapp.ho.Parent" table="Parent"&gt; 

    <strong>&lt;cache usage="read-only" /&gt; 

</strong>    &lt;id name="id" type="Integer" column="ID" /&gt; 

  &lt;set name="myChildren"&gt; 

     <strong>&lt;cache usage="read-only"&gt; 

</strong>     &lt;one-to-many class="org.myapp.ho.Child"&gt; 

  &lt;/set&gt; 

 &lt;/class&gt; 

&lt;/hibernate-mapping&gt;</pre>
<pre>&lt;hibernate-mapping default-lazy="false" &gt; 

   &lt;class name="org.myapp.ho.Child" table="Child"&gt;
      <strong>&lt;cache usage="read-only" /&gt;</strong>
      &lt;id name="id" type="Integer" column="ID" /&gt; 

   &lt;/class&gt; 

&lt;/hibernate-mapping&gt;</pre>
<p>Note that we have used the cache setting at 3 places:</p>
<p> 1) The org.myapp.ho.Parent object</p>
<p> 2) The &#8220;myChildren&#8221; collection in the org.myapp.ho.Parent object</p>
<p> 3) The org.myapp.ho.Child object</p>
<p>When you configure a collection to be second level cached in Hibernate, it internally maintains a SEPERATE cache for these collection than the one which it uses to cache the parent objects. So in the example above, the &#8220;myChildren&#8221; will be cached separately than the org.myapp.ho.Parent object.</p>
<p> There might be cases where applications would want to evict objects from the cache. If its the Session cache from which the application has to evict the object then the call to Session.evict will cascade even to collections and will evict the collection from the *Session cache*. However, if the object(and the collections contained in it) have to be evicted from the second level cache, then the application has to *explicitly* call the evictCollection method on the SessionFactory to remove the *collection* contained in the Parent object. The reason behind this is, as already mentioned, the collections are cached separately, than the parent objects, in the second level cache.</p>
<p>So, in our example above, if we have to evict the Parent with id 500 and its collection from the second level cache, then here&#8217;s what has to be done:</p>
<p><font color="#a52a2a">SessionFactory sf = MyUtil.getSessionFactory();</font></p>
<p><font color="#a52a2a">sf.evict(org.myapp.ho.Parent.class,new Integer(500));</font> //this will evict the Parent Object from the second level cache</p>
<p><font color="#a52a2a">sf.evictCollection(org.myapp.ho.Parent.class.getName() +  &#8220;.myChildren&#8221;, new Integer(500));</font> //this will evict the collection from the second level cache for the Parent with id=500</p>
<p>The first parameter to the evictCollection method is the &#8216;roleName&#8217; of the collection. The roleName is formed as follows:</p>
<p>roleName = NameOfTheParentClass + &#8220;.&#8221; + NameOfTheCollectionInsideTheParent</p>
<p>The second parameter the evictCollection method is the id of the parent object, to which this collection belongs.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jaikiran.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jaikiran.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaikiran.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaikiran.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaikiran.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaikiran.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jaikiran.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jaikiran.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jaikiran.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jaikiran.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaikiran.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaikiran.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaikiran.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaikiran.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaikiran.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaikiran.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=17&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jaikiran.wordpress.com/2006/08/17/evict-collection-from-hibernate-second-level-cache/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/53d825816593839f037b235d897aaaef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jaikiran</media:title>
		</media:content>
	</item>
		<item>
		<title>Custom reverse engineering strategy in Hibernate</title>
		<link>http://jaikiran.wordpress.com/2006/07/31/custom-reverse-engineering-strategy-in-hibernate/</link>
		<comments>http://jaikiran.wordpress.com/2006/07/31/custom-reverse-engineering-strategy-in-hibernate/#comments</comments>
		<pubDate>Mon, 31 Jul 2006 10:12:30 +0000</pubDate>
		<dc:creator>jaikiran</dc:creator>
				<category><![CDATA[Hibernate]]></category>

		<guid isPermaLink="false">https://jaikiran.wordpress.com/2006/07/31/custom-reverse-engineering-strategy-in-hibernate/</guid>
		<description><![CDATA[Hibernate has tools to create mapping files(hbm files) and domain model classes from database schemas(reverse engineering). &#60;jdbcconfguration&#62; can be used as part of ant task to do this. Hibernate creates the property names using its default reverse engineering strategy. Hibernate also, provides a way through which the user can specify his own custom reverse engineering strategy through which he [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=16&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://www.hibernate.org/">Hibernate</a> has tools to create mapping files(hbm files) and domain model classes from database schemas(reverse engineering). <a target="_blank" href="http://www.hibernate.org/hib_docs/tools/reference/en/html_single/#d0e871">&lt;jdbcconfguration&gt;</a> can be used as part of ant task to do this. Hibernate creates the property names using its default reverse engineering strategy. Hibernate also, provides a way through which the user can specify his own custom reverse engineering strategy through which he can follow his own naming conventions etc&#8230;</p>
<p>There is a <font face="Courier New">reversestrategy</font> attribute which can be set to some custom class, which implements <font face="Courier New">org.hibernate.cfg.reveng.ReverseEngineeringStrategy, </font><font face="Verdana">in the &lt;jdbcconfiguration&gt;. Here&#8217;s an example:</font></p>
<pre>&lt;jdbcconfiguration configurationfile="hibernate.cfg.xml"  

    packagename="${package.name}"  

    revengfile="hibernate.reveng.xml"  

    <strong>reversestrategy="org.myapp.hibernate.tool.SampleReverseEngineeringStrategy"</strong>/&gt;</pre>
<p>The org.myapp.hibernate.tool.SampleReverseEngineeringStrategy is our own custom class which implements org.hibernate.cfg.reveng.ReverseEngineeringStrategy. In this example, our SampleReverseEngineeringStrategy, overrides the columnToPropertyName(TableIdentifier table, String column) method to provide a custom implementation for generating property names out of a column name. Here&#8217;s the SampleReverseEngineeringStrategy code:</p>
<pre>package org.myapp.hibernate.tool;  

import java.util.regex.Matcher;  

import java.util.regex.Pattern;  

import org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy;  

import org.hibernate.cfg.reveng.ReverseEngineeringStrategy;  

import org.hibernate.cfg.reveng.TableIdentifier;  

/**  

 *  

 * @author Jaikiran Pai  

 *  

 */  

public class SampleReverseEngineeringStrategy extends DelegatingReverseEngineeringStrategy {  

/**  

  * Constructor  

  *  

  * @param delegate <a href="mailto:{@link">{@link</a> org.hibernate.cfg.reveng.ReverseEngineeringStrategy}  

  */  

 public SampleReverseEngineeringStrategy(ReverseEngineeringStrategy delegate) {  

  super(delegate);  

 }  

/**  

  * Changes the default behaviour of naming the property. &lt;br&gt;  

  * Does the following replacements(not neccessarily in the order) and returns the resulting  

  * <a href="mailto:{@link">{@link</a> String} as property name  

  *  

  * &lt;ul&gt;  

  *  &lt;li&gt;Converts the first letter of the &lt;code&gt;column&lt;/code&gt; to uppercase&lt;/li&gt;  

  *  &lt;li&gt;Converts the letters following a '_' character to uppercase in the &lt;code&gt;column&lt;/code&gt;&lt;/li&gt;  

  *  &lt;li&gt;Removes any underscores present from &lt;code&gt;column&lt;/code&gt;&lt;/li&gt;  

  * &lt;/ul&gt;  

  *   

  *  

  * @see org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy  

  * @see org.hibernate.cfg.reveng.ReverseEngineeringStrategy  

  *  

  * @param table <a href="mailto:{@link">{@link</a> TableIdentifier}  

  * @param column  

  * @return Returns the propert name after converting it appropriately  

  */  

<strong>public String columnToPropertyName(TableIdentifier table, String column)</strong> {  

    

  String replacedColumn = replaceFirstLetterToUpperCase(column);  

    

  replacedColumn = removeUnderScoresAndConvertNextLetterToUpperCase(replacedColumn);  

  if (anyReplacementsMadeToOriginalColumnName(column,replacedColumn)) {  

   return replacedColumn;  

  }  

  /*  

   * Let DelegatingReverseEngineeringStrategy handle this  

   */  

  return super.columnToPropertyName(table, column);  

    

 }  

   

 /**  

  *  

  * Returns true if the &lt;code&gt;originalString&lt;/code&gt; and &lt;code&gt;replacedString&lt;/code&gt; are NOT equal  

  * (meaning there was some replacement done to the original column name). Else returns false. &lt;br/&gt;  

  *  

  * @param originalString The original column name  

  * @param replacedString The column name after doing necessary replacements  

  * @return Returns true if the &lt;code&gt;originalString&lt;/code&gt; and &lt;code&gt;replacedString&lt;/code&gt; are NOT equal  

  * (meaning there was some replacement done to the original column name). Else returns false.  

  *   

  * @throws <a href="mailto:{@link">{@link</a> NullPointerException} if &lt;code&gt;originalString&lt;/code&gt; is null.  

  */  

 protected boolean anyReplacementsMadeToOriginalColumnName(String originalString, String replacedString) {  

  if (originalString.equals(replacedString)) {  

   return false;  

  }  

  return true;  

 }  

   

 /**  

  * Converts the first letter of the &lt;code&gt;input&lt;/code&gt; to uppercase and  

  * returns the resultant <a href="mailto:{@link">{@link</a> String}.&lt;br/&gt;  

  * &lt;p&gt;  

  * Ex: If the &lt;code&gt;input&lt;/code&gt; is startDate then the resulting <a href="mailto:{@link">{@link</a> String}  

  * after replacement will be StartDate  

  * &lt;/p&gt;  

  *  

  * @param input The <a href="mailto:{@link">{@link</a> String} whose contents have to be replaced  

  * @return Returns a <a href="mailto:{@link">{@link</a> String} after doing the appropriate replacements  

  */  

 protected String replaceFirstLetterToUpperCase(String input) {  

  /*  

   * The pattern to match a String starting with lower case  

   */  

  final String startsWithLowerCasePattern = "^[a-z]";  

  Pattern patternForReplacingLowerCase = Pattern.compile(startsWithLowerCasePattern);  

        Matcher regexMatcher = patternForReplacingLowerCase.matcher(input);  

        /*  

         * This will hold the replaced contents  

         */  

        StringBuffer replacedContents = new StringBuffer();  

        /*  

         * Check whether the first letter starts with lowercase.  

         * If yes, change it to uppercase, else pass on the control to  

         * DelegatingReverseEngineeringStrategy  

         *  

         */  

        if (regexMatcher.find()) {  

         String firstCharacter = regexMatcher.group();  

         /*  

          * Convert it to uppercase  

          */  

         regexMatcher.appendReplacement(replacedContents,firstCharacter.toUpperCase());  

         regexMatcher.appendTail(replacedContents);  

            regexMatcher.reset();  

            /*  

             * Return the replaced contents  

             */  

   return replacedContents.toString();  

  }  

        //no replacements to do, just return the original input  

        return input;  

         

 }  

   

<strong> </strong>/**  

  * Converts the letters following a '_' character to uppercase and also removes  

  * the '_' character from the &lt;code&gt;input&lt;/code&gt; and returns the resulting <a href="mailto:{@link">{@link</a> String}. &lt;br/&gt;  

  * Carries out a 2 pass strategy to do the replacements. During the first pass,  

  * replaces all the letters that immidiately follow a '_' to uppercase.  

  * &lt;p&gt;  

  * Ex: If the &lt;code&gt;input&lt;/code&gt; is _start_Date__today_ then after the first pass of replacement, the  

  * resultant string will be _Start_Date__Today_  

  * &lt;/p&gt;  

  * &lt;p&gt;  

  * This replaced <a href="mailto:{@link">{@link</a> String} is then passed ahead for second pass (if no replacements were  

  * done during first pass, then the original <a href="mailto:{@link">{@link</a> String} is passed). During the second pass  

  * the underscores are removed.  

  * &lt;/p&gt;  

  * &lt;p&gt;  

  * Ex: If the &lt;code&gt;input&lt;/code&gt; is _start_Date__today_ then after BOTH the passes the  

  * resultant string will be StartDateToday  

  * &lt;/p&gt;  

  *  

  * @param input The <a href="mailto:{@link">{@link</a> String} whose contents have to be replaced  

  * @return Returns a <a href="mailto:{@link">{@link</a> String} after doing the appropriate replacements  

  */  

 protected String removeUnderScoresAndConvertNextLetterToUpperCase(String input) {  

  /*  

   * The pattern which matches a String that starts with a letter immidiately after  

   * a '_' character  

   */  

  final String stringFollowingUnderScore = "[.]*_[a-zA-Z]+";  

  Pattern patternForReplacingLowerCase = Pattern.compile(stringFollowingUnderScore);  

        Matcher regexMatcher = patternForReplacingLowerCase.matcher(input);  

        /*  

         * This will hold the replaced contents  

         */  

        StringBuffer replacedContents = new StringBuffer();  

        boolean foundAnyMatch = false;  

        while (regexMatcher.find()) {  

         foundAnyMatch = true;  

      String matchedString = regexMatcher.group();  

      /*  

       * The character immidiately following the underscore  

       * Example:  

       * If matchedString is _tMn then originalCharAfterUnderScore will be the  

       * character t  

       */  

      char originalCharAfterUnderScore = matchedString.charAt(1);  

      /*  

       * Convert the character to uppercase  

       */  

      String replacedCharAfterUnderScore = String.valueOf(originalCharAfterUnderScore).toUpperCase();  

      /*  

       * Now place this replaced character back into the matchedString  

       */  

      String replacement = matchedString.replace(originalCharAfterUnderScore,replacedCharAfterUnderScore.charAt(0));  

      /*  

       * Append this to the replacedColumn, which will be returned back to the user  

       */  

      regexMatcher.appendReplacement(replacedContents,replacement);  

    }  

        regexMatcher.appendTail(replacedContents);  

     regexMatcher.reset();  

       

     /*  

      * Now the input string has been replaced to contain uppercase letters after the underscore.  

      * Ex: If input string was "_start_Date_today" then at this point after the above processing,  

      * the replaced string will be "_Start_Date_Today"  

      * The only thing that remains now is to remove the underscores from the input string.  

      * The following statements do this part.  

      *  

      */  

     if (foundAnyMatch) {  

      return removeUnderScores(replacedContents.toString());  

  } else {  

   return removeUnderScores(input);  

  }  

       

 }  

   

<strong> </strong>/**  

  * Removes any underscores present from &lt;code&gt;input&lt;/code&gt; and returns the  

  * resulting <a href="mailto:{@link">{@link</a> String}  

  * &lt;p&gt;  

  * Ex: If the &lt;code&gt;input&lt;/code&gt; is _start_Date__today_ then the resulting <a href="mailto:{@link">{@link</a> String}  

  * after replacement will be startDatetoday  

  * &lt;/p&gt;  

  *  

  * @param input The <a href="mailto:{@link">{@link</a> String} whose contents have to be replaced  

  * @return Returns a <a href="mailto:{@link">{@link</a> String} after doing the appropriate replacements  

  */  

 protected String removeUnderScores(String input) {  

  /*  

   * Pattern for matching underscores  

   */  

  Pattern patternForUnderScore = Pattern.compile("[.]*_[.]*");  

  Matcher regexMatcher = patternForUnderScore.matcher(input);  

  /*  

   * This will hold the return value  

   */  

  StringBuffer returnVal = new StringBuffer();  

     boolean foundAnyMatch = false;  

     while (regexMatcher.find()) {  

      foundAnyMatch = true;  

   String matchedString = regexMatcher.group();  

   /*  

    * Remove the underscore  

    */  

   regexMatcher.appendReplacement(returnVal,"");  

     }  

     regexMatcher.appendTail(returnVal);  

     regexMatcher.reset();  

     /*  

      * If any match was found(and replaced) then return the replaced string.  

      * Else return the original input.  

      */  

     if (foundAnyMatch) {  

      return returnVal.toString();  

     }  

       

     return input;  

 }  

    

    

}</pre>
<p>In the example above, the columnToPropertyName method is overridden to do the following:</p>
<p>- Creates property names that start with a Capital case(By default, Hibernate creates property names in camel-case)</p>
<p>- Converts the letter, that follows a &#8216;_&#8217; (underscore character) to uppercase in the property name</p>
<p>- Removes any underscores in the property name</p>
<p>Ex: If the column name is start_Date_today, then the resulting property name after using the SampleReverseEngineeringStrategy would be StartDateToday.</p>
<p>Here&#8217;s a documentation from Hibernate about <a target="_blank" href="http://www.hibernate.org/hib_docs/tools/reference/en/html/reverseengineering.html">Controlling Reverse Engineering</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jaikiran.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jaikiran.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaikiran.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaikiran.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaikiran.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaikiran.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jaikiran.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jaikiran.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jaikiran.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jaikiran.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaikiran.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaikiran.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaikiran.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaikiran.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaikiran.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaikiran.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=16&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jaikiran.wordpress.com/2006/07/31/custom-reverse-engineering-strategy-in-hibernate/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/53d825816593839f037b235d897aaaef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jaikiran</media:title>
		</media:content>
	</item>
		<item>
		<title>Convert exception stacktrace to String object</title>
		<link>http://jaikiran.wordpress.com/2006/07/25/convert-exception-stacktrace-to-string-object/</link>
		<comments>http://jaikiran.wordpress.com/2006/07/25/convert-exception-stacktrace-to-string-object/#comments</comments>
		<pubDate>Tue, 25 Jul 2006 12:31:18 +0000</pubDate>
		<dc:creator>jaikiran</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">https://jaikiran.wordpress.com/2006/07/25/convert-exception-stacktrace-to-string-object/</guid>
		<description><![CDATA[Usually whenever a exception occurs, we use the method printStackTrace() on the exception object to display the stacktrace. However, if the stacktrace has to be stored into a String  object then the following piece of code will prove handy:   /**      * Creates and returns a {@link java.lang.String} from &#60;code&#62;t&#60;/code&#62;&#8217;s stacktrace       * @param t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=15&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Usually whenever a exception occurs, we use the method <a target="_blank" href="http://www.scit.wlv.ac.uk/appdocs/java/api/java/lang/Throwable.html#printStackTrace()">printStackTrace()</a> on the exception object to display the stacktrace. However, if the stacktrace has to be stored into a <a target="_blank" href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html">String </a> object then the following piece of code will prove handy:</p>
<p><font color="#a52a2a">  /**<br />
     * Creates and returns a <a href="mailto:{@link">{@link</a> java.lang.String} from &lt;code&gt;t&lt;/code&gt;&#8217;s stacktrace <br />
     * @param t Throwable whose stack trace is required<br />
     * @return String representing the stack trace of the exception<br />
     */<br />
    public String getStackTrace(Throwable t) {<br />
        StringWriter stringWritter = new StringWriter();<br />
        PrintWriter printWritter = new PrintWriter(stringWritter, true);<br />
        t.printStackTrace(printWritter);<br />
        printWritter.flush();<br />
        stringWritter.flush();</font><font color="#a52a2a"> </font></p>
<p><font color="#a52a2a">       return stringWritter.toString();<br />
    }</font><font color="#a52a2a"><a target="_blank" href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html"></a></font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jaikiran.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jaikiran.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaikiran.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaikiran.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaikiran.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaikiran.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jaikiran.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jaikiran.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jaikiran.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jaikiran.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaikiran.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaikiran.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaikiran.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaikiran.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaikiran.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaikiran.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=15&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jaikiran.wordpress.com/2006/07/25/convert-exception-stacktrace-to-string-object/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/53d825816593839f037b235d897aaaef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jaikiran</media:title>
		</media:content>
	</item>
		<item>
		<title>How to enable Garbage Collection (GC) logs</title>
		<link>http://jaikiran.wordpress.com/2006/07/25/how-to-enable-garbage-collection-gc-logs/</link>
		<comments>http://jaikiran.wordpress.com/2006/07/25/how-to-enable-garbage-collection-gc-logs/#comments</comments>
		<pubDate>Tue, 25 Jul 2006 10:19:26 +0000</pubDate>
		<dc:creator>jaikiran</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">https://jaikiran.wordpress.com/2006/07/25/how-to-enable-garbage-collection-gc-logs/</guid>
		<description><![CDATA[To enable GC logs, the -Xloggc:logFileName option will have to be passed when java command is being executed. Additionally if the detailed log of the GC is required, then an additional -XX:+PrintGCDetails option will have to be passed. Example: java -Xloggc:D:/log/myLogFile.log -XX:+PrintGCDetails myProg<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=14&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To enable GC logs, the <font color="#a52a2a"><strong>-Xloggc:logFileName</strong></font> option will have to be passed when java command is being executed. Additionally if the detailed log of the GC is required, then an additional <font color="#a52a2a"><strong>-XX:+PrintGCDetails</strong></font> option will have to be passed.</p>
<p>Example:<font color="#a52a2a"> java -Xloggc:D:/log/myLogFile.log -XX:+PrintGCDetails</font> <font color="#a52a2a">myProg</font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jaikiran.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jaikiran.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaikiran.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaikiran.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaikiran.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaikiran.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jaikiran.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jaikiran.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jaikiran.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jaikiran.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaikiran.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaikiran.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaikiran.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaikiran.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaikiran.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaikiran.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=14&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jaikiran.wordpress.com/2006/07/25/how-to-enable-garbage-collection-gc-logs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/53d825816593839f037b235d897aaaef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jaikiran</media:title>
		</media:content>
	</item>
		<item>
		<title>Lookup an EJB from a different application, deployed on the same server, in JBoss</title>
		<link>http://jaikiran.wordpress.com/2006/07/25/lookup-an-ejb-from-a-different-application-deployed-on-the-same-server-in-jboss/</link>
		<comments>http://jaikiran.wordpress.com/2006/07/25/lookup-an-ejb-from-a-different-application-deployed-on-the-same-server-in-jboss/#comments</comments>
		<pubDate>Tue, 25 Jul 2006 07:57:00 +0000</pubDate>
		<dc:creator>jaikiran</dc:creator>
				<category><![CDATA[EJB]]></category>
		<category><![CDATA[JBoss]]></category>

		<guid isPermaLink="false">https://jaikiran.wordpress.com/2006/07/25/lookup-an-ejb-from-a-different-application-deployed-on-the-same-server-in-jboss/</guid>
		<description><![CDATA[Question: I have a web application through which i want to access an EJB which is deployed as a separate appliaction on the same server. How do i do it? Answer: In the web.xml of your war(the web application through which you want to access the EJB), have the following entry: &#60;ejb-ref&#62;     &#60;ejb-ref-name&#62;GiveAnyNameByWhichYouWouldLikeToReferTheBeanInYourWebApp&#60;/ejb-ref-name&#62;     [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=13&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Question:<br />
I have a web application through which i want to access an EJB which is deployed as a separate appliaction on the same server. How do i do it?</p>
<p>Answer:</p>
<p>In the web.xml of your war(the web application through which you want to access the EJB), have the following entry:</p>
<p><font color="#a52a2a">&lt;ejb-ref&gt;<br />
    &lt;ejb-ref-name&gt;GiveAnyNameByWhichYouWouldLikeToReferTheBeanInYourWebApp&lt;/ejb-ref-name&gt;<br />
    &lt;ejb-ref-type&gt;session&lt;/ejb-ref-type&gt;<br />
    &lt;home&gt;packageName.ClassNameOfTheHomeObjectOfTheBeanYouWantToRefer&lt;/home&gt;<br />
    &lt;remote&gt;packageName.ClassNameOfTheRemoteObjectOfTheBeanYouWantToRefer&lt;/remote&gt;<br />
  &lt;/ejb-ref&gt;<br />
 <br />
</font>  In the jboss-web.xml of your war, have the following entry:<br />
 <br />
<font color="#a52a2a">  &lt;ejb-ref&gt;<br />
    &lt;ejb-ref-name&gt;GiveAnyNameByWhichYouWouldLikeToReferTheBeanInYourWebApp(This should be same as the one given in the web.xml above)&lt;/ejb-ref-name&gt;<br />
    &lt;jndi-name&gt;TheJndiNametoWhichTheBeanIsBound(Example:somecontext/somejndiName)YouWillFindThisJndiNameInTheJboss.xmlOfTheEJB&lt;/jndi-name&gt;<br />
   &lt;/ejb-ref&gt;<br />
   <br />
</font>For more info, have a look at the dtds of web.xml (<a href="http://java.sun.com/dtd/web-app_2_3.dtd">http://java.sun.com/dtd/web-app_2_3.dtd</a>) and jboss-web.xml(<a href="http://www.jboss.org/j2ee/dtd">http://www.jboss.org/j2ee/dtd</a>)<br />
 <br />
  In your code, do the lookup as:<br />
 <br />
<font color="#a52a2a">  Context ic = new InitialContext();<br />
  Object ejbHome = ic.lookup(&#8220;java:comp/env/TheNameThatYouHadGivenInTheEJB-REF-NAMETagOfJbossWeb.xmlAbove&#8221;);</font></p>
<p>Here&#8217;s an example:</p>
<p><strong>web.xml:</strong><br />
<font color="#a52a2a">&lt;ejb-ref&gt;<br />
    &lt;ejb-ref-name&gt;MyTestBean&lt;/ejb-ref-name&gt;<br />
    &lt;ejb-ref-type&gt;session&lt;/ejb-ref-type&gt;<br />
    &lt;home&gt;com.test.ejb.MyBeanHome&lt;/home&gt;<br />
    &lt;remote&gt;com.test.ejb.MyBeanRemote&lt;/remote&gt;<br />
  &lt;/ejb-ref&gt;</font></p>
<p><strong>jboss-web.xml:</strong><br />
 <font color="#a52a2a">&lt;ejb-ref&gt;<br />
  &lt;ejb-ref-name&gt;MyTestBean&lt;/ejb-ref-name&gt;<br />
  &lt;jndi-name&gt;myejb/test/MyTestBean&lt;/jndi-name&gt;<br />
 &lt;/ejb-ref&gt;<br />
</font> <br />
<strong>Lookup code:</strong></p>
<p><font color="#a52a2a">Context ic = new InitialContext();<br />
  Object ejbHome = ic.lookup(&#8220;java:comp/env/MyTestBean&#8221;);<br />
</font> </p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jaikiran.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jaikiran.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaikiran.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaikiran.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaikiran.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaikiran.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jaikiran.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jaikiran.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jaikiran.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jaikiran.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaikiran.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaikiran.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaikiran.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaikiran.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaikiran.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaikiran.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=13&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jaikiran.wordpress.com/2006/07/25/lookup-an-ejb-from-a-different-application-deployed-on-the-same-server-in-jboss/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/53d825816593839f037b235d897aaaef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jaikiran</media:title>
		</media:content>
	</item>
		<item>
		<title>How to create a Queue/Topic in JBoss?</title>
		<link>http://jaikiran.wordpress.com/2006/07/24/how-to-create-a-queuetopic-in-jboss/</link>
		<comments>http://jaikiran.wordpress.com/2006/07/24/how-to-create-a-queuetopic-in-jboss/#comments</comments>
		<pubDate>Mon, 24 Jul 2006 09:09:24 +0000</pubDate>
		<dc:creator>jaikiran</dc:creator>
				<category><![CDATA[JBoss]]></category>
		<category><![CDATA[JMS]]></category>

		<guid isPermaLink="false">https://jaikiran.wordpress.com/2006/07/24/how-to-create-a-queuetopic-in-jboss/</guid>
		<description><![CDATA[Queues/Topics are known as administered objects and in jboss they can be deployed through ServiceDotXml files. Let&#8217;s name our file, myapp-destination-service.xml. The contents of the file should look like: &#60;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&#62; &#60;server&#62;    &#60;!&#8211;My queue, named: myAppQueue &#8211;&#62;   &#60;mbean code=&#8221;org.jboss.mq.server.jmx.Queue&#8221;   name=&#8221;jboss.mq.destination:service=Queue,name=myAppQueue&#8220;&#62;     &#60;depends optional-attribute-name=&#8221;DestinationManager&#8221;&#62;jboss.mq:service=DestinationManager&#60;/depends&#62;   &#60;/mbean&#62;    &#60;!&#8211; My topic, named: myAppTopic &#8211;&#62;   &#60;mbean [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=12&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Queues/Topics are known as administered objects and in jboss they can be deployed through <a target="_blank" href="http://wiki.jboss.org/wiki/Wiki.jsp?page=SERVICEdotXML">ServiceDotXml</a> files. Let&#8217;s name our file, <strong>myapp-destination-service.xml</strong>. The contents of the file should look like:</p>
<p><font color="#a52a2a">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;</font></p>
<p><font color="#a52a2a">&lt;server&gt;<br />
   &lt;!&#8211;My queue, named: myAppQueue &#8211;&gt;<br />
  &lt;mbean code=&#8221;org.jboss.mq.server.jmx.Queue&#8221;<br />
  name=&#8221;jboss.mq.destination:service=Queue,name=<strong>myAppQueue</strong>&#8220;&gt;<br />
    &lt;depends optional-attribute-name=&#8221;DestinationManager&#8221;&gt;jboss.mq:service=DestinationManager&lt;/depends&gt;<br />
  &lt;/mbean&gt;<br />
  </font><font color="#a52a2a"> &lt;!&#8211; My topic, named: myAppTopic &#8211;&gt;<br />
  &lt;mbean code=&#8221;org.jboss.mq.server.jmx.Topic&#8221;<br />
  name=&#8221;jboss.mq.destination:service=Topic,name=<strong>myAppTopic</strong>&#8220;&gt;<br />
    &lt;depends optional-attribute-name=&#8221;DestinationManager&#8221;&gt;jboss.mq:service=DestinationManager&lt;/depends&gt;<br />
  &lt;/mbean&gt;<br />
  <br />
    <br />
  &lt;/server&gt;</font></p>
<p> Place this file in your %JBOSS_HOME%/server/default/deploy directory and start the server.(Note: If you are using the &#8216;all&#8217; configuration or the &#8216;minimal&#8217; configuration then you will have to place this file in the %JBOSS_HOME%/server/all/deploy  or %JBOSS_HOME%/server/minimal/deploy   directory, as appropriate).</p>
<p>The above queue/topic will be bound to the jndi name: <font color="#a52a2a">queue/myAppQueue</font> and <font color="#a52a2a">topic/myAppTopic</font> respectively.</p>
<p>Note:</p>
<p>1) The above file is meant for JBoss-3.2.3. Though there might be slight changes to later versions of JBoss, the basic configuration mechanism remains the same.</p>
<p>2) JBoss also comes with preconfigured queues/topics. These configurations can be found in the <strong>jbossmq-destinations-service.xml </strong>file which is present in %JBOSS_HOME%/server/default/deploy/jms directory</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jaikiran.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jaikiran.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaikiran.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaikiran.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaikiran.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaikiran.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jaikiran.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jaikiran.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jaikiran.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jaikiran.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaikiran.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaikiran.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaikiran.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaikiran.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaikiran.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaikiran.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=12&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jaikiran.wordpress.com/2006/07/24/how-to-create-a-queuetopic-in-jboss/feed/</wfw:commentRss>
		<slash:comments>120</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/53d825816593839f037b235d897aaaef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jaikiran</media:title>
		</media:content>
	</item>
		<item>
		<title>Create your own logging level in log4j</title>
		<link>http://jaikiran.wordpress.com/2006/07/12/create-your-own-logging-level-in-log4j/</link>
		<comments>http://jaikiran.wordpress.com/2006/07/12/create-your-own-logging-level-in-log4j/#comments</comments>
		<pubDate>Wed, 12 Jul 2006 02:22:00 +0000</pubDate>
		<dc:creator>jaikiran</dc:creator>
				<category><![CDATA[Log4j]]></category>

		<guid isPermaLink="false">https://jaikiran.wordpress.com/2006/07/12/create-your-own-logging-level-in-log4j/</guid>
		<description><![CDATA[If you need to add your own logging level in log4j, then you can do it as follows. You will have to create your own class which will extend from Level. Here&#8217;s a sample code for the same: MyTraceLevel.java: package org.myapp.log; import org.apache.log4j.Level; /**  * My own {@link org.apache.log4j.Level} for logging.  *  * @author Jaikiran [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=11&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font size="2">If you need to add your own logging level in log4j, then you can do it as follows. You will have to create your own class which will extend from <a href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/Level.html">Level</a>. Here&#8217;s a sample code for the same:</font></p>
<p><font size="3"><strong>MyTraceLevel.java:</strong></font><font size="3"> </font><font size="3" color="#a52a2a"></p>
<pre>package org.myapp.log;</pre>
<pre>import org.apache.log4j.Level;</pre>
<pre>/**
 * My own <a href="mailto:{@link">{@link</a> org.apache.log4j.Level} for logging.
 *
 * @author Jaikiran Pai
 *
 */
public class MyTraceLevel extends Level {
   
    /**
     * Value of my trace level. This value is lesser than <a href="mailto:{@link">{@link</a> org.apache.log4j.Priority#DEBUG_INT}
     * and higher than <a href="mailto:{@link">{@link</a> org.apache.log4j.Level#TRACE_INT}
     */
    public static final int MY_TRACE_INT = DEBUG_INT - 10;
   
    /**
     * <a href="mailto:{@link">{@link</a> Level} representing my log level
     */
    public static final Level MY_TRACE = new MyTraceLevel(MY_TRACE_INT,"MY_TRACE",7);</pre>
<pre>    /**
     * Constructor
     *
     * @param arg0
     * @param arg1
     * @param arg2
     */
    protected MyTraceLevel(int arg0, String arg1, int arg2) {
        super(arg0, arg1, arg2);</pre>
<pre>    }
   
    /**
     * Checks whether &lt;code&gt;sArg&lt;/code&gt; is "MY_TRACE" level. If yes then returns <a href="mailto:{@link">{@link</a> MyTraceLevel#MY_TRACE},
     * else calls <a href="mailto:{@link">{@link</a> MyTraceLevel#toLevel(String, Level)} passing it <a href="mailto:{@link">{@link</a> Level#DEBUG} as the defaultLevel
     *
     * @see Level#toLevel(java.lang.String)
     * @see Level#toLevel(java.lang.String, org.apache.log4j.Level)
     *
     */
    public static Level toLevel(String sArg) {
        if (sArg != null &amp;&amp; sArg.toUpperCase().equals("MY_TRACE")) {
            return MY_TRACE;
        }
        return (Level) toLevel(sArg, Level.DEBUG);
    }</pre>
<pre>    /**
     * Checks whether &lt;code&gt;val&lt;/code&gt; is <a href="mailto:{@link">{@link</a> MyTraceLevel#MY_TRACE_INT}. If yes then returns <a href="mailto:{@link">{@link</a> MyTraceLevel#MY_TRACE},
     * else calls <a href="mailto:{@link">{@link</a> MyTraceLevel#toLevel(int, Level)} passing it <a href="mailto:{@link">{@link</a> Level#DEBUG} as the defaultLevel
     *
     * @see Level#toLevel(int)
     * @see Level#toLevel(int, org.apache.log4j.Level)
     *
     */
    public static Level toLevel(int val) {
        if (val == MY_TRACE_INT) {
            return MY_TRACE;
        }
        return (Level) toLevel(val, Level.DEBUG);
    }</pre>
<pre>    /**
     * Checks whether &lt;code&gt;val&lt;/code&gt; is <a href="mailto:{@link">{@link</a> MyTraceLevel#MY_TRACE_INT}. If yes then returns <a href="mailto:{@link">{@link</a> MyTraceLevel#MY_TRACE},
     * else calls <a href="mailto:{@link">{@link</a> Level#toLevel(int, org.apache.log4j.Level)}
     *
     * @see Level#toLevel(int, org.apache.log4j.Level)
     */
    public static Level toLevel(int val, Level defaultLevel) {
        if (val == MY_TRACE_INT) {
            return MY_TRACE;
        }
        return Level.toLevel(val,defaultLevel);
    }</pre>
<pre>    /**
     * Checks whether &lt;code&gt;sArg&lt;/code&gt; is "MY_TRACE" level. If yes then returns <a href="mailto:{@link">{@link</a> MyTraceLevel#MY_TRACE},
     * else calls <a href="mailto:{@link">{@link</a> Level#toLevel(java.lang.String, org.apache.log4j.Level)}
     *
     * @see Level#toLevel(java.lang.String, org.apache.log4j.Level)
     */
    public static Level toLevel(String sArg, Level defaultLevel) {                 
    if(sArg != null &amp;&amp; sArg.toUpperCase().equals("MY_TRACE")) {
        return MY_TRACE;
    }
    return Level.toLevel(sArg,defaultLevel);
 }
   
}</pre>
<pre> </pre>
<p></font><font size="2">Now here&#8217;s the log4j.xml configuration file:</font></p>
<pre><font size="2" color="#a52a2a">&lt;?xml version="1.0" encoding="UTF-8"?&gt;            

&lt;!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"&gt;            

&lt;!-- ===================================================================== --&gt;            

&lt;!-- --&gt;            

&lt;!-- Log4j Configuration --&gt;            

&lt;!-- --&gt;            

&lt;!-- ===================================================================== --&gt;            

&lt;!-- $Id: log4j.xml,v 1.13.2.8 2003/09/23 14:16:27 slaboure Exp $ --&gt;            

&lt;!--            

| For more configuration infromation and examples see the Jakarta Log4j            

| owebsite: http://jakarta.apache.org/log4j            

--&gt;            

&lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false"&gt;            

&lt;!-- ================================= --&gt;            

&lt;!-- Preserve messages in a local file --&gt;            

&lt;!-- ================================= --&gt;            

&lt;!-- A size based rolling appender --&gt;            

&lt;appender name="FILE" class="org.apache.log4j.FileAppender"&gt;            

&lt;param name="File" value="D:/log/myLogFile.log"/&gt;            

&lt;param name="Append" value="false"/&gt;            

&lt;layout class="org.apache.log4j.PatternLayout"&gt;            

&lt;param name="ConversionPattern" value="%d{ISO8601} %-5p [%c] %m%n"/&gt;            

&lt;/layout&gt;            

&lt;/appender&gt;            

&lt;!-- ============================== --&gt;            

&lt;!-- Append messages to the console --&gt;            

&lt;!-- ============================== --&gt;            

&lt;appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"&gt;            

&lt;param name="Target" value="System.out"/&gt;            

&lt;param name="Threshold" value="INFO"/&gt;            

&lt;layout class="org.apache.log4j.PatternLayout"&gt;            

&lt;!-- The default pattern: Date Priority [Category] Messagen --&gt;            

&lt;param name="ConversionPattern" value="%d{ISO8601} %-5p [%c{1}] %m%n"/&gt;            

&lt;/layout&gt;            

&lt;/appender&gt;            

&lt;!-- ================ --&gt;            

&lt;!-- Limit categories --&gt;            

&lt;!-- ================ --&gt;            

<strong>&lt;category name="org.myapp"&gt;</strong>            

<strong>&lt;priority value="MY_TRACE" class="org.myapp.log.MyTraceLevel" /&gt;</strong>            

<strong>&lt;appender-ref ref="FILE"/&gt;</strong>            

<strong>&lt;/category&gt;</strong>            

&lt;!-- ======================= --&gt;            

&lt;!-- Setup the Root category --&gt;            

&lt;!-- ======================= --&gt;            

&lt;root&gt;            

&lt;appender-ref ref="CONSOLE"/&gt;            

&lt;/root&gt;            

&lt;/log4j:configuration&gt;            

</font></pre>
<p><font size="2">Here&#8217;s a test program which can be used for testing whether the new log level that you introduced is being identified or not:</font></p>
<p><font size="3"><strong>TestMyLogLevel.java:</strong></font></p>
<p><font size="2" color="#a52a2a">package org.myapp.core;</font></p>
<p><font size="2" color="#a52a2a">import org.apache.log4j.Level;<br />
import org.apache.log4j.Logger;<br />
import org.myapp.log.MyTraceLevel;</font></p>
<p><font size="2" color="#a52a2a">/**<br />
 * Tests whether the new log level <a href="mailto:{@link">{@link</a> org.myapp.log.MyTraceLevel#MY_TRACE} is working<br />
 *<br />
 * @author Jaikiran Pai<br />
 *<br />
 */<br />
public class TestMyLogLevel {</font></p>
<p><font size="2" color="#a52a2a">    /**<br />
     * Writes a log message with <a href="mailto:{@link">{@link</a> org.myapp.log.MyTraceLevel#MY_TRACE} and another message<br />
     * with <a href="mailto:{@link">{@link</a> Level#DEBUG}<br />
     *<br />
     * @param args<br />
     */<br />
    public static void main(String[] args) {<br />
        Logger logger = Logger.getLogger(TestMyLogLevel.class.getName());<br />
        System.out.println(&#8220;Got the logger. Invoking log() method&#8221;);<br />
        logger.log(MyTraceLevel.MY_TRACE,&#8221;Did i get into the log file?&#8221;);<br />
        System.out.println(&#8220;Wrote the log with my trace level&#8221;);<br />
        logger.log(Level.DEBUG ,&#8221;I am a debug message&#8221;);<br />
        System.out.println(&#8220;Wrote the log with debug level&#8221;);<br />
    }<br />
}<br />
</font><font size="2">Finally, here&#8217;s the log file that got generated:</font><br />
<font size="2" color="#a52a2a">2006-07-12 13:45:40,633 MY_TRACE [org.myapp.core.TestMyLogLevel] I am MY_TRACE log<br />
2006-07-12 13:45:40,633 DEBUG [org.myapp.core.TestMyLogLevel] I am a debug message</p>
<p></font><font size="2">Points to note:<br />
The <em>int</em> value that you specify for your log level is important. Here i have defined &#8220;MY_TRACE&#8221; log level is to be higher than the DEBUG level but lower than the TRACE level provided by log4j. So whenever you have set a priority level to DEBUG on the category(in your log4j.xml file), the MY_TRACE level logs will *NOT* make it to the log file.</font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jaikiran.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jaikiran.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaikiran.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaikiran.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaikiran.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaikiran.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jaikiran.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jaikiran.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jaikiran.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jaikiran.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaikiran.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaikiran.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaikiran.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaikiran.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaikiran.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaikiran.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=11&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jaikiran.wordpress.com/2006/07/12/create-your-own-logging-level-in-log4j/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/53d825816593839f037b235d897aaaef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jaikiran</media:title>
		</media:content>
	</item>
		<item>
		<title>I get &#8220;log4j:WARN No appenders could be found for logger&#8221; message</title>
		<link>http://jaikiran.wordpress.com/2006/07/05/i-get-log4jwarn-no-appenders-could-be-found-for-logger-message-2/</link>
		<comments>http://jaikiran.wordpress.com/2006/07/05/i-get-log4jwarn-no-appenders-could-be-found-for-logger-message-2/#comments</comments>
		<pubDate>Wed, 05 Jul 2006 07:57:00 +0000</pubDate>
		<dc:creator>jaikiran</dc:creator>
				<category><![CDATA[Log4j]]></category>

		<guid isPermaLink="false">https://jaikiran.wordpress.com/2006/07/05/i-get-log4jwarn-no-appenders-could-be-found-for-logger-message-2/</guid>
		<description><![CDATA[While using log4j in your application, sometimes you might encounter the following message: log4j:WARN No appenders could be found for logger(somePackageName.someClassName). log4j:WARN Please initialize the log4j system properly. The reason why you see this message is that your log4j configuration file(i.e. log4j.xml or log4j.properties) is NOT found in the classpath. Placing the log4j configuration file [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=10&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While using log4j in your application, sometimes you might encounter the following message:</p>
<p><strong>log4j:WARN No appenders could be found for logger(somePackageName.someClassName).<br />
log4j:WARN Please initialize the log4j system properly.</strong></p>
<p>The reason why you see this message is that your log4j configuration file(i.e. log4j.xml or log4j.properties) is NOT found in the classpath. Placing the log4j configuration file in the applications classpath should solve the issue. If you want to find out how log4j tries to configure itself, have a look at my earlier post :</p>
<p><a target="_blank()" href="http://jaitechwriteups.blogspot.com/2006/07/know-how-log4j-tries-to-configure.html">Know how log4j tries to configure itself</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jaikiran.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jaikiran.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaikiran.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaikiran.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaikiran.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaikiran.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jaikiran.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jaikiran.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jaikiran.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jaikiran.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaikiran.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaikiran.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaikiran.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaikiran.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaikiran.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaikiran.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=10&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jaikiran.wordpress.com/2006/07/05/i-get-log4jwarn-no-appenders-could-be-found-for-logger-message-2/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/53d825816593839f037b235d897aaaef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jaikiran</media:title>
		</media:content>
	</item>
		<item>
		<title>Know how log4j tries to configure itself</title>
		<link>http://jaikiran.wordpress.com/2006/07/04/know-how-log4j-tries-to-configure-itself-2/</link>
		<comments>http://jaikiran.wordpress.com/2006/07/04/know-how-log4j-tries-to-configure-itself-2/#comments</comments>
		<pubDate>Tue, 04 Jul 2006 02:44:00 +0000</pubDate>
		<dc:creator>jaikiran</dc:creator>
				<category><![CDATA[Log4j]]></category>

		<guid isPermaLink="false">https://jaikiran.wordpress.com/2006/07/04/know-how-log4j-tries-to-configure-itself-2/</guid>
		<description><![CDATA[Large number of applications use log4j for logging. Sometimes you may encounter cases where you sense that log4j is using some other configurations, other than the one that you expected it to use. You can debug the same by switching on the debug flag on log4j. Here&#8217;s how you can do it: Add -Dlog4j.debug to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=9&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Large number of applications use <a target="_blank()" href="http://logging.apache.org/log4j/docs/documentation.html">log4j</a> for logging. Sometimes you may encounter cases where you sense that log4j is using some other configurations, other than the one that you expected it to use. You can debug the same by switching on the debug flag on log4j. Here&#8217;s how you can do it:</p>
<p>Add <strong>-Dlog4j.debug</strong> to the command line. log4j will output info to std. out. telling you how it tries to configure itself.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jaikiran.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jaikiran.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jaikiran.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jaikiran.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jaikiran.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jaikiran.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jaikiran.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jaikiran.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jaikiran.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jaikiran.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jaikiran.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jaikiran.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jaikiran.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jaikiran.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jaikiran.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jaikiran.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jaikiran.wordpress.com&amp;blog=312852&amp;post=9&amp;subd=jaikiran&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jaikiran.wordpress.com/2006/07/04/know-how-log4j-tries-to-configure-itself-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/53d825816593839f037b235d897aaaef?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jaikiran</media:title>
		</media:content>
	</item>
	</channel>
</rss>
