<?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>Lazy Programmer&#039;s Shortcut</title>
	<atom:link href="http://sajidmoinuddin.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sajidmoinuddin.wordpress.com</link>
	<description>Java, J2EE, Spring, OOAD, DDD &#38; LIFE! .......all in one :)</description>
	<lastBuildDate>Wed, 23 Nov 2011 12:02:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sajidmoinuddin.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Lazy Programmer&#039;s Shortcut</title>
		<link>http://sajidmoinuddin.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sajidmoinuddin.wordpress.com/osd.xml" title="Lazy Programmer&#039;s Shortcut" />
	<atom:link rel='hub' href='http://sajidmoinuddin.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Dan North on Agile &amp; Architecture.</title>
		<link>http://sajidmoinuddin.wordpress.com/2011/02/02/dan-north-on-agile-architecture/</link>
		<comments>http://sajidmoinuddin.wordpress.com/2011/02/02/dan-north-on-agile-architecture/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 11:19:07 +0000</pubDate>
		<dc:creator>sajid2045</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sajidmoinuddin.wordpress.com/?p=236</guid>
		<description><![CDATA[I know he has a natural Charisma and superb witty humor that makes him a nice presenter but thats not the reason I like him so much. I have never had so much common thoughts with another developer / manager about software development. Here are my two most fav presentation by Dan North , if [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=236&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I know <a href="http://dannorth.net/" target="_blank">he</a> has a natural Charisma and superb witty humor that makes him a nice presenter but thats not the reason I like him so much. I have never had so much common thoughts with another developer / manager about software development.</p>
<p>Here are my two most fav presentation by <a href="http://dannorth.net/" target="_blank">Dan North</a> , if you are interested in Full Software Development Lifecycle, Agile , Architecture, you are going to love it (or hate it if you have been practicing waterfall for last 20 years):</p>
<p><a href="http://www.infoq.com/presentations/Simplicity-Architect" target="_blank">1 . Simplicity, The Way of the Unusual Architect</a> (Have you heard about &#8216;YAK Shaving&#8217; ? if not, you must see this!!! I insist!)</p>
<p><a href="http://www.infoq.com/presentations/Keeping-Agile-Agile" target="_blank">2. Keeping Agile Agile</a></p>
<p>You can find many more presentation here:</p>
<p><a href="http://www.infoq.com/author/Dan-North" target="_blank">http://www.infoq.com/author/Dan-North</a></p>
<p><em>Did I mention they are not just boring tech presentation, you will laugh out loud a few times&#8230;have fun <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sajidmoinuddin.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sajidmoinuddin.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sajidmoinuddin.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sajidmoinuddin.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sajidmoinuddin.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sajidmoinuddin.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sajidmoinuddin.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sajidmoinuddin.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sajidmoinuddin.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sajidmoinuddin.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sajidmoinuddin.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sajidmoinuddin.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sajidmoinuddin.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sajidmoinuddin.wordpress.com/236/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=236&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sajidmoinuddin.wordpress.com/2011/02/02/dan-north-on-agile-architecture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/36afa9ee82fbb53dd6e081646e2808d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajid</media:title>
		</media:content>
	</item>
		<item>
		<title>Android for Java Developer</title>
		<link>http://sajidmoinuddin.wordpress.com/2011/02/01/android-for-java-developer/</link>
		<comments>http://sajidmoinuddin.wordpress.com/2011/02/01/android-for-java-developer/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 23:26:42 +0000</pubDate>
		<dc:creator>sajid2045</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sajidmoinuddin.wordpress.com/?p=241</guid>
		<description><![CDATA[I have been developing small applications on android platform for last 4 months or so. What started as a hobby / plaything has become an important part of my day Job now! When I look back, I can see I have worked with almost all major components of android: Async work, Services, Wake locks, GPS, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=241&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been developing small applications on android platform for last 4 months or so. What started as a hobby / plaything has become an important part of my day Job now! When I look back, I can see I have worked with almost all major components of android: Async work, Services, Wake locks, GPS, Alarm, REST etc.</p>
<p>And here is what I am trying to say &#8220;ITS REALLY EASY &amp; FUN !!!&#8221;. Infact its so much fun that you wouldn&#8217;t even realize you have read 400 pages of books / 100s of articles without even knowing it! It is also one of my most favorite frameworks beside Spring where you get to see <strong>cool designs , great sample applications and lots of quality documentation</strong>.</p>
<p>Just grab the <a href="http://commonsware.com/Android/">CommonsWare</a> books and a 400$ android device(Optional, the emulator will do for the starters) and you are good to go!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sajidmoinuddin.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sajidmoinuddin.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sajidmoinuddin.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sajidmoinuddin.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sajidmoinuddin.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sajidmoinuddin.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sajidmoinuddin.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sajidmoinuddin.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sajidmoinuddin.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sajidmoinuddin.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sajidmoinuddin.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sajidmoinuddin.wordpress.com/241/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sajidmoinuddin.wordpress.com/241/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sajidmoinuddin.wordpress.com/241/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=241&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sajidmoinuddin.wordpress.com/2011/02/01/android-for-java-developer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/36afa9ee82fbb53dd6e081646e2808d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajid</media:title>
		</media:content>
	</item>
		<item>
		<title>My definition of SUCCESS</title>
		<link>http://sajidmoinuddin.wordpress.com/2010/10/30/my-definition-of-success/</link>
		<comments>http://sajidmoinuddin.wordpress.com/2010/10/30/my-definition-of-success/#comments</comments>
		<pubDate>Sat, 30 Oct 2010 06:03:58 +0000</pubDate>
		<dc:creator>sajid2045</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sajidmoinuddin.wordpress.com/?p=229</guid>
		<description><![CDATA[DID YOU KNOW? Facebook chat app was developed by only 4 engineers working around 1 year! They went from 0 users to 70 million users overnight and still thrived !!!! Here is the DETAILS and here is another quick Link. Thats my definition of success! I envy those 4 engineers.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=229&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>DID YOU KNOW? Facebook chat app was developed by only 4 engineers working around 1 year! They went from 0 users to 70 million users overnight and still thrived !!!! Here is the <a href="http://video.yahoo.com/watch/5060898/13446693">DETAILS</a> and here is another quick <a href="http://www.facebook.com/note.php?note_id=14218138919&amp;comments">Link</a>. </p>
<p><strong>Thats my definition of success! I envy those 4 engineers.</strong><em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sajidmoinuddin.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sajidmoinuddin.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sajidmoinuddin.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sajidmoinuddin.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sajidmoinuddin.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sajidmoinuddin.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sajidmoinuddin.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sajidmoinuddin.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sajidmoinuddin.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sajidmoinuddin.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sajidmoinuddin.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sajidmoinuddin.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sajidmoinuddin.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sajidmoinuddin.wordpress.com/229/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=229&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sajidmoinuddin.wordpress.com/2010/10/30/my-definition-of-success/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/36afa9ee82fbb53dd6e081646e2808d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajid</media:title>
		</media:content>
	</item>
		<item>
		<title>Troubleshooting Tomcat deployment problem for jaxws-2.2 application : The Sherlock Holmes way</title>
		<link>http://sajidmoinuddin.wordpress.com/2010/07/31/troubleshooting-tomcat-deployment-problem-for-jaxws-2-2-application-the-sherlock-holmes-way/</link>
		<comments>http://sajidmoinuddin.wordpress.com/2010/07/31/troubleshooting-tomcat-deployment-problem-for-jaxws-2-2-application-the-sherlock-holmes-way/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 08:11:41 +0000</pubDate>
		<dc:creator>sajid2045</dc:creator>
				<category><![CDATA[classloading]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jetty]]></category>
		<category><![CDATA[JVM]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[webservice]]></category>

		<guid isPermaLink="false">http://sajidmoinuddin.wordpress.com/?p=213</guid>
		<description><![CDATA[Deploying a JAX-WS 2.2 application in Tomcat 6 using JDK 6.

Solve problem: 
SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.NoClassDefFoundError: javax/xml/ws/soap/AddressingFeature$Responses

and 

SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.NoSuchMethodError: com.sun.istack.logging.Logger.getLogger(Ljava/lang/Class;)Lcom/sun/istack/logging/Logger;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=213&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I just spent my last 3 hour trying to deploy my perfect JAXWS-2.2 application in tomcat 6.0.26. Again I felt so great and thanked God that I took programming as a profession. Sure you don&#8217;t get to solve mysterious murder cases like Sherlock Homes, but the things we do are not much different! Where else can you go to work, get a problem with a set of clues, judge / discard / follow each and every clue, follow the trails to come to identify the problem and fix it and get paid for it! </p>
<p><strong>Background: </strong></p>
<p>The application was running happily in Jetty ever since I wrote it three months ago but my client wants to run it in tomcat. It was a standard web application so I thought it will be a child&#8217;s play to deploy it in tomcat. Ah! As if I have learned nothing from history! Nothing is child&#8217;s play when it comes to deploy an application in a new container, no matter how standard it is! I have learned this lesson hard way from deploying application in tomcat, jetty, jboss, weblogic, glassfish (yeah..i&#8217;v been fortunate/unfortunate enough to play with them all) , yet I tend to forget. </p>
<p><strong>Problem 1: </strong><br />
First time I tried to run the app, I ran into the ClassNotFoundException: </p>
<p><pre class="brush: plain;">

SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.NoClassDefFoundError: javax/xml/ws/soap/AddressingFeature$Responses
java.lang.NoClassDefFoundError: javax/xml/ws/soap/AddressingFeature$Responses
	at com.sun.xml.ws.policy.PolicyWSDLGeneratorExtension.loadConfigurators(PolicyWSDLGeneratorExtension.java:459)
	at com.sun.xml.ws.policy.PolicyWSDLGeneratorExtension.start(PolicyWSDLGeneratorExtension.java:111)

..........................
</pre></p>
<p>I remember this! This was due to the jaxws-2.2 libraries conflicting with jaxws-2.1 libraries shipped with jdk-1.6! But I had it fixed by placing the latest jaxb-api.jar &amp; jaxws-api.jar into the JDK_HOME/jre/lib/endorsed folder!</p>
<p>Hmm&#8230;here is a clue&#8230;the library is setup properly in JDK , app is running fine with Jetty with the same JDK, but wouldn&#8217;t load in tomcat!! Who is the &#8216;Usual Suspect&#8217; ? Of course the tomcat classloading framework! Its ignoring the &#8216;endorsed&#8217; jars configured in JDK ! Ah, at this point I begin to miss my old complex Tomcat 5.5, there was this &#8216;endorsed&#8217; directory in the &#8216;common/endorsed&#8217; folder. Where is it in tomcat 6? Luckily I had some old trick under my belt&#8230;Quickly Added a ServletContextListener like this: </p>
<p><pre class="brush: plain;">
public class WebappLoadListener implements ServletContextListener {
	private static final Log log = LogFactory.getLog(WebappLoadListener.class);
	public void contextDestroyed(ServletContextEvent arg0) {
	}

	public void contextInitialized(ServletContextEvent arg0) {
		log.info(&quot;\n\n\n ENDORSED DIR: &quot; +System.getProperty(&quot;java.endorsed.dirs&quot;));		
	}
}
</pre></p>
<p>And the output was:<br />
<pre class="brush: plain;">
ENDORSED DIR:  /usr/local/development/servers/apache-tomcat-6.0.26/endorsed
</pre></p>
<p>How the hack am I supposed to know that, the directory is not even there! Come on tomcat guys, I understand you want to make things simple for the new tomcat adopters, but why screw us &#8211; the old 5.5 users!!! <strong>Created folder &#8220;/usr/local/development/servers/apache-tomcat-6.0.26/endorsed&#8221; and copied the latest jars (jaxb-api.jar  jaxws-api.jar) in there, got rid of the ClassNotFoundException.</strong></p>
<p><strong>Problem 2: </strong><br />
As soon as I got rid of problem 1, I ran into this:<br />
<pre class="brush: plain;">
SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.NoSuchMethodError: com.sun.istack.logging.Logger.getLogger(Ljava/lang/Class;)Lcom/sun/istack/logging/Logger;
java.lang.NoSuchMethodError: com.sun.istack.logging.Logger.getLogger(Ljava/lang/Class;)Lcom/sun/istack/logging/Logger;
	at com.sun.xml.ws.api.config.management.policy.ManagementAssertion.&lt;clinit&gt;(ManagementAssertion.java:87)
	at com.sun.xml.ws.server.MonitorBase.createManagedObjectManager(MonitorBase.java:121)
	at com.sun.xml.ws.server.WSEndpointImpl.&lt;init&gt;(WSEndpointImpl.java:143)
	at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:232)
	at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:505)
	at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:253)
	at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:147)
</pre></p>
<p>Now this got my head spinning! All the clue I got from Google was pointing to <strong>&#8216;Problem 1&#8242;</strong>&#8230;I was also a little confused and headed that way, placed the &#8216;jaxb-api.jar  jaxws-api.jar&#8217; in various locations, with no luck ! Ok, time to give up that trail and think clear. So, it was not a ClassNotFoundException, the class is there, but the Method is not. Why do this sounds familier? Because I have seen it countless times! Its because of two version of same class staying in the classpath and the faulty one getting preference by Tomcat ClassLoader! If you know about tomcat classloading, you know that it creates a ClassLoader for each webapp and the jars in &#8220;WEB-INF/lib&#8221; are loaded first (by the child classloader). So I must have some jar in my dependency which should not be there&#8230;Hmm..how do I know which jar? Wait, I know a way, infact I even blogged about it <a href="http://sajidmoinuddin.wordpress.com/2009/03/31/how-to-get-the-jar-file-location-of-a-loaded-class">HERE</a>.</p>
<p>So quickly added this method in my WebappLoadListener:<br />
<pre class="brush: plain;">
public static String getClassLocation(Class clazz) {
		if(clazz == null) {
			return null;
		}

		try {
			ProtectionDomain protectionDomain = clazz.getProtectionDomain();
			CodeSource codeSource = protectionDomain.getCodeSource();
			URL location = codeSource.getLocation();
			return location.toString();
		} catch (Throwable e) {
			e.printStackTrace();
			return &quot;Not found&quot;;
		}
	}

	public void contextInitialized(ServletContextEvent arg0) {		
		log.error(&quot;jar file: &quot; + getClassLocation(com.sun.istack.logging.Logger.class));		
	}
</pre></p>
<p>OUTPUT: </p>
<p><pre class="brush: plain;">
ERROR WebappLoadListener:21 - jar file: file:/home/sajid/workspace_test/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/jaxws-sample/WEB-INF/lib/istack-commons-runtime-1.1-SNAPSHOT.jar
</pre></p>
<p>I got you &#8220;Professor Moriarty&#8221; (in case you are not familiar with Sherlock Holmes, Professor Moriarty is the common villain)! How did you got in my LIB folder ! The very name &#8220;<strong>istack-commons-runtime-1.1-SNAPSHOT.jar</strong>&#8221; suggests that I should not bundle it in my app! I deleted the jar manually and ran the code. Ah! Sweet. At last my code deployed in tomcat and all my <a href="http://www.soapui.org/">SOAP-UI</a> tests(only Three to be honest) are passed!  And where is the class loaded from now?</p>
<p><pre class="brush: plain;">
ERROR WebappLoadListener:21 - jar file: file:/home/sajid/workspace_test/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/jaxws-sample/WEB-INF/lib/jaxb-impl-2.2.jar
</pre></p>
<p>See! The right class is supplied with the jaxb-impl Jar.</p>
<p>Now, back to the old question, how did istack-commons-runtime-1.1-SNAPSHOT.jar ended up in my library? Did a quick &#8216;Dependency Graph&#8217; in eclipse </p>
<p><a href="http://sajidmoinuddin.files.wordpress.com/2010/07/dependencygraph.png"><img src="http://sajidmoinuddin.files.wordpress.com/2010/07/dependencygraph.png?w=150&#038;h=93" alt="" title="DependencyGraph" width="150" height="93" class="alignnone size-thumbnail wp-image-219" /></a></p>
<p>So I added an exclusion rule in the dependency of jaxws-rt:<br />
<pre class="brush: plain;">

		&lt;dependency&gt;
			&lt;groupId&gt;com.sun.xml.ws&lt;/groupId&gt;
			&lt;artifactId&gt;jaxws-rt&lt;/artifactId&gt;
			&lt;version&gt;2.2&lt;/version&gt;
			&lt;exclusions&gt;
				&lt;exclusion&gt;
					&lt;groupId&gt;com.sun.istack&lt;/groupId&gt;
					&lt;artifactId&gt;istack-commons-runtime&lt;/artifactId&gt;
				&lt;/exclusion&gt;
			&lt;/exclusions&gt;
		&lt;/dependency&gt;

</pre></p>
<p>Ran all the tests and everything seemed to be OK. I feel so lucky that I spent time writing those SOAP-UI test cases (at the time it felt like complete waste of time)! Otherwise, I&#8217;d have to test the application manually to see if anything was broken by this. </p>
<p><strong>Conclusion: </strong><br />
I see now why newbies like to adopt those exotic Ruby framework instead of Java. Imagine someone trying to build a webservice using JAX-WS. As if the api specs are not confusing enough, he has to go through all these pain to run the app! I feel sorry for the poor guy if he starts with tomcat, he would have no clue that its not his code&#8217;s fault that the app is not running. Luckily I started with Jetty, not because I was wise but because the client wanted it in Jetty. </p>
<p>But did I have fun going through all these pain? I sure did <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  . Good to know that I still get a kick out of fixing these weird problems, no matter how many times I did it before.   </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sajidmoinuddin.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sajidmoinuddin.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sajidmoinuddin.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sajidmoinuddin.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sajidmoinuddin.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sajidmoinuddin.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sajidmoinuddin.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sajidmoinuddin.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sajidmoinuddin.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sajidmoinuddin.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sajidmoinuddin.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sajidmoinuddin.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sajidmoinuddin.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sajidmoinuddin.wordpress.com/213/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=213&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sajidmoinuddin.wordpress.com/2010/07/31/troubleshooting-tomcat-deployment-problem-for-jaxws-2-2-application-the-sherlock-holmes-way/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/36afa9ee82fbb53dd6e081646e2808d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajid</media:title>
		</media:content>

		<media:content url="http://sajidmoinuddin.files.wordpress.com/2010/07/dependencygraph.png?w=150" medium="image">
			<media:title type="html">DependencyGraph</media:title>
		</media:content>
	</item>
		<item>
		<title>My first take on Roo framework</title>
		<link>http://sajidmoinuddin.wordpress.com/2010/04/22/my-first-take-on-roo-framework/</link>
		<comments>http://sajidmoinuddin.wordpress.com/2010/04/22/my-first-take-on-roo-framework/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 05:39:47 +0000</pubDate>
		<dc:creator>sajid2045</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sajidmoinuddin.wordpress.com/?p=205</guid>
		<description><![CDATA[I recently started playing with Spring Roo Framework. I had two main objective. See if its a suitable replacement for &#8220;Appfuse&#8221; when I start a new project Learn best practices for building spring application from the spring guys At first I was &#8216;WOW&#8217; ed by the dynamic code generation and when I saw the app [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=205&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently started playing with <a href="http://www.springsource.org/roo">Spring Roo</a> Framework. I had two main objective.</p>
<ul>
<li> See if its a suitable replacement for &#8220;<a href="http://appfuse.org/">Appfuse</a>&#8221; when I start a new project</li>
<li>Learn best practices for building spring application from the spring guys</li>
</ul>
<p>At first I was &#8216;WOW&#8217; ed by the dynamic code generation and when I saw the app running, but as soon as I &#8220;perform eclipse&#8221; and imported the code in my workspace, I was disheartened. It is a great effort from the spring team but I am not gonna like it.</p>
<p>Why you may ask? I have couple of reasons, but the most important one is , Spring tried to inject their cutting edge features, aspect-j notations into the generated source. I am not against aspects but when I have more  &#8220;Aspect-J&#8221;  codes than my regular codes, I become worried. Worried about how I am going to maintain it, is there good enough IDE for it, are the regular java developers who will be working on the codes going to like/learn the new AspectJ concepts? Again, I am against overuse of annotation. I am ok with Hibernate annotations or validation annotations or transactional annotations, but its too much for me when I write annotations on the controller and map my http requests against it.</p>
<p>I am a big fan of spring , not because it gives me magical transaction management or supercool Controller annotations but because it lets me dependency inject my POJO beans into one another. This is an awesome tool for any designer. But with the latest Roo effort from Spring, I am worried about the future of spring framework. It seems like they are focusing on Rapid Application Development too much.</p>
<p>Anyone who has worked on a product for a decent amount of time will soon realize that the initial development time of the code is only 30-40% of the total lifecycle of the code  (or even less). You have to update the code, add twisted domain logic which is never predictable by any annotation driven framework, perform bug fix on the code and the list goes on. By adding all these &#8220;Magic&#8221; into the code, you are going to leave the new developer (who will eventually  take over the code from you) in the wonderland.</p>
<p>I liked the Spring Roo&#8217;s shell though. And the JPA POJO generation is also cool..but thats about it. Why don&#8217;t the spring guys make a better PetClinic application instead of overdoing annotations?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sajidmoinuddin.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sajidmoinuddin.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sajidmoinuddin.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sajidmoinuddin.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sajidmoinuddin.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sajidmoinuddin.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sajidmoinuddin.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sajidmoinuddin.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sajidmoinuddin.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sajidmoinuddin.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sajidmoinuddin.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sajidmoinuddin.wordpress.com/205/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sajidmoinuddin.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sajidmoinuddin.wordpress.com/205/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=205&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sajidmoinuddin.wordpress.com/2010/04/22/my-first-take-on-roo-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/36afa9ee82fbb53dd6e081646e2808d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajid</media:title>
		</media:content>
	</item>
		<item>
		<title>My version of erlang &#8216;Ring&#8217; problem</title>
		<link>http://sajidmoinuddin.wordpress.com/2010/04/16/my-version-of-erlang-ring-problem/</link>
		<comments>http://sajidmoinuddin.wordpress.com/2010/04/16/my-version-of-erlang-ring-problem/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 04:57:12 +0000</pubDate>
		<dc:creator>sajid2045</dc:creator>
				<category><![CDATA[erlang]]></category>

		<guid isPermaLink="false">http://sajidmoinuddin.wordpress.com/?p=197</guid>
		<description><![CDATA[Ring problem implementation in erlang.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=197&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been reading &#8216;<a href="http://www.erlangprogramming.org/">Erlang Programming</a>&#8216; , like a good student, I decided to solve the ring exercise:</p>
<p>Here is the problem in my words:</p>
<blockquote><p>
Create a linked list of N Ring where each Ring is an erlang process. When you pass a message to the head Ring , it should propagate the message to the  next Ring and that propagates to the next ring and so on. I added additional clause  &#8212; &#8220;Each ring should report its successful message delivery to the previous ring and the previous ring should print successful message delivery from its child rings.
</p></blockquote>
<p>Here is the code:</p>
<p><pre class="brush: plain;">
-module(ring).
-compile(export_all).


createRing(N) -&gt;
    Self = self(),
    Head = spawn(fun() -&gt; ring(N, Self) end),   
    Head.

ring(N, PreviousRing) when N &gt; 0 -&gt;
    Self = self(),
    io:format('~w #ring created PID: [~w] ListenerPid: [~w] ~n',[N, Self, PreviousRing]),
    NextRing = spawn(fun() -&gt;
			     ring(N-1 , Self) end),
    loop(N ,NextRing, PreviousRing);

ring(N, PreviousRing) -&gt;
    io:format('last ring reached! ~w ~n',[N]),
    NullRing = spawn(fun() -&gt; 
			     receive
				 Any -&gt;
				     io:format('dummy ring received ~w ~n', Any)
			     end
		     end),
    loop(N, NullRing, PreviousRing).



loop(N, NextRing, PreviousRing) -&gt;
    receive
	{send_message, Message} -&gt;
	    io:format('ring # ~w with pid: #~w received ~w ~n',[N, self(), Message]),
	    NextRing ! {send_message, Message},
	    PreviousRing ! {ok, self()},
	    loop(N, NextRing, PreviousRing);
	{ok, NextRing} -&gt;
	    io:format('~w with pid# ~w successfully sent message ~n',[N-1, NextRing]),
	    loop(N, NextRing, PreviousRing);
	{quit} -&gt;
	    io:format('quiting ring: ~w with Pid: ~w ~n',[N, self()])
    end.


sendMessage(Head, M) when M &gt; 0 -&gt;
    Head ! {send_message, M},
    sendMessage(Head, M - 1);
sendMessage(Head, M) -&gt;
    io:format('sending last message ~n'),
    Head ! {send_message, M}.
</pre><br />
I have had my share of multi-threaded programming in Java, thanks to the telephony applications I&#8217;v worked on. Just imagine the pain you would have to go through to implement this in Java / C++ !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sajidmoinuddin.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sajidmoinuddin.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sajidmoinuddin.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sajidmoinuddin.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sajidmoinuddin.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sajidmoinuddin.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sajidmoinuddin.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sajidmoinuddin.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sajidmoinuddin.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sajidmoinuddin.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sajidmoinuddin.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sajidmoinuddin.wordpress.com/197/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sajidmoinuddin.wordpress.com/197/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sajidmoinuddin.wordpress.com/197/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=197&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sajidmoinuddin.wordpress.com/2010/04/16/my-version-of-erlang-ring-problem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/36afa9ee82fbb53dd6e081646e2808d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajid</media:title>
		</media:content>
	</item>
		<item>
		<title>Meditation for programmers</title>
		<link>http://sajidmoinuddin.wordpress.com/2010/04/01/meditation-for-programmers/</link>
		<comments>http://sajidmoinuddin.wordpress.com/2010/04/01/meditation-for-programmers/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 11:49:12 +0000</pubDate>
		<dc:creator>sajid2045</dc:creator>
				<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://sajidmoinuddin.wordpress.com/?p=193</guid>
		<description><![CDATA[I have been always interested in meditation but the concept is too abstract to me. Many tutorials I&#8217;v tried to follow are either too boring or sometimes even funny. But this neat presentation for Google programmers was very interesting, may be I&#8217;ll give it a try !<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=193&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been always interested in meditation but the concept is too abstract to me. Many tutorials I&#8217;v tried to follow are either too boring or sometimes even funny. But this neat presentation for Google programmers was very interesting, may be I&#8217;ll give it a try !</p>
<span style="text-align:center; display: block;"><a href="http://sajidmoinuddin.wordpress.com/2010/04/01/meditation-for-programmers/"><img src="http://img.youtube.com/vi/3nwwKbM_vJc/2.jpg" alt="" /></a></span>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sajidmoinuddin.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sajidmoinuddin.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sajidmoinuddin.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sajidmoinuddin.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sajidmoinuddin.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sajidmoinuddin.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sajidmoinuddin.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sajidmoinuddin.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sajidmoinuddin.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sajidmoinuddin.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sajidmoinuddin.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sajidmoinuddin.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sajidmoinuddin.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sajidmoinuddin.wordpress.com/193/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=193&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sajidmoinuddin.wordpress.com/2010/04/01/meditation-for-programmers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/36afa9ee82fbb53dd6e081646e2808d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajid</media:title>
		</media:content>
	</item>
		<item>
		<title>Best Ruby IDE</title>
		<link>http://sajidmoinuddin.wordpress.com/2010/03/22/best-ruby-ide/</link>
		<comments>http://sajidmoinuddin.wordpress.com/2010/03/22/best-ruby-ide/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 11:47:35 +0000</pubDate>
		<dc:creator>sajid2045</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sajidmoinuddin.wordpress.com/?p=191</guid>
		<description><![CDATA[I have been playing with all major ruby IDEs, but without any doubt JetBrains RubyMine is the best ! Period. Unfortunately they only provide 1 month free subscription<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=191&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been playing with all major ruby IDEs, but without any doubt <a href="http://www.jetbrains.com/ruby/">JetBrains RubyMine </a>is the best ! Period. </p>
<p>Unfortunately they only provide 1 month free subscription <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sajidmoinuddin.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sajidmoinuddin.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sajidmoinuddin.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sajidmoinuddin.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sajidmoinuddin.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sajidmoinuddin.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sajidmoinuddin.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sajidmoinuddin.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sajidmoinuddin.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sajidmoinuddin.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sajidmoinuddin.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sajidmoinuddin.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sajidmoinuddin.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sajidmoinuddin.wordpress.com/191/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=191&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sajidmoinuddin.wordpress.com/2010/03/22/best-ruby-ide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/36afa9ee82fbb53dd6e081646e2808d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajid</media:title>
		</media:content>
	</item>
		<item>
		<title>How to change the default execution order of feature files in Cucumber</title>
		<link>http://sajidmoinuddin.wordpress.com/2010/03/21/how-to-change-the-default-execution-order-of-feature-files-in-cucumber/</link>
		<comments>http://sajidmoinuddin.wordpress.com/2010/03/21/how-to-change-the-default-execution-order-of-feature-files-in-cucumber/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 12:05:31 +0000</pubDate>
		<dc:creator>sajid2045</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sajidmoinuddin.wordpress.com/?p=184</guid>
		<description><![CDATA[When you are running all your Cucumber feature scripts from Rake, often you would want to change the default execution order. Currently, cucumber loads all the feature files in &#8216;features/&#8217; directory in alphabetical order and executes them. This can be very annoying, specially when you want to execute certain critical features run before running the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=184&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When you are running all your Cucumber feature scripts from Rake, often you would want to change the default execution order. Currently, cucumber loads all the feature files in &#8216;features/&#8217; directory in alphabetical order and executes them. </p>
<p>This can be very annoying, specially when you want to execute certain critical features run before running the other not so critical features. Cucumber does not have any provision for feature ordering. But with some minor hacks, you can achieve this. </p>
<p>1st, you need to give each of your features a certain &#8216;weight&#8217; in a yml file:</p>
<p><pre class="brush: plain;">
features/vcc_admin_create_test.feature: 80
features/transferred_acd_call.feature: 9
features/supervisor_create_test.feature: 8
features/super_force_signout_test.feature: 7
features/simple_queue_call_test.feature: 6
features/queue_delivered_count_test.feature : 67
features/queue_create_test.feature : 13
features/queue_call_treatment_test.feature : 12
features/email_status_monitor_test.feature : 11
features/email_forward.feature : 10
features/dynamic_and_static_number_test.feature : 9
features/agent_profile_change_test.feature : 8
features/agent_email_receiver_test.feature : 7
features/agent_create_test.feature : 6
features/agent_acd_state_test.feature : 5
features/agent_acd_call_duration_test.feature : 4
features/agent_acd_call_count_test.feature : 3
features/admin_call_distribution_policy_test.feature : 2
features/CC_create_test.feature : 1
</pre></p>
<p>next, update your env.rb file for adding a hook: </p>
<p><pre class="brush: plain;">
# Overrides the method +method_name+ in +obj+ with the passed block
def override_method(obj, method_name, &amp;block)
  # Get the singleton class/eigenclass for 'obj'
  klass = class &lt;&lt;obj; self; end
 
  # Undefine the old method (using &#039;send&#039; since &#039;undef_method&#039; is protected)
  klass.send(:undef_method, method_name)
 
  # Create the new method
  klass.send(:define_method, method_name, block)
end
 
 
  
def get_weight(x)
  weights = YAML::load(File.open(&#039;order.yml&#039;)) #this is expensive but is done only on rake start
  weight = weights[x]
  if weight == nil or weight == &#039;&#039;
    weight = &#039;100&#039; #this is because we want to run the newly added tests first.
  end
  return weight.to_i()
end
 
def sort_according_to_weights(features)
  return features.sort { |x,y|  get_weight(y)  &amp;lt;=&amp;gt; get_weight(x)}
end
 
 
AfterConfiguration do |configuration|
  puts &quot;\n\n\n *****  config: #{configuration} &quot;
  featurefiles =  configuration.feature_files
 
  override_method(configuration, :feature_files) {
    puts &quot;overriding the old featurefiles according to their weight&quot;
    sorted_files = sort_according_to_weights(featurefiles);   
    sorted_files
  }
 
    puts &quot;\n\n *************************** features will be executed in following order: \n&quot;
    for i in configuration.feature_files
      puts &quot;#{i} : weight: #{get_weight(i)}&quot;
    end
end
</pre></p>
<p>After Cucumber loads the feature files from the directory, it calls &#8220;AfterConfiguration&#8221; before it starts executing the features. Sadly the configuration.feature_files is not an array which you can just sort. Its a method ! But with ruby being a dynamic language, you can push new method definition into the configuration instance so that it returns the features according to the order you specified ! </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sajidmoinuddin.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sajidmoinuddin.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sajidmoinuddin.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sajidmoinuddin.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sajidmoinuddin.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sajidmoinuddin.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sajidmoinuddin.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sajidmoinuddin.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sajidmoinuddin.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sajidmoinuddin.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sajidmoinuddin.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sajidmoinuddin.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sajidmoinuddin.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sajidmoinuddin.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=184&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sajidmoinuddin.wordpress.com/2010/03/21/how-to-change-the-default-execution-order-of-feature-files-in-cucumber/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/36afa9ee82fbb53dd6e081646e2808d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajid</media:title>
		</media:content>
	</item>
		<item>
		<title>Integrate Sipper with Cucumber for functional automation</title>
		<link>http://sajidmoinuddin.wordpress.com/2010/03/13/integrate-sipper-with-cucumber-for-functional-automation/</link>
		<comments>http://sajidmoinuddin.wordpress.com/2010/03/13/integrate-sipper-with-cucumber-for-functional-automation/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 16:10:31 +0000</pubDate>
		<dc:creator>sajid2045</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sajidmoinuddin.wordpress.com/?p=168</guid>
		<description><![CDATA[Sipper is a good framework for doing functional automation of any sip call flow. Cucumber is a great tool for writing your functional test cases in plain text and execute them. Cucumber is mostly used for doing web automation with other tools like Watir. But now a days, VOIP meets Web now and then, And [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=168&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://sipr.agnity.com/">Sipper</a> is a good framework for doing functional automation of any sip call flow. <a href="http://cukes.info/">Cucumber</a> is a great tool for writing your functional test cases in plain text and execute them. Cucumber is mostly used for doing web automation with other tools like <a href="http://watir.com">Watir</a>.  But now a days, VOIP meets Web now and then, And you are left with the challenge of integrating your web automation with your sip automation. For example, you want to automate &#8220;<strong>When a call comes to my sip phone, I want to see a javascript popup in my screen</strong>&#8220;</p>
<p>Sipper comes with its testing/assertion/validation framework. First things first, we need to drop them. We are only interested into the Sip Stack and Call abstraction framework provided by sipper. We will do the assertion from our Cucumber framework.</p>
<p>First of all, you need to be able to run sipper in standalone mode rather than using the &#8216;rake&#8217; provided by sipper framework. You need to bootstrap sipper framework from your ruby code. You can do that with the following code (usually you would want to put it in your <strong>support/env.rb</strong> configuration file for cucumber) :</p>
<p><pre class="brush: plain;">
require 'sipper'
require 'sipper_configurator'&lt;/code&gt;

cf = File.join(&quot;C:/dev/projects/myproject/qa/sipper_tests/cucumber_tests/&quot;, &quot;config&quot;, &quot;sipper.cfg&quot;)
SipperConfigurator.load_yaml_file(cf)

@sipper = SIP::Sipper.new()
@sipper.start

</pre></p>
<p>Now that you have started sipper, you can register any controller in it from your cucumber steps. Lets say we have a step like this: </p>
<p><pre class="brush: plain;">
   Then I start customer's phone
</pre></p>
<p>You would want to start the controller that &#8216;REGISTER&#8217; for the customer&#8217;s phone and wait for any incoming call. </p>
<p><pre class="brush: plain;">
Then /^I start customer's phone$/ do
  puts &quot;Going to start Controller: CallReceiverCustomerController&quot;
  @customer_controller = @sipper.start_named_controller(&quot;CallReceiverCustomerController&quot;)
  sleep 3
end
</pre></p>
<p>I have extended the standard sipper controller so that I can call it and control it from any ruby application. Basically this will act as a SIP phone and provide me the nice API&#8217;s</p>
<p><pre class="brush: plain;">
require 'sip_test_driver_controller'

# NOTE: Extending Core Sipper controller to provide programmable API to simple RUBY client. The ruby client 
# can directly call this controller to control the call flows.

class CommonCallController   &lt; SIP::SipTestDriverController 

  # change the directive below to true to enable transaction usage.
  # If you do that then make sure that your controller is also 
  # transaction aware. i.e does not try send ACK to non-2xx responses,
  # does not send 100 Trying response etc.

  transaction_usage :use_transactions=&gt;false

  # change the directive below to true to start after loading.
  start_on_load false


  def initialize    
    logd('CallReceiverController: Controller created')
    clear_states()
  end

  def clear_states()
    @registered = false
    @current_session = nil
    @call_ended = false
    @got_invite=false
  end

  def specified_transport    
    log &quot; specified_transport #{get_local_sipper_ip()} : #{get_local_sipper_port()}&quot;
    [get_local_sipper_ip(),get_local_sipper_port()]
  end  
  
  def start
    if required_registration
      register()
    end
    
    return self 
  end


  def register()
      log &quot;doing registration with &quot; + get_line_port
      session = create_udp_session(SipperConfigurator[:DefaultRIP], SipperConfigurator[:DefaultRP])
           r = session.create_initial_request(&quot;REGISTER&quot;, &quot;sip:&quot; + SipperConfigurator[:BroadworksDomain] ,
           :from=&gt; &quot;sip:&quot;+ get_line_port, :to=&gt;&quot;sip:&quot;+ get_line_port,
           :contact=&gt; &quot;sip:&quot; + get_line_port_without_domain + &quot;@&quot;+ get_local_sipper_ip() +&quot;:&quot;+get_local_sipper_port().to_s(),
           :expires=&gt;&quot;300&quot;,
           :cseq=&gt;&quot;1 REGISTER&quot;,
           :p_session_record=&gt;&quot;msg-info&quot;)
      r.contact.q=&quot;0.9&quot;
      session = create_udp_session(SipperConfigurator[:DefaultRIP], SipperConfigurator[:DefaultRP])
      session.send(r)
      @current_session = session
      log &quot;---------session: #{session}&quot;
  end

  def required_registration
    true
  end
  
  def on_success_res_for_register(s)
    @current_session = s
    log &quot;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ on_success_res_for_register&quot;
    @registered = true
    s.invalidate(true);
  end

  def on_success_res(s)
     @current_session = s
    log '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ on_success_res -&gt;'
    @registered = true
    s.invalidate(true);
 end
 
  def on_failure_res(session)
    sleep 10
    log &quot;on_failure_res error code: #{session.iresponse.code}&quot;
    puts &quot;\n -----------------------------****************  #{caller}&quot;
    if session.iresponse.code == 401
     r = session.create_request_with_response_to_challenge(session.iresponse.www_authenticate, false,get_auth_id, get_auth_password)     
     session.send r
     session[:auth] = r.authorization
    end
  end

  
  def is_ringing() 
    
      return @got_invite
    
  end
  
  #for the first invite it will send 180, for all other re-invite, it will send 200
  def on_invite(session)
    
    if !session['invite']
      log &quot;got invite------------&quot;
      @current_session = session
      log 'got call from Queue '
      session.respond_with(100)
      session.respond_with(180)
      session['invite']=1
      @got_invite=true
    else
      log &quot;got re invite------------&quot;
      log 'CallReceiverController:  got re-invite'
      if @accept_call         
        session.respond_with(200)      
       end
    end    
  end
  
  
  def make_call(uri)
    log &quot;make_call : #{uri}&quot;
    session = create_udp_session('10.0.0.27', 5060)
    session.request_with('INVITE', uri)
    #@current_session = session
  end
  
  def accept_call()
    log &quot;accept_call #{@current_session}&quot;
    @accept_call=true
    @current_session.respond_with(200)  
  end
  
  def end_call()
    log &quot;ending call #{@current_session}&quot;
    if @current_session
      log 'sending bye'
      @current_session.rp = SipperConfigurator[:DefaultRP]
      @current_session.request_with('BYE')
    end
  end
  
  def on_bye(session)
    log &quot;*******************got bye&quot;
    @call_ended = true
    session.respond_with(200)
    session.invalidate(true)
  end

  def is_call_ended()
    return @call_ended
  end
  
  def last_session_state
    @current_session.last_state
  end
  
  def get_local_sipper_port
    SipperConfigurator[:LocalSipperPort][4]
  end
  protected :get_local_sipper_port
  
  def get_local_sipper_ip
    SipperConfigurator[:LocalSipperIP]
  end  
  protected :get_local_sipper_ip

  def get_line_port
    SipperConfigurator[:AgentLinePort]
  end
  protected :get_line_port

  def controller_name
    self.class.name
  end
  
  def get_line_port_without_domain
    SipperConfigurator[:AgentLinePortWithoutDomain].to_s
  end
  protected :get_line_port_without_domain

  def get_auth_password
    SipperConfigurator[:CustomerAuthenticationPassword]
  end
  protected :get_auth_password
  
  def get_auth_id
    SipperConfigurator[:CustomerAuthenticationUserId]
  end
  protected :get_auth_id

  def log(argument) 
     puts  controller_name + &quot; : &quot; + argument
  end
end

</pre> </p>
<p>Our CallReceiverCustomerController is a simple subclass of the CommonCallController to provide the SIP Registration Details so that it can register to any sip provider (in our case Broadworks). </p>
<p><pre class="brush: plain;">
require 'common_call_controller'

class CallReceiverCustomerController  &lt; CommonCallController 


  def initialize
    puts &quot;initialize&quot;
    super()
    log 'CallReceiverControllerAgent: Controller created'
  end

  def get_local_sipper_port
    SipperConfigurator[:LocalSipperPort][6]
  end
  protected :get_local_sipper_port
  
  def get_local_sipper_ip
    SipperConfigurator[:LocalSipperIP]
  end  
  protected :get_local_sipper_ip

  def get_line_port
    SipperConfigurator[:AgentLinePort]
  end
  protected :get_line_port

  def controller_name
    self.class.name
  end
  
  def get_line_port_without_domain
    SipperConfigurator[:AgentLinePortWithoutDomain].to_s
  end
  protected :get_line_port_without_domain

  def get_auth_password
    SipperConfigurator[:AgentAuthenticationPassword]
  end
  protected :get_auth_password
  
  def get_auth_id
    SipperConfigurator[:AgentAuthenticationUserId]
  end
  protected :get_auth_id

end
</pre> </p>
<p>Now the rest is simple, you can add cucumber steps for like this : </p>
<p><pre class="brush: plain;">
      Then customer Should get Alerting on his phone
      Then customer waits for 10 seconds
      Then customer accepts the phone
      Then customer waits for 20 seconds
      Then customer hangups the phone
</pre></p>
<p>and the steps definitions like this:<br />
</p>
<p>Then /^customer accepts the Call$/ do<br />
  puts &quot;Agent is accepting the Call&quot;<br />
  @customer_controller.accept_call()<br />
end</p>
<p>Then /^customer hangs up the Call$/ do<br />
  puts &quot;Agent is hanging up the Call&quot;<br />
 @customer_controller.end_call()<br />
end</p>
<p>Then /^customer should get alerting on his phone$/ do<br />
  i = 0<br />
  #wait for the ringing event to come<br />
  while ! @customer_controller.is_ringing() &amp;&amp; i &lt; 10<br />
    sleep 1<br />
    i += 1<br />
  end</p>
<p>  if !@customer_controller.is_ringing()<br />
    raise &quot;Agent didn&#39;t get any incoming call&quot;<br />
  end<br />
end</p>
<p></p>
<p>There you go. The beauty of this approach is that now, even your product owner can write test steps without having any clue of SIP / SIPPER. This is just plain english! </p>
<p>The &quot;CommonCallController&quot; I wrote is neither  perfect not elegant. It uses instance variables to store the call state which can get wild for unexpected call flows. But It can easily be modified to suit your need. For me, it does its job for simple call flows.</p>
<p>There are plenty of documents on the web about how to use cucumber with Watir to automate webapplication testing..so I am not gonna talk about that. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sajidmoinuddin.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sajidmoinuddin.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sajidmoinuddin.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sajidmoinuddin.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sajidmoinuddin.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sajidmoinuddin.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sajidmoinuddin.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sajidmoinuddin.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sajidmoinuddin.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sajidmoinuddin.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sajidmoinuddin.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sajidmoinuddin.wordpress.com/168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sajidmoinuddin.wordpress.com/168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sajidmoinuddin.wordpress.com/168/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sajidmoinuddin.wordpress.com&amp;blog=7136446&amp;post=168&amp;subd=sajidmoinuddin&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sajidmoinuddin.wordpress.com/2010/03/13/integrate-sipper-with-cucumber-for-functional-automation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/36afa9ee82fbb53dd6e081646e2808d8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sajid</media:title>
		</media:content>
	</item>
	</channel>
</rss>
