<?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/"
	>

<channel>
	<title>CarbonRider &#187; Articles</title>
	<atom:link href="http://www.carbonrider.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.carbonrider.com</link>
	<description>You make a matrix, you define the limits.</description>
	<lastBuildDate>Thu, 19 Jan 2012 04:35:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>CXF on IBM WebSphere 7 &#8211; Deployment Pitfalls</title>
		<link>http://articles.carbonrider.com/2012/01/15/cxf-on-ibm-websphere-7-deployment-pitfalls/</link>
		<comments>http://articles.carbonrider.com/2012/01/15/cxf-on-ibm-websphere-7-deployment-pitfalls/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 06:59:15 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CXF]]></category>
		<category><![CDATA[CXF client]]></category>
		<category><![CDATA[CXF with Websphere 7]]></category>
		<category><![CDATA[websphere]]></category>
		<category><![CDATA[Websphere 7]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=570</guid>
		<description><![CDATA[Just recently I deployed CXF enabled application on websphere 7 and came across many issues. The issues were not with respect to configuration problems but were mostly related to the classes used internally by CXF (version 2.1, I guess) framework. Surpizingly these issues dont pop-up on JBoss server (Its like saying, hey look my code [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Farticles.carbonrider.com%2F2012%2F01%2F15%2Fcxf-on-ibm-websphere-7-deployment-pitfalls%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Farticles.carbonrider.com%2F2012%2F01%2F15%2Fcxf-on-ibm-websphere-7-deployment-pitfalls%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Just recently I deployed CXF enabled application on websphere 7 and came across many issues. The issues were not with respect to configuration problems but were mostly related to the classes used internally by CXF (version 2.1, I guess) framework. Surpizingly these issues dont pop-up on JBoss server (Its like saying, hey look my code works on my machine, I dont know what went wrong with yours, it simply doesn&#8217;t kick. Heard that a lot in college days <img src='http://www.carbonrider.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
<span id="more-570"></span><br />
Anyways, here are couple of issues that almost eat my brain (though first one was simple, second was disaster.)<br />
<strong>NPE (Null Pointer Exception) with method callSWARefMethod of org.apache.cxf.jaxws.interceptors.SwAOutInterceptor</strong><br />
This exception occurs at runtime, while invoking webservice using CXF client. One can simply figure out the problem by having look at what SwAoutInterceptor does. A closer look at the declaration of SWA_REF_METHOD map reveals all the answers (behavior of ConcurrentHashMap in JDK 1.6). The simple way to get rid of this exception is to upgrade CXF version. (I used CXF 2.2.10)</p>
<p><strong>Exception in thread &#8220;main&#8221; java.lang.ClassCastException: hello.mypackage.MyClass$JaxbAccessorF_someFieldID cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor </strong><br />
One more weirdo exception and I was left almost clueless as many reported this exception, but there was no proper answer as what to do to get rid of this exception.<br />
Check following exception stack trace</p>
<pre class="brush:plain;">
Exception in thread "main" java.lang.ClassCastException: hello.mypackage.MyClass$JaxbAccessorF_someFieldID cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor
    at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.instanciate(OptimizedAccessorFactory.java:199)
    at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:191)
</pre>
<p>I tried many options like using &#8220;CodeSource&#8221; to identify the JAR which loaded the class, using ClassViewer facility, changing classloader hierarchy etc. but hushhhh nothing working. Finally I replaced, JAXB libraries in my application with older version (I previously had JAXB libraries which come bundled with CXF 2.2.10 and so I reverted back JAXB version to 2.1.7).<br />
And Voila&#8230; with these two fixes my application got deployed on websphere and it worked.</p>
<p>Hope it helps!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://articles.carbonrider.com/2012/01/15/cxf-on-ibm-websphere-7-deployment-pitfalls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Guvnor 5.3.0 on Jboss-as-7 deployment</title>
		<link>http://articles.carbonrider.com/2011/11/26/guvnor-5-3-0-on-jboss-as-7-deployment/</link>
		<comments>http://articles.carbonrider.com/2011/11/26/guvnor-5-3-0-on-jboss-as-7-deployment/#comments</comments>
		<pubDate>Sat, 26 Nov 2011 14:34:49 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[drools 5]]></category>
		<category><![CDATA[guvnor 5.3]]></category>
		<category><![CDATA[guvnor 5.3 on jboss]]></category>
		<category><![CDATA[guvnor deploy failure]]></category>
		<category><![CDATA[guvnor on jboss 7]]></category>
		<category><![CDATA[jboss 7]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=562</guid>
		<description><![CDATA[Thought of getting more familiar with JBoss Drools and its web based Guvnor interface, so I downloaded Guvnor 5.3.0 (approx 360mb package) from Jboss.org. After opening the zip file, I found there are 4 war files available for getting started with Guvnor interface. The files are for following server 1. Tomcat 6 2. Jboss 5 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Farticles.carbonrider.com%2F2011%2F11%2F26%2Fguvnor-5-3-0-on-jboss-as-7-deployment%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Farticles.carbonrider.com%2F2011%2F11%2F26%2Fguvnor-5-3-0-on-jboss-as-7-deployment%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Thought of getting more familiar with JBoss Drools and its web based Guvnor interface, so I downloaded Guvnor 5.3.0 (approx 360mb package) from Jboss.org. After opening the zip file, I found there are 4 war files available for getting started with Guvnor interface. The files are for following server<br />
1. Tomcat 6<br />
2. Jboss 5<br />
3. Jboss 6<br />
4. Jboss 7<br />
I selected Jboss 7 version war file and tried to deploy on Jboss 7.0.2 Final server. Pufff&#8230; it just failed silently and gave error</p>
<pre class="brush:plain;">
18:55:33,061 ERROR [org.jboss.as.deployment] (DeploymentScanner-threads - 1) Did not receive a response to the deployment operation within the allowed timeout period [60 seconds]. Check the server configurationfile and the server logs to find more about the status of the deployment.
</pre>
<p><span id="more-562"></span><br />
The error message doesn&#8217;t signify as what went wrong with WAR deployment and the log file unfortunately doesn&#8217;t have any details either, almost Clueless&#8230;<br />
After bit googling around the web, I found quite a few posts suggesting to increasing deployment-timeout in standalone.xml file. So I changed the settings inside JBOSS_DIR/standlone/configuration/standalone.xml and it worked. <img src='http://www.carbonrider.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
If anyone interested, you can go through following steps.<br />
1. Locate standalone.xml as specified above.<br />
2. Search for
<pre class="brush:plain"><subsystem xml..="urn:jboss:domain:deployment-scanner:1.0">..</subsystem></pre>
<p>3. Add attribute
<pre class="brush:plain">deployment-timeout="600"</pre>
<p> to &#8220;deployment-scanner&#8221; element.</p>
<p>Hope this helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://articles.carbonrider.com/2011/11/26/guvnor-5-3-0-on-jboss-as-7-deployment/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Depolyment Goof up</title>
		<link>http://articles.carbonrider.com/2011/11/12/depolyment-goof-up/</link>
		<comments>http://articles.carbonrider.com/2011/11/12/depolyment-goof-up/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 06:42:16 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Deployment Goof up]]></category>
		<category><![CDATA[Drools goof up]]></category>
		<category><![CDATA[Jboss goof up]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=557</guid>
		<description><![CDATA[No, this isn&#8217;t about how to handle deployment goof ups or X things to remember before deployment. Got interested in JBoss drools and thought of downloading its components and here is what I saw.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Farticles.carbonrider.com%2F2011%2F11%2F12%2Fdepolyment-goof-up%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Farticles.carbonrider.com%2F2011%2F11%2F12%2Fdepolyment-goof-up%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>No, this isn&#8217;t about how to handle deployment goof ups or X things to remember before deployment. Got interested in JBoss drools and thought of downloading its components and here is what I saw.</p>
<div id="attachment_556" class="wp-caption alignnone" style="width: 310px"><a href="http://www.carbonrider.com/wp-content/uploads/2011/11/deploymentgoofups.png" target="_blank"><img class="size-medium wp-image-556" title="Deployment Goof ups" src="http://www.carbonrider.com/wp-content/uploads/2011/11/deploymentgoofups-300x166.png" alt="Deployment Goof ups" width="300" height="166" /></a><p class="wp-caption-text">Deployment Goof ups</p></div>
]]></content:encoded>
			<wfw:commentRss>http://articles.carbonrider.com/2011/11/12/depolyment-goof-up/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Windows 7 &#8211; Your own Desktop gadget</title>
		<link>http://articles.carbonrider.com/2011/10/09/windows-7-your-own-desktop-gadget/</link>
		<comments>http://articles.carbonrider.com/2011/10/09/windows-7-your-own-desktop-gadget/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 06:47:45 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[create gadget]]></category>
		<category><![CDATA[develop gadget]]></category>
		<category><![CDATA[develop windows 7 gadget]]></category>
		<category><![CDATA[gadget]]></category>
		<category><![CDATA[Windows 7 gadget]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=544</guid>
		<description><![CDATA[The fancy UI of Windows 7 has been around for a while now and its goodies makes it fun to work with. While there are lot of goodies you can play with, gadgets seems to be most useful component. Be it checking your system status, a world clock or weather update gadget, all of them [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Farticles.carbonrider.com%2F2011%2F10%2F09%2Fwindows-7-your-own-desktop-gadget%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Farticles.carbonrider.com%2F2011%2F10%2F09%2Fwindows-7-your-own-desktop-gadget%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>The fancy UI of Windows 7 has been around for a while now and its goodies makes it fun to work with. While there are lot of goodies you can play with, gadgets seems to be most useful component. Be it checking your system status, a world clock or weather update gadget, all of them are quite handy and useful. But have you ever thought of developing your own gadget, may be useful to track information from various sites (RSS feed). Well its not so difficult to develop one, if you know little bit about HTML and JavaScript. Yes that is all you need to create your gadget, no compilation, no special IDE, no need to learn any cryptic programming language. Just get started with Simple Text Editor and thats all you need as tool to develop one. (Well, to make it fancy you will need graphics.)<br />
<span id="more-544"></span></p>
<p>So here are the steps to develop a basic version of Windows 7 gadget.<br />
1. Locate a folder &#8220;%USERPROFILE%\AppData\Local\Microsoft\Windows Sidebar\Gadgets&#8221; in Windows Explorer (You can also locate using Run dialog, just enter above text in Run Dialog and press enter).</p>
<p>2. Create a folder &#8220;MyShell.gadget&#8221; (Note you can name this folder anything).</p>
<p>3. Create a manifest file &#8220;gadget.xml&#8221; inside the folder you just created now. This is the file which gives metadata about your gadget to Windows 7.</p>
<p>4. Add the following text to &#8220;gadget.xml&#8221; file.</p>
<pre class="brush:xml;">
<?xml version="1.0" encoding="utf-8" ?>
<gadget>
  <name>MyShell</name>
  <version>1.0.0.0</version>
  <hosts>
    <host name="sidebar">
      <base type="HTML" apiVersion="1.0.0" src="MyShell.html" />
<permissions>Full</permissions>
<platform minPlatformVersion="1.0" />
    </host>
  </hosts>
</gadget>
</pre>
<p>5. Create new file &#8220;MyShell.html&#8221; in same folder And then add the code of your choice. You can include scripts from remote location or you can create your own. I just used JQuery and its RSS plug-in to create a simple RSS gadget. Refer following code.</p>
<pre class="brush:plain">
&lt;html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=Unicode" />
<style type="text/css">
        body
        {
            margin: 0;
            width: 400px;
            height: 175px;
            font-family: arial;
            font-size: 11px;
        }
        </style>

		&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
		&lt;script src="http://www.zazar.net/developers/jquery/zrssfeed/jquery.zrssfeed.min.js" type="text/javascript"&gt;&lt;/script&gt;
        &lt;script type="text/jscript" language="jscript">
            // Initialize the gadget.
            $(document).ready(function () {
			   $('#rssFeed').rssfeed('http://www.carbonrider.com/feed/', {
				 limit: 4,
				 titletag: "span",
				 content: false
			   });
			 });
        &lt;/script&gt;

    &lt;/head>
    &lt;body>
<div id="rssFeed"></div>

    &lt;/body>
&lt;/html&gt;
</pre>
<p>6. That is all you need to do. Now save all the files and Right click on desktop and choose &#8220;Gadgets&#8221;. You should see your gadget in the list.</p>
<p>Here is the preview of My Gadget.<br />
<img src="http://www.carbonrider.com/wp-content/uploads/2011/10/win7_gadget.png" border="0"/></p>
<p>For more information about creating Gadgets, visit following site.<br />
1. <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb508509(v=VS.85).aspx" target="_blank">Microsoft</a><br/><br />
2. <a href="http://www.jquery.com" target="_blank">JQuery</a><br/><br />
3. <a href="http://www.zazar.net/developers/jquery/zrssfeed/" target="_blank">JQuery RSS Plug-in</a></p>
]]></content:encoded>
			<wfw:commentRss>http://articles.carbonrider.com/2011/10/09/windows-7-your-own-desktop-gadget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Load balancer with Apache HTTP Server 2.2 and Apache Tomcat 6</title>
		<link>http://articles.carbonrider.com/2011/10/08/load-balancer-with-apache-http-server-2-2-and-apache-tomcat-6/</link>
		<comments>http://articles.carbonrider.com/2011/10/08/load-balancer-with-apache-http-server-2-2-and-apache-tomcat-6/#comments</comments>
		<pubDate>Sat, 08 Oct 2011 16:04:52 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Apache Http Server]]></category>
		<category><![CDATA[Apache load balancer]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[concurrent requests]]></category>
		<category><![CDATA[Load balancer]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=529</guid>
		<description><![CDATA[While application gets complex and start serving concurrent users, there is always need to make maximum use of available hardware and ensure every request is served within reasonable time. While its possible to increase heap size (using Xmx, Xms options), the option is discouraged as it ends up introducing unnecessary GC pauses in JVM and [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Farticles.carbonrider.com%2F2011%2F10%2F08%2Fload-balancer-with-apache-http-server-2-2-and-apache-tomcat-6%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Farticles.carbonrider.com%2F2011%2F10%2F08%2Fload-balancer-with-apache-http-server-2-2-and-apache-tomcat-6%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>While application gets complex and start serving concurrent users, there is always need to make maximum use of available hardware and ensure every request is served within reasonable time. While its possible to increase heap size (using Xmx, Xms options), the option is discouraged as it ends up introducing unnecessary GC pauses in JVM and instead of improving application performance it will lead to serious bottlenecks. The other option would be distribute the user requests over cluster of servers and thereby ensuring the load is evenly distributed against many servers. The option will also enable maximum availability of application and will serve more requests than bombarding one server. Also the underlying OS places constraints on the resources consumed by an individual process and hence it is always recommended to distribute the job across multiple processes.<br />
<span id="more-529"></span><br />
Load balancing can give you a better option to make full use of hardware and system resources. There are numerous open source / freeware / commercial implementations are available with variety of features to meet the application requirements. While I was exploring how to configure one, I stumbled upon Apache HTTP server&#8217;s load balancing feature. Apache Load balancer provides 3 algorithms to configure the load balancing. One must carefully select the algorithm depending upon the server infrastructure otherwise the resources may remain under utilized.</p>
<p>I thought of exploring this feature and configured the basic version of Load Balancer. Here are the details for same.<br />
Environment<br />
1. Apache Http Server 2.2<br />
2. Apache Tomcat 6.0<br />
3. Eclipse 3.7 (Indigo) &#8211; (Though this doesn&#8217;t play any role in load balancing, I just used it to develop sample application.)</p>
<p>Steps to configure basic version of Load Balancer<br />
1. Create sample web application with &#8220;index.jsp&#8221; file as welcome file. Note that this is just a sample application to output response when user hits URL. Check following sample code of JSP</p>
<pre class="brush:plain;">
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

</head>
<body>
<h1>Hello World</h1>

<%
System.out.println("You called me " + System.currentTimeMillis());
%>
</body>
</html>
</pre>
<p>2. Create 3 copies of Apache Tomcat installation, refer following screenshot of what I have done.</p>
<p>3. Open &#8220;server.xml&#8221; available in &#8220;conf&#8221; folder of each Tomcat server and increment each port. This is required to ensure that when Tomcat is started on single machine, the ports doesn&#8217;t clash with each other.</p>
<p>4. Open &#8220;httpd.conf&#8221; available in &#8220;conf&#8221; folder of Apache HTTP server. Configure following lines at the end of the file.</p>
<pre class="brush:plain;">
<Proxy balancer://mycluster>
BalancerMember http://localhost:8080
BalancerMember http://localhost:8081
BalancerMember http://localhost:8082
</Proxy>
ProxyPass / balancer://mycluster/
</pre>
<p>(Note the &#8220;/&#8221; in ProxyPass statement after &#8220;mycluster&#8221;, if you remove it, you will find erroneous result.)</p>
<p>5. Locate following lines and remove the &#8220;#&#8221; in front of them.</p>
<pre class="brush:plain;">
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_http_module modules/mod_proxy_http.so
</pre>
<p>And&#8230; Woyala&#8230; you are done with basic load balancer configuration. Easy huh!<br />
Now start all Tomcat instances and then start Apache HTTP Server. Hit the browser (note you must hit the URL with port on which Apache HTTP server has been started and not Tomcat URL) and you should see something like<br />
<img src="http://www.carbonrider.com/wp-content/uploads/2011/10/load_balancer_hello_world.png" border="0"/><br />
(I have named my war as &#8220;HelloWorld.war&#8221;)</p>
<p>If you check the console, you should see something like.<br />
<strong>Tomcat instance &#8211; 1</strong><br />
<img src="http://www.carbonrider.com/wp-content/uploads/2011/10/tomcat_1.png"/><br/><br/><br />
<strong>Tomcat instance &#8211; 2</strong><br />
<img src="http://www.carbonrider.com/wp-content/uploads/2011/10/tomcat_2.png"/><br/><br/><br />
<strong>Tomcat instance &#8211; 3</strong><br />
<img src="http://www.carbonrider.com/wp-content/uploads/2011/10/tomcat_3.png"/><br/></p>
<p>For detailed configuration details on load balancing refer following URL.<br />
<a href="http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html" target="_blank">Apache Website</a></p>
<p>If you want to configure AJP version of Tomcat, check following URL<br />
<a href="http://tomcat.apache.org/tomcat-4.0-doc/config/ajp.html" target="_blank">Apache Tomcat</a><br />
<a href="http://stackoverflow.com/questions/4187973/apache-load-balancer-on-top-of-tomcat-6-missing-something-and-its-not-working" target="_blank">Stackoverflow</a></p>
]]></content:encoded>
			<wfw:commentRss>http://articles.carbonrider.com/2011/10/08/load-balancer-with-apache-http-server-2-2-and-apache-tomcat-6/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tab based browser – session handling &#8211; Part II</title>
		<link>http://articles.carbonrider.com/2011/09/24/tab-based-browser-%e2%80%93-session-handling-part-ii/</link>
		<comments>http://articles.carbonrider.com/2011/09/24/tab-based-browser-%e2%80%93-session-handling-part-ii/#comments</comments>
		<pubDate>Sat, 24 Sep 2011 08:36:49 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[session data override]]></category>
		<category><![CDATA[session handling]]></category>
		<category><![CDATA[session overriding]]></category>
		<category><![CDATA[Tab based browser]]></category>
		<category><![CDATA[tab browser session]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=519</guid>
		<description><![CDATA[In my previous article, I talked about the conceptual implementation of how one can make sure the application will work in tab based browsers. While the thoughtprocess is more at abstract level and is not attached with any real artifacts, I thought of giving it a try to check, how feasible is to implement the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Farticles.carbonrider.com%2F2011%2F09%2F24%2Ftab-based-browser-%25e2%2580%2593-session-handling-part-ii%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Farticles.carbonrider.com%2F2011%2F09%2F24%2Ftab-based-browser-%25e2%2580%2593-session-handling-part-ii%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>In my previous article, I talked about the conceptual implementation of how one can make sure the application will work in tab based browsers. While the thoughtprocess is more at abstract level and is not attached with any real artifacts, I thought of giving it a try to check, how feasible is to implement the solution. After spending couple of hours (mostly in writing testing code), I could come up with a sample which works in any tab based browsers.<br />
Though the example isn&#8217;t developed considering all the pitfalls it may face, it will give one a headstart to develop solution on their own. The solution doesn&#8217;t use any third party frameworks and purely relies on what is offerred in JEE. (I used Tomcat 6.0, Eclipse 3.7 and Java 1.6)<br />
<span id="more-519"></span><br />
The sample code consists of following artifacts<br />
<strong>Filter</strong><br />
An http request intercepting filter &#8211; responsible for performing checks like generation of Unique ID, validation (not implemented), creating wrapper request/response objects.</p>
<p><strong>Wrapper HttpRequest / HttpResponse</strong><br />
Making use of standard HttpServletRequestWrapper &amp; HttpServletResponseWrapper to override methods, which are frequently used in session manipulation.</p>
<p><strong>Wrapper HttpSession</strong><br />
Inherited from standard HttpSession interface and mostly performs delegation to underlying &#8220;composed HttpSession&#8221; object.</p>
<p><strong>Custom Tag</strong><br />
A custom JSP tag to demonstrate how to include the uid in request. I am not using JSP 2.0 tag implementation &#8211; I may append the example later to include the same.</p>
<p><strong>Sample JSP / Servlet</strong><br />
index.jsp and IndexPageServlet &#8211; purely to demonstrate there is no specific change required in order to use this implementation. One can continue to use the existing JSPs merely by replacing the URLs with custom tags. Example servlet isn&#8217;t even aware of proxied request/response.</p>
<p><strong>Configuration files (web.xml, uid-tags.tld)</strong><br />
Couple of configuration files to integrate all the pieces in one unit and make my example work.</p>
<p>Note that the solution still makes use of &#8220;HttpSession&#8221; to store/retrieve the data but just wraps the data using tokens. To make it fullproof, one need to consider all the tradeoffs of this approach &amp; application requirements and hence one may have to make considerable changes in the sample code. On top of all, the approach presented in this article may not be feasible in terms of Performance/Security or any other NFR, please discuss with experts in your region before implementing the same. I request you to share your experience on same here, this will definately help others.</p>
<p>Click on following image to download the example and related files. (Rename the .zip to .war and drop it in your application server.)<br />
<a href="http://www.carbonrider.com/wp-content/uploads/2011/09/TabSessionHandler.zip"><img src="http://www.carbonrider.com/wp-includes/images/crystal/archive.png" border="0"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://articles.carbonrider.com/2011/09/24/tab-based-browser-%e2%80%93-session-handling-part-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>M2Eclipse, Maven, Eclipse WTP and Managing Java Web Project with dependencies</title>
		<link>http://articles.carbonrider.com/2011/07/17/m2eclipse-maven-eclipse-wtp-and-managing-java-web-project-with-dependencies/</link>
		<comments>http://articles.carbonrider.com/2011/07/17/m2eclipse-maven-eclipse-wtp-and-managing-java-web-project-with-dependencies/#comments</comments>
		<pubDate>Sun, 17 Jul 2011 12:11:04 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[eclipse wtp]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[maven wtp integration]]></category>
		<category><![CDATA[sonatype wtp]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=506</guid>
		<description><![CDATA[In last article, I talked about using Eclipse plug-in provided by Maven and using it to manage the Java project dependencies. As discussed, it is quite handy and a organized way to manage the dependencies not only at the build time but while developing applications as well. [Remember developers don't have to play treasure hunt [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Farticles.carbonrider.com%2F2011%2F07%2F17%2Fm2eclipse-maven-eclipse-wtp-and-managing-java-web-project-with-dependencies%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Farticles.carbonrider.com%2F2011%2F07%2F17%2Fm2eclipse-maven-eclipse-wtp-and-managing-java-web-project-with-dependencies%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>In last article, I talked about using Eclipse plug-in provided by Maven and using it to manage the Java project dependencies. As discussed, it is quite handy and a organized way to manage the dependencies not only at the build time but while developing applications as well. [Remember developers don't have to play treasure hunt to find out which version of Jar works with which release.]</p>
<p>While the application can manage the dependencies well for non-web applications, the Eclipse WTP plug-in simply fails to recognise Maven powered web applications (Note that you can build web application using &#8220;war&#8221; packaging on command line, but Eclipse WTP simply ignores such project.)<br />
<span id="more-506"></span><br />
But to answer this problem, sonatype has created an additional plug-in which can be downloaded from</p>
<p>http://m2eclipse.sonatype.org/sites/m2e-extras/</p>
<p>Once you will add this site to Eclipse update manager, you will find list of options available in Update Manager.</p>
<div id="attachment_509" class="wp-caption alignnone" style="width: 508px"><a href="http://www.carbonrider.com/wp-content/uploads/2011/07/update_plugin_list.png"><img class="size-full wp-image-509" title="Maven Extras Plug-in" src="http://www.carbonrider.com/wp-content/uploads/2011/07/update_plugin_list.png" alt="Maven Extras Plug-in" width="498" height="170" /></a><p class="wp-caption-text">Maven Extras Plug-in</p></div>
<p>Install both the features as listed in above image and restart the Eclipse.</p>
<p>Now create a &#8220;Project&#8221; which has no nature or build profile attached and then create following structure.</p>
<div id="attachment_510" class="wp-caption alignnone" style="width: 190px"><a href="http://www.carbonrider.com/wp-content/uploads/2011/07/webapp_structure.png"><img class="size-full wp-image-510" title="Sample Eclipse Project" src="http://www.carbonrider.com/wp-content/uploads/2011/07/webapp_structure.png" alt="Sample Eclipse Project" width="180" height="146" /></a><p class="wp-caption-text">Sample Eclipse Project</p></div>
<p>Also create a Maven Script &#8220;pom.xml&#8221; file which should contain packaging tag with value as &#8220;war&#8221;. Please refer following sample POM script created by me for above project.</p>
<pre class="brush:xml">
<modelVersion>4.0.0</modelVersion>
<groupId>com.carbonrider.web</groupId>
<artifactId>MyWebApp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
  <build>
<plugins>
<plugin>
        <groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-compiler-plugin</artifactId>
	<version>2.3.2</version>
	<configuration>
	  <source>1.6</source>
	  <target>1.6</target>
	</configuration>
      </plugin>
    </plugins>
  </build>
</pre>
<p>Note that the compiler configuration shown above is purely optional, but to make sure which version of Java is used by the project, It is recommended to configure one.<br />
Then right click on your project and from the context menu select Maven &gt; Enable Dependency Management. Your project should now be configured as web project by Maven plug-in and you should see a changed with of project as</p>
<div id="attachment_508" class="wp-caption alignnone" style="width: 262px"><a href="http://www.carbonrider.com/wp-content/uploads/2011/07/maven_powered_web.png"><img class="size-full wp-image-508" title="Maven powered web project" src="http://www.carbonrider.com/wp-content/uploads/2011/07/maven_powered_web.png" alt="Maven powered web project" width="252" height="148" /></a><p class="wp-caption-text">Maven powered web project</p></div>
<p>Now go to &#8220;Servers&#8221; view and select your preferred Java Server and then add the Project to deployment. Once the project is added to the server, you should see that all your dependencies are exported to WEB-INF/lib folder, when server gets started.</p>
]]></content:encoded>
			<wfw:commentRss>http://articles.carbonrider.com/2011/07/17/m2eclipse-maven-eclipse-wtp-and-managing-java-web-project-with-dependencies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>M2Eclipse, Maven, Eclipse and Managing Java Project with dependencies</title>
		<link>http://articles.carbonrider.com/2011/07/10/m2eclipse-maven-eclipse-and-managing-java-project-with-dependencies/</link>
		<comments>http://articles.carbonrider.com/2011/07/10/m2eclipse-maven-eclipse-and-managing-java-project-with-dependencies/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 07:14:35 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Maven and Eclipse]]></category>
		<category><![CDATA[Maven dependencies]]></category>
		<category><![CDATA[Maven Eclipse plugin]]></category>
		<category><![CDATA[POM]]></category>
		<category><![CDATA[Sonatype maven plugin]]></category>
		<category><![CDATA[Sonatype plugin]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=488</guid>
		<description><![CDATA[Using Version Control System (henceforth VCS) has now become an essential part of the development life-cycle. One cannot visualize life when it comes to managing project/product releases without having well established VCS. As per my experience (and since got chance to work with only VSS and SVN, I feel SVN is the better choice &#8211; [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Farticles.carbonrider.com%2F2011%2F07%2F10%2Fm2eclipse-maven-eclipse-and-managing-java-project-with-dependencies%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Farticles.carbonrider.com%2F2011%2F07%2F10%2Fm2eclipse-maven-eclipse-and-managing-java-project-with-dependencies%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Using Version Control System (henceforth VCS) has now become an essential part of the development life-cycle. One cannot visualize life when it comes to managing project/product releases without having well established VCS. As per my experience (and since got chance to work with only VSS and SVN, I feel SVN is the better choice &#8211; simple, easy and most important free!!!).<br />
<span id="more-488"></span><br />
Well but there is one problem with both the listed VCS, both of them work pretty well on Text based files and are not meant for storing non-textual files. In day to day development environment where developers write thousands lines of code, they also make use of already written libraries to reduce the development effort and use what is already tested &amp; proven. (In Java world the libraries are available in JAR file format). While libraries are in compiled format, using VCS for storing them doesn&#8217;t sound to be good idea. In fact when it comes to following mavenised structure of branches, tags and trunks, the decision to store JAR files becomes critical and SVN seems to be not a right choice to store them. Unnecessarily copying JAR files in tags and branches would simply end up increasing repository size. Hence using special repositories like Apache Archiva for JAR files along with Maven POM scripts seems to be right choice.</p>
<p>While one can handcode the POM script using any text-based editor, it would be good to use User Interface to manage the Scripts and locate the Maven artifacts like plugins, dependencies etc. Here comes the rescue from M2Eclipse (sonatype), which provides Eclipse plugins to manage POM scripts. Well if you think, it just provides a form based interface to manage scripts and does nothing, then you must have a look at the features provided by M2Eclipse plugins.</p>
<p>Most of the time, I see developers running here and there to find out the required libraries for the project to get compile and run. The reasons could be the libraries are not stored in VCS or they are not aware of which version should be used. The chaos and time spend in resolving such issues is pretty high and unnecessary. Maven addresses these issues with the help of POM scripts which can be versioned as per release and one can be assured of versions to be used in project. But Maven alone can&#8217;t help you to manage libraries when it comes to using POM scripts while developing application in IDE like Eclipse. It cannot add libraries to project on its own and define classpath. Surely you need a plug-in which can manage the project dependencies using Maven Scripts and also free you from configuring them in project. Fortunately there are plugins which can help you to accomplish the same. Add following URL to Eclipse update manager and install the Maven Plug-in http://m2eclipse.sonatype.org/sites/m2e/</p>
<p>It won&#8217;t be possible to explain all the features provided by this plug-in in this article, there are so many sections and configurations available that one can write a book for their explanation. Lets understand the important sections required to use this plug-in in Eclipse. Once the plug-in is installed, you should see &#8220;Maven&#8221; as one of the item in Eclipse &gt; Window &gt; Preferences window.</p>
<div id="attachment_495" class="wp-caption alignnone" style="width: 645px"><a href="http://www.carbonrider.com/wp-content/uploads/2011/07/eclipse_preferences.png"><img class="size-full wp-image-495" title="Eclipse Preferences for Maven" src="http://www.carbonrider.com/wp-content/uploads/2011/07/eclipse_preferences.png" alt="Eclipse Preferences for Maven" width="635" height="590" /></a><p class="wp-caption-text">Eclipse Preferences for Maven</p></div>
<p>The next step is to configure the Maven installation in Plug-in and it can be done in Preferences window using Maven &gt; Installations and click on Add button. Point to the directory location where you have unzipped/installed Maven (I am using Maven 3 along with Apache Archiva).</p>
<p>The last step is to configure the Maven settings file in Eclipse Plug-in, so that Plug-in can use the settings that you have customized in settings.xml rather than using predefined settings. This can be done using Maven &gt; User Settings and then select the settings.xml file. (In my case the file is available in Maven installation folder &gt; conf. It is recommended to use local repository server like Apache Archiva as after the Eclipse maven plug-in is configured, it starts to index the repository to tune the search operation. If one uses default settings, the plug-in will query repo1.maven.org everytime it starts and that will take too much of time).</p>
<p>Once above configuration is done, you should be able to use Maven Eclipse plugin for your project. Create a Project using Eclipse &gt; File &gt; New &gt; Project. Note that this project should not be associated with any builder and hence I have selected &#8220;Project&#8221; instead of &#8220;Java Project&#8221;, Maven plug-in will automatically configure the required nature and builders for this project. Next step is to right click on created project and select New &gt; Other option. Search for &#8220;Maven&#8221;, you should see following options.</p>
<div id="attachment_498" class="wp-caption alignnone" style="width: 535px"><a href="http://www.carbonrider.com/wp-content/uploads/2011/07/maven_options.png"><img class="size-full wp-image-498" title="Maven options" src="http://www.carbonrider.com/wp-content/uploads/2011/07/maven_options.png" alt="Maven options" width="525" height="500" /></a><p class="wp-caption-text">Maven options</p></div>
<p>Select &#8220;Maven POM File&#8221; and click &#8220;Next&#8221;. The dialog will ask to configure POM script with options like artifactId, groupId etc. Enter the required values and choose &#8220;Jar&#8221; as packaging option. A POM.xml file will be created in your project. Double click on the POM.xml file and Eclipse will now open &#8220;Maven POM Editor&#8221;. You will find many tabs below editor screen to configure various POM Script configurations. Go to &#8220;Plugins&#8221; section and in &#8220;Plugins&#8221; panel, click Add button. You should now see a dialog box. Enter &#8220;maven-compiler&#8221; and the dialog must list matching Maven Plugins to the entered text.</p>
<div id="attachment_499" class="wp-caption alignnone" style="width: 490px"><a href="http://www.carbonrider.com/wp-content/uploads/2011/07/maven_plugin_list.png"><img class="size-full wp-image-499" title="Maven Plug-ins" src="http://www.carbonrider.com/wp-content/uploads/2011/07/maven_plugin_list.png" alt="Maven Plug-ins" width="480" height="450" /></a><p class="wp-caption-text">Maven Plug-ins</p></div>
<p>Select &#8220;2.3.2 &#8211; maven-compiler-plugin&#8230;&#8221; from given options and click OK. Now go to pom.xml tab to open the script in XML text editor mode and add following configuration to maven-compiler-plugin.</p>
<pre class="brush:xml;">
<configuration>
	<source>1.6</source>
	<target>1.6</target>
</configuration>
</pre>
<p>This is required to indicate which Java Compiler you want to use, Maven will then configure the require JRE for your project. Now create following folders one below the other &#8220;src &gt; main &gt; java&#8221; and then right click on project, locate &#8220;Maven &gt; Enable Dependency Management&#8221;. Once this option is selected, you should now see that Maven will automatically configure</p>
<div id="attachment_497" class="wp-caption alignnone" style="width: 746px"><a href="http://www.carbonrider.com/wp-content/uploads/2011/07/maven_enable_dependency.png"><img class="size-full wp-image-497" title="Enable Dependency using Maven Plug-in" src="http://www.carbonrider.com/wp-content/uploads/2011/07/maven_enable_dependency.png" alt="Enable Dependency using Maven Plug-in" width="736" height="551" /></a><p class="wp-caption-text">Enable Dependency using Maven Plug-in</p></div>
<p>1. Source Folder<br />
2. JRE<br />
3. Change project icon to indicate it is Maven and Java Project.<br />
4. A library &#8220;Maven Dependencies&#8221;</p>
<p>Now I assume that you know basics of Maven, so go ahead and add dependencies and you should see that all those libraries are now available in &#8220;Maven Dependencies&#8221; library. You don&#8217;t have to explicitly add any JAR file for your project. (For e.g. In my POM.xml file I added &#8220;commons-logging&#8221; dependency and Maven plug-in has successfully imported the Jar in project.)</p>
<div id="attachment_496" class="wp-caption alignnone" style="width: 942px"><a href="http://www.carbonrider.com/wp-content/uploads/2011/07/imported_dependencies.png"><img class="size-full wp-image-496" title="Imported Dependency" src="http://www.carbonrider.com/wp-content/uploads/2011/07/imported_dependencies.png" alt="Imported Dependency" width="932" height="350" /></a><p class="wp-caption-text">Imported Dependency</p></div>
<p>Now you can test your project by creating Java files under the package &#8220;src/main/java&#8221;. You can also execute other Maven goals on project by simply right clicking on project and from Run As options choose required option (Maven build, Maven clean, Maven package etc.)</p>
<p>The definite advantage of this approach is that now developers doesn&#8217;t have to run for locating required JAR files, one just need project source and its related POM.xml file. The Maven plug-in will automatically configure the required setting to compile and run your project. But still there is one problem when you want to develop Web Project and run it in Eclipse WTP environment (Pre-configured servers like JBoss, Tomcat etc in Eclipse environment). The WTP will not be able to identify the projects created using above steps. Well sonatype has also thought about it and has created one more plug-in to solve this problem. I will provide the details about same in next article.</p>
]]></content:encoded>
			<wfw:commentRss>http://articles.carbonrider.com/2011/07/10/m2eclipse-maven-eclipse-and-managing-java-project-with-dependencies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Archiva, The Bug Genie and Maven &#8211; Few good tools I came across</title>
		<link>http://articles.carbonrider.com/2011/05/14/apache-archiva-the-bug-genie-and-maven-few-good-tools-i-came-across/</link>
		<comments>http://articles.carbonrider.com/2011/05/14/apache-archiva-the-bug-genie-and-maven-few-good-tools-i-came-across/#comments</comments>
		<pubDate>Sat, 14 May 2011 13:34:36 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Apache Archiva]]></category>
		<category><![CDATA[Apache Maven]]></category>
		<category><![CDATA[build tool]]></category>
		<category><![CDATA[dependency management]]></category>
		<category><![CDATA[maven repository]]></category>
		<category><![CDATA[project tracking]]></category>
		<category><![CDATA[repository mangement]]></category>
		<category><![CDATA[task management]]></category>
		<category><![CDATA[task tracking]]></category>
		<category><![CDATA[The bug genie]]></category>
		<category><![CDATA[tracking]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=472</guid>
		<description><![CDATA[Before I go ahead, let me tell you this post is not about how these tools get integrated with each other. I just came across these tools and found it really useful in day to day development. Based on my experience, I found these tools are quite useful and definately worth using in project (Maven [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Farticles.carbonrider.com%2F2011%2F05%2F14%2Fapache-archiva-the-bug-genie-and-maven-few-good-tools-i-came-across%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Farticles.carbonrider.com%2F2011%2F05%2F14%2Fapache-archiva-the-bug-genie-and-maven-few-good-tools-i-came-across%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Before I go ahead, let me tell you this post is not about how these tools get integrated with each other. I just came across these tools and found it really useful in day to day development. Based on my experience, I found these tools are quite useful and definately worth using in project (Maven is already well established dependency management tool, most of you must be aware of it.)</p>
<p><span id="more-472"></span></p>
<p>I started using Apache Maven from last few days. Though I have been knowing this tool for years, I never gave it a try (Thanks to my laziness) but got curious in last few days and thought of exploring it. I visited many sites flooded with articles on Maven and how it manages dependencies that helps developers to stop worrying about downloading libraries from various places. Its lifecycle feature to manage build and generate various build related artifacts is very strong feature and I think one would find it very tedious process to perform such stuffs without maven (code analysis, code coverage, doc generation, assembly etc). Maven looks so easy, as If you want to build a JAR from existing java sources, you just have to write couple of lines and most of which are actually not related about how to build the JAR but additional information like (version, artifact id etc). If source code structure matches to Maven&#8217;s predefined structure it is just couple of lines that can compile, test, generate javadoc, generate various reports and finally package JAR. What more&#8230; It can even tag your source code, generate release and put deployable inside Repository (I just mentioned one &#8211; Archiva) so others can access it. Think about doing same stuffs, with other build tools and the script you will have to write, running into number of lines. Go ahead and explore it on <a href="http://maven.apache.org">http://maven.apache.org</a></p>
<p>Apache Archiva, is one more good tool I came across, Thanks to book &#8220;Apache Maven 2 : Effective Implmentation&#8221;. While Maven is good at managing project dependecies, Archiva is quite handy and makes nice pair with Maven, with its Repository Mangement feature. The tool is so easy that it provides web interface and you will almost require no guidance at all on how to use it (obviously you need to know basics of What is Repository? and its Role. But that just theory, the options in Archiva web interface are very well placed). Got curious, check it out at <a href="http://archiva.apache.org/">http://archiva.apache.org/</a></p>
<p>I have been looking out for some tool to manage tasks, features and enhancement. Putting all task related information like discussion, attachments, tracking status etc. And fortunately stumbled upon The Bug Genie. The name really suits to this tool as it is real Genie which has every feature you can expect from a task management tool plus it provides features like Release tracking, milestons, components, reporting etc. Quite interesting tool to use in project and yeah its free. So go ahead and give it try <a href="http://archiva.apache.org/">http://www.thebuggenie.com/</a>. Its developed in PHP (one of my fav lang <img src='http://www.carbonrider.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ), so you just require web server capable of running PHP and MySQL db.</p>
]]></content:encoded>
			<wfw:commentRss>http://articles.carbonrider.com/2011/05/14/apache-archiva-the-bug-genie-and-maven-few-good-tools-i-came-across/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring &#8211; Hibernate Annotation &#8211; Entity classes in JAR not recognised [XXX is not mapped]</title>
		<link>http://articles.carbonrider.com/2011/02/27/spring-hibernate-annotation-entity-classes-in-jar-not-recognised-xxx-is-not-mapped/</link>
		<comments>http://articles.carbonrider.com/2011/02/27/spring-hibernate-annotation-entity-classes-in-jar-not-recognised-xxx-is-not-mapped/#comments</comments>
		<pubDate>Sun, 27 Feb 2011 14:02:43 +0000</pubDate>
		<dc:creator>Carbon Rider</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Annotated Entity]]></category>
		<category><![CDATA[AnnotationSessionFactoryBean]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Hibernate Annotation]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Spring ORM]]></category>

		<guid isPermaLink="false">http://www.carbonrider.com/?p=458</guid>
		<description><![CDATA[Spring provides options to integrate many ORM frameworks available in Market and one of them is Hibernate. With the options like configuring SessionFactory and HibernateTemplate, it makes developer&#8217;s life smooth to integrate other cross cutting concerns. Amongst all the other features, Spring provides a convenient feature is to autodetect &#8220;Annotated&#8221; Entity classes from package(s) using [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Farticles.carbonrider.com%2F2011%2F02%2F27%2Fspring-hibernate-annotation-entity-classes-in-jar-not-recognised-xxx-is-not-mapped%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Farticles.carbonrider.com%2F2011%2F02%2F27%2Fspring-hibernate-annotation-entity-classes-in-jar-not-recognised-xxx-is-not-mapped%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Spring provides options to integrate many ORM frameworks available in Market and one of them is Hibernate. With the options like configuring SessionFactory and HibernateTemplate, it makes developer&#8217;s life smooth to integrate other cross cutting concerns. Amongst all the other features, Spring provides a convenient feature is to autodetect &#8220;Annotated&#8221; Entity classes from package(s) using helper bean &#8220;org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean&#8221;. The package(s) name can be injected using setter method &#8220;packagesToScan&#8221;. Set the value of this property to the package name where you place the Entity classes and you are good to go. No need to add entry for every *-hbm.xml file OR explicitly configuring annotated classes.</p>
<p>But recently I came across a problem, wherein I found that my application&#8217;s Entity classes were not detected and when I was querying, hibernate was simply throwing an error as &#8220;XXX is not mapped&#8221;.<br />
<span id="more-458"></span><br />
Well after struggling for almost an hour and checking out all the configuration, it was not visible as what was causing the problem [almost clueless <img src='http://www.carbonrider.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  ]. The next step was (obvious) jump into the Spring code and checking out what went wrong. Aha! that really helped and I found the reason why Spring was not able to detect Entity classes. The &#8220;AnnotationSessionFactoryBean&#8221; class internally prefixes packages with &#8220;classpath*:&#8221; protocol before searching them and as stated in Spring documentation due to bug in JDK classloader the underlying classloader used by Spring to load resources is not able to recognise files kept within Jar. (mine were kept inside JAR and not in exploded format.). Though the application deployed was a Web Application which creates XmlWebApplicationContext and internally uses &#8220;ServletContextResourcePatternResolver&#8221; to resolve classes (Resolves resources insdie JAR file), was simply failing due to the fact of having prefix &#8220;classpath*:&#8221;</p>
<p>Having no provision to override this behaviour of &#8220;AnnotationSessionFactoryBean&#8221;, I thought of extending the class and added a method to use prefix for loading resources. Also I had to override the scanPackages method to use custom logic for loading resoruces. To load the resources from JAR you need to use inject path as WEB-INF/lib/*.jar!/com.abc. Note the &#8220;!/&#8221; in path, Spring makes use of this delimiter to identify the JAR and the resource path. After deploying the change, I found that Spring was now able to autodetect the Entity from JAR.</p>
]]></content:encoded>
			<wfw:commentRss>http://articles.carbonrider.com/2011/02/27/spring-hibernate-annotation-entity-classes-in-jar-not-recognised-xxx-is-not-mapped/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

