<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2291731444407685134</id><updated>2012-01-18T23:41:24.575+01:00</updated><category term='install'/><category term='Ubuntu 10.10'/><category term='proxy'/><category term='ATM'/><category term='jdbc'/><category term='Pencil Sketch'/><category term='FileNotFound'/><category term='plug-in'/><category term='NTS'/><category term='SIP'/><category term='HTTP 404'/><category term='10.10'/><category term='parsing'/><category term='Security'/><category term='osx'/><category term='MAC'/><category term='OS X'/><category term='plugin'/><category term='OGNL'/><category term='SmartVoip'/><category term='windows'/><category term='Humor'/><category term='eclipse'/><category term='Spring'/><category term='WAS 6.1'/><category term='Android'/><category term='Emulator'/><category term='linux'/><category term='xml'/><category term='java jar classpath utility'/><category term='JBoss'/><category term='MySQL'/><category term='java'/><category term='usb'/><category term='Debian'/><category term='WordPress'/><category term='OS X 10.6.5'/><category term='spring-ws'/><category term='quiz'/><category term='commons digester'/><category term='MyBatis'/><category term='oracle'/><category term='ojdbc14'/><category term='PHP'/><category term='Firefox 4'/><category term='Firefox'/><category term='remote debugging'/><category term='Google Notebook'/><category term='apache http'/><category term='fun'/><category term='ubuntu'/><category term='j2ee'/><category term='JavaScript'/><category term='error'/><category term='Apache2'/><category term='Struts 2'/><category term='VOIP'/><title type='text'>This blog is all about me doing nothing serious :)</title><subtitle type='html'>Compilation of articles/ideas/problems-solutions which I faced over the period of time. Largely a place for me to document it as note-to-self</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>26</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-1119225463269965752</id><published>2011-12-04T19:38:00.001+01:00</published><updated>2011-12-05T09:42:57.837+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><category scheme='http://www.blogger.com/atom/ns#' term='OS X'/><category scheme='http://www.blogger.com/atom/ns#' term='NTS'/><category scheme='http://www.blogger.com/atom/ns#' term='WordPress'/><title type='text'>WordPress on OS X : Error establishing connection mysql</title><content type='html'>Recently I was trying to install/configure WordPress on OS X (Lion) with MySql 5.5. After reading the installation guide, I did not expect anything to go wrong, but as it goes without saying, theory is totally different from practical, I did face issue. After setting &lt;span class="inlinecode"&gt;wp-config.php&lt;/span&gt;, when I hit the &lt;span class="inlinecode"&gt;/wordpress/wp-admin/install.php&lt;/span&gt;, I got a nice page saying &lt;span class="inlinecode"&gt;Error establishing a database connection&lt;/span&gt;. Obvious reason for this would be (as mentioned on the error page) would be the wrong user/password or wrong host or wrong database name. I checked all parameters and none were wrong and I was also able to connect to MySQL database which I created for WordPress with MySQL WorkBench and also from mysql command line.&lt;br /&gt;&lt;br /&gt;To verify my settings, I just created and a test php page to test if I can connect to my newly create WordPress database. I was not able to connect and got some more details about no connection. I got following wraning&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;ErrorException [ Warning ]: mysql_connect() [function.mysql-connect]: [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock)&lt;/div&gt;Obviously when I checked &lt;span class="inlinecode"&gt;/var/mysql/mysql.sock&lt;/span&gt;, I could not find it. So next step was to find where is my missing &lt;span class="inlinecode"&gt;mysql.sock&lt;/span&gt; and found it under &lt;span class="inlinecode"&gt;/tmp&lt;/span&gt;. After googling a lot, I could not find any concrete solution to resolve this. Niether there is anything which I can change for MySQL configuration nor for the PHP configuration. So my last resort and the easy solution was creating a symbolic link. I just created a symbolic link on &lt;span class="inlinecode"&gt;/var/mysql&lt;/span&gt; to point to &lt;span class="inlinecode"&gt;/tmp&lt;/span&gt; (&lt;span class="inlinecode"&gt;sudo ln -s /tmp /var/mysql&lt;/span&gt;) and hit the refresh on WordPress installation page and everything was just smooth. Happy blogging :-)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;Cheers !!!&lt;br /&gt;- Jay&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-1119225463269965752?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/1119225463269965752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2011/12/wordpress-on-os-x-error-establishing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/1119225463269965752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/1119225463269965752'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2011/12/wordpress-on-os-x-error-establishing.html' title='WordPress on OS X : Error establishing connection mysql'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-2461174894665148596</id><published>2011-05-27T15:44:00.000+02:00</published><updated>2011-09-27T17:32:35.685+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='NTS'/><category scheme='http://www.blogger.com/atom/ns#' term='error'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android  Emulator Error unknown virtual device name</title><content type='html'>Couple of days back I got a windows system where I was required to do some changes for a Android app. So I started by downloading Android SDK and required packages. I created a AVD using SDK Manager. When I tried to start the AVD I got an error &lt;span class="inlinecode"&gt;emulator: ERROR: unknown virtual device name&lt;/span&gt;. Below is the snapshot for the same. &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-Q1mYn5od-dQ/Td-kYflWopI/AAAAAAAAA6w/__j3SsDGnYQ/s1600/android-avd-windows-startup-error.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="266" src="http://3.bp.blogspot.com/-Q1mYn5od-dQ/Td-kYflWopI/AAAAAAAAA6w/__j3SsDGnYQ/s400/android-avd-windows-startup-error.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;At that time I googled a bit and found the solution by reading couple of articles. Today again one of my colleagues faced the same issue and I was scratching my head to find out what was the solution. Again wasted around 30mins to find the solution. Finally it got working, but 30mins gone wasted on a problem for which I already searched and found solution in past. So just to avoid any such instance, as a note-to-myself, in this article I'll document the exact steps required to fix this issue&lt;br /&gt;&lt;br /&gt;Reason for this issue is Android SDK Manager (by default) expects the AVDs to be in &lt;span class="inlinecode"&gt;C:\Documents and Settings\&amp;lt;win_user&amp;gt;\.android&lt;/span&gt; (in case of win xp) directory when AVD is started. But when AVDs are created (by default) SDK Manager creates it under &lt;span class="inlinecode"&gt;C:\WINNT\.android&lt;/span&gt; directory. Here &lt;span class="inlinecode"&gt;&amp;lt;win_user&amp;gt;&lt;/span&gt; is the name of the user using which you have logged in to Windows PC.&lt;br /&gt;&lt;br /&gt;To resolve this, one of the solutions is to create a symbolic link to &lt;span class="inlinecode"&gt;C:\WINNT\.android&lt;/span&gt; directory. To do so, follow below mentioned steps&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download &lt;a class="newWindow" href="http://technet.microsoft.com/en-us/sysinternals/bb896768"&gt;Sysinternal's Junction utility&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Create a symbolic link using below command&lt;br /&gt;&lt;span class="inlinecode"&gt;junction "C:\Documents and Settings\&amp;lt;win_user&amp;gt;\.android" C:\WINNT\.android&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Try starting your AVD now. It should start&lt;/li&gt;&lt;li&gt;Done&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-2461174894665148596?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/2461174894665148596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2011/05/android-emulator-error-unknown-virtual.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/2461174894665148596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/2461174894665148596'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2011/05/android-emulator-error-unknown-virtual.html' title='Android  Emulator Error unknown virtual device name'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-Q1mYn5od-dQ/Td-kYflWopI/AAAAAAAAA6w/__j3SsDGnYQ/s72-c/android-avd-windows-startup-error.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-5350403281735002531</id><published>2011-04-05T22:56:00.002+02:00</published><updated>2011-04-05T22:58:12.003+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Firefox 4'/><category scheme='http://www.blogger.com/atom/ns#' term='Pencil Sketch'/><title type='text'>Installing Evolus Pencil Extention On Firefox 4</title><content type='html'>Recently we got a fabulous update of Firefox 4. With many good features and nice UI, we also get to see many extensions stop working. One of them is &lt;a class="newWindow" href="http://pencil.evolus.vn/en-US/Home.aspx"&gt;Evolus Pencil Sketch&lt;/a&gt;. Why, because the max version defined in metadata is 3.6.* and that stops the extension from installation. &lt;br /&gt;&lt;br /&gt;To get this thing working...&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download the &lt;span class="inlinecode"&gt;Pencil-1.2-0-fx.xpi&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Unzip it with your favorite zip archiver&lt;/li&gt;&lt;li&gt;Open &lt;span class="inlinecode"&gt;install.rdf&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Locate the string - &lt;span class="inlinecode"&gt;em:maxVersion="3.6.*"&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Replace it with - &lt;span class="inlinecode"&gt;em:maxVersion="4.*"&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Save the file. Now your file should look something as shown in below screenshot &lt;br /&gt;&lt;br /&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-HeWfgzyRWc4/TZt914QLPkI/AAAAAAAAA4Y/UZ-Qhfr1o6s/s1600/install.rdf.png" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Now archive all the files - install.rdf, update.rdf &amp;amp;  chrome.manifest - and the directory - chrome - into one zip file and  name it as Pencil-1.2-0-fx.xpi. It does not necessarily has to be  Pencil-1.2-0-fx.xpi, you can have it as MyFile.zip or anything of your  choice.&lt;/li&gt;&lt;li&gt;Now open up Firefox 4, go to Tools menu and select Add-ons&lt;/li&gt;&lt;li&gt;Click &lt;span class="inlinecode"&gt;Install Add-on From File...&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Select the archive you just created and you are done&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-5350403281735002531?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/5350403281735002531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2011/04/installing-evolus-pencil-extention-on.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/5350403281735002531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/5350403281735002531'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2011/04/installing-evolus-pencil-extention-on.html' title='Installing Evolus Pencil Extention On Firefox 4'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-HeWfgzyRWc4/TZt914QLPkI/AAAAAAAAA4Y/UZ-Qhfr1o6s/s72-c/install.rdf.png' height='72' width='72'/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-4739876958297418004</id><published>2011-03-14T17:29:00.000+01:00</published><updated>2011-09-27T17:32:51.210+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='NTS'/><category scheme='http://www.blogger.com/atom/ns#' term='MAC'/><category scheme='http://www.blogger.com/atom/ns#' term='osx'/><title type='text'>One Click Lock For Mac OSX</title><content type='html'>Since long, I was looking for some way to lock my MBP with keyboard shortcut (similar to windows - WIN + L). I googled a lot and found many suggestions from many users and also some utilities too :-). Finally now I got a clean solution to do this. Thanks to &lt;a class="newWindow" href="http://kubat.nl/"&gt;Karel&lt;/a&gt; who wrote a small how-to on this. If you are interested, have a look at his blogaria &lt;a class="newWindow" href="http://kubat.nl/pages/blogaria/239#239"&gt;http://kubat.nl/pages/blogaria/239#239&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-4739876958297418004?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/4739876958297418004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2011/03/one-click-lock-for-mac-osx.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/4739876958297418004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/4739876958297418004'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2011/03/one-click-lock-for-mac-osx.html' title='One Click Lock For Mac OSX'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-42944771532982192</id><published>2010-12-25T15:38:00.003+01:00</published><updated>2011-09-27T17:33:05.475+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='NTS'/><category scheme='http://www.blogger.com/atom/ns#' term='MAC'/><category scheme='http://www.blogger.com/atom/ns#' term='OS X 10.6.5'/><title type='text'>MySQL 5.5 Startup Problems On OS X 10.6.5</title><content type='html'>Today morning I downloaded &lt;a class="newWindow" href="http://www.mysql.com/downloads/mysql/"&gt;MySQL Community Server 5.5.8&lt;/a&gt; for OS X 10.6.5. I downloaded 64bit disk image and started installation by first installing &lt;span class="inlinecode"&gt;mysql-5.5.8-osx10.6-x86_64.pkg&lt;/span&gt;, followed by startup item - &lt;span class="inlinecode"&gt;MySQLStartupItem.pkg&lt;/span&gt; - and then the system pref pane - &lt;span class="inlinecode"&gt;MySQL.prefPane&lt;/span&gt;. Everything went well with the installation. After that I opened System Preference and clicked on MySQL pane to start the server. When I clicked on &lt;span class="inlinecode"&gt;Start MySQL Server&lt;/span&gt; button, nothing happened. Neither server started nor did I get any confirmation message or any error message. Reason for such failure to start is the server startup script - &lt;span class="inlinecode"&gt;mysql.server&lt;/span&gt; - is missing the MySQL installation directory path as well as MySQL data directory path. To resolve this locate &lt;span class="inlinecode"&gt;basedir=&lt;/span&gt; and put entry as shown below and save the file. &lt;span class="inlinecode"&gt;mysql.server&lt;/span&gt; file can be found under &lt;span class="inlinecode"&gt;/usr/local/mysql/support-files&lt;/span&gt; directory&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;basedir=/usr/local/mysql&lt;br /&gt;datadir=/usr/local/mysql/data&lt;/div&gt;&lt;br /&gt;Alternatively above entries can also be put in &lt;span class="inlinecode"&gt;/etc/my.cnf&lt;/span&gt; file too. Better place to put this instead of modifying packaged/default startup script - &lt;span class="inlinecode"&gt;/usr/local/mysql/support-files/mysql.server&lt;/span&gt;. Anyway its individual choice.&lt;br /&gt;&lt;br /&gt;Now try to start the server by clicking &lt;span class="inlinecode"&gt;Start MySQL Server&lt;/span&gt; button in MySQL System Preference pane. I could start the server and can create a new server instance using MySQL Workbench. I was a happy man. But my happiness did not end long. As soon as I restarted my laptop, I got an annoying alert...&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;Insecure Startup Item disabled. “/Library/StartupItems/MySQLCOM” has not been started because it does not have the proper security settings.&lt;/div&gt;This was because an entry in &lt;span class="inlinecode"&gt;/etc/hostconfig&lt;/span&gt; as &lt;span class="inlinecode"&gt;MYSQLCOM=-NO-&lt;/span&gt;. Due to ownership issue on startup item MySQLCOM, above alert was flashing on OS startup. To fix this just change the ownership of MySQLCOM startup item as shown below&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;sudo chown -R root:wheel /Library/StartupItems/MySQLCOM&lt;/div&gt;To test just logoff or restart the system and that Insecure Startup Item disabled alert should not come again. &lt;br /&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-42944771532982192?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/42944771532982192/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2010/12/mysql-55-startup-problems-on-os-x-1065.html#comment-form' title='48 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/42944771532982192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/42944771532982192'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2010/12/mysql-55-startup-problems-on-os-x-1065.html' title='MySQL 5.5 Startup Problems On OS X 10.6.5'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><thr:total>48</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-3101161832886688141</id><published>2010-12-20T22:18:00.002+01:00</published><updated>2010-12-20T22:29:15.857+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='spring-ws'/><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><title type='text'>Adding spring-ws-archetype In STS 2.5.1 / Eclipse</title><content type='html'>I recently started working on &lt;a class="newWindow" href="http://static.springsource.org/spring-ws/site/"&gt;Spring-WS&lt;/a&gt;. I'm already using &lt;a class="newWindow" href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html"&gt;Spring 3.0&lt;/a&gt;, so as IDE for development my obvious choice was &lt;a class="newWindow" href="http://www.springsource.com/developer/sts"&gt;STS&lt;/a&gt;. I downloaded the latest version 2.5.1 and launched the IDE. As mentioned on Spring reference documentation, I started with creating a new maven project in STS. Soon I realized that STS (at least version 2.5.1) doesn't come bundled with spring-ws archetype. STS requires this archetype to be added manually. It took me while to recall how to add a new archetype to STS (or say Eclipse). After a couple of minutes of head scratching I could recall. So for my future reference and probably for others help here is how you add a new archetype in STS OR Eclipse&lt;br /&gt;&lt;br /&gt;Step 1: Open STS&lt;br /&gt;Step 2: Start &lt;span class="inlinecode"&gt;New Project&lt;/span&gt; wizard and select Maven Project&lt;br /&gt;Step 3: Click Next on &lt;span class="inlinecode"&gt;Select project name and location&lt;/span&gt; dialog&lt;br /&gt;Step 4: On &lt;span class="inlinecode"&gt;Select an Archetype&lt;/span&gt; dialog click &lt;span class="inlinecode"&gt;Add Archetype...&lt;/span&gt; button. This will open Add Archetype dialog&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_8kCP03qMfVs/TQ_EXFxeOYI/AAAAAAAAAz8/rP9oJmtDd1M/s1600/select-archetype.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="350" src="http://3.bp.blogspot.com/_8kCP03qMfVs/TQ_EXFxeOYI/AAAAAAAAAz8/rP9oJmtDd1M/s400/select-archetype.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Select an Archetype Dialog&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Step 5: In &lt;span class="inlinecode"&gt;Add Archetype&lt;/span&gt; dialog add Archetype Group Id, Artifact Id and version as shown in below snapshot and click OK button&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_8kCP03qMfVs/TQ_FmYUrgRI/AAAAAAAAA0A/0XRKD5oU2As/s1600/add-archetype.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="225" src="http://2.bp.blogspot.com/_8kCP03qMfVs/TQ_FmYUrgRI/AAAAAAAAA0A/0XRKD5oU2As/s400/add-archetype.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Add Archetype Dialog&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Step 6: On click OK button STS will download required files from server and new archetype - &lt;span class="inlinecode"&gt;spring-ws-archetype&lt;/span&gt; - will be added to already bundled Nexus Indexer Archetype catalog as shown in below snapshot&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_8kCP03qMfVs/TQ_Gsz_quNI/AAAAAAAAA0E/Y591I_JrUHU/s1600/archetype-added.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="350" src="http://1.bp.blogspot.com/_8kCP03qMfVs/TQ_Gsz_quNI/AAAAAAAAA0E/Y591I_JrUHU/s400/archetype-added.png" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Added spring-ws-archetype&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div&gt;Step 7: Start creating project with newly added archetype.&amp;nbsp;&lt;/div&gt;&lt;div&gt;Step 8: Done !!!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Note&lt;/i&gt;&lt;/b&gt;: MVN Repository -&amp;nbsp;http://mvnrepository.com/ is a very good reference to find details of any maven artifacts and versions. I used the same to add details for spring-ws-archetype.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Cheers !!!&lt;/div&gt;&lt;div&gt;- Jay&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-3101161832886688141?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/3101161832886688141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2010/12/adding-spring-ws-archetype-in-sts-251.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/3101161832886688141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/3101161832886688141'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2010/12/adding-spring-ws-archetype-in-sts-251.html' title='Adding spring-ws-archetype In STS 2.5.1 / Eclipse'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_8kCP03qMfVs/TQ_EXFxeOYI/AAAAAAAAAz8/rP9oJmtDd1M/s72-c/select-archetype.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-5431485511122464930</id><published>2010-11-13T23:44:00.001+01:00</published><updated>2010-11-13T23:50:48.019+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu 10.10'/><category scheme='http://www.blogger.com/atom/ns#' term='proxy'/><title type='text'>Upgrading Ubuntu To New Release Behind Proxy</title><content type='html'>At my work place I connect to internet via proxy (requiring username/password). I've one desktop running Ubuntu 10.04 and wanted to upgrade to 10.10 the latest long term release. Even after applying all the updates shown in Update Manager, I never get to see the availability of new release. &lt;br /&gt;&lt;br /&gt;After lot of googling and playing around with proxy settings in Synaptic Package manager and also in Network Proxy, I found no success. On various forums also I see many facing the same problem. After some days of such struggle and trying different options to make update manager "read" my proxy settings I realized that Update Manager correctly detects the proxy settings to show the available updates, but the apt-get which actually checks for availability of new release does not "read" the proxy settings from the same location as Update Manager does. &lt;br /&gt;&lt;br /&gt;So as suggested on Ubuntu help pages on &lt;a href="https://help.ubuntu.com/community/AptGet/Howto#Setting up apt-get to use a http-proxy" class="newWindow"&gt;setting up proxy&lt;/a&gt;, I tried to temporarily setup proxy by exporting &lt;span class="inlinecode"&gt;http_proxy&lt;/span&gt; and then tried &lt;span class="inlinecode"&gt;sudo apt-get update&lt;/span&gt;. Still the result was same. Still no option to upgrade to 10.10 :-(&lt;br /&gt;&lt;br /&gt;After this I tried to change the proxy settings in &lt;span class="inlinecode"&gt;/etc/apt/apt.conf&lt;/span&gt; to provide proxy along with the username/password. After saving the changes, apt-get successfully updated all the packages from the repositories and Update Manager showed me the 10.10 availability message. &lt;br /&gt;&lt;br /&gt;So even though Ubuntu help page says that you can set the proxy temporarily by exporting http_proxy, it seems apt-get ignores http_proxy and always refers to atp.conf (/etc/apt/apt.conf). Well things are not always as it should be and it applies to worlds one of the best OS too. &lt;br /&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-5431485511122464930?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/5431485511122464930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2010/11/upgrading-ubuntu-to-new-release-behind.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/5431485511122464930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/5431485511122464930'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2010/11/upgrading-ubuntu-to-new-release-behind.html' title='Upgrading Ubuntu To New Release Behind Proxy'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-2518533291314995842</id><published>2010-11-13T22:34:00.005+01:00</published><updated>2010-12-15T09:52:57.502+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><category scheme='http://www.blogger.com/atom/ns#' term='MyBatis'/><title type='text'>Using MyBatis 3 with Spring 3 Using Mapper XML Files</title><content type='html'>Recently I started to work on design an application as a part of a new project assigned to me at my work place. Since this is totally a new application to be developed from scratch, I got liberty/flexibility to choose the tools/frameworks which will form the foundation of the application. With lots of frameworks to choose from and many choices available for different tiers, I started evaluating each framework against the requirement of the application vs where it fits in which tier. When I came to data access tier (resource tier as some say), I realized that MyBatis (new name of iBatis after it moved to Google code from Apache) was best fit as ORM framework. I also decided to use Spring 3.x as DI framework and we all know how well MyBatis/iBatis and Spring (beans, data access, transaction etc) gel with each other. Using Spring's DI, declarative transaction management and MyBatis' query externalization, we as a developer can concentrate on implementing application/business logic and keep rest of the stuff like transaction management, JDBC resource management etc to be "headache" of container/frameworks. &lt;br /&gt;&lt;br /&gt;So as I decided to go with MyBatis, I came to know that Spring 3.0 development finished first then MyBatis 3 and hence there is no official support in Spring 3.0 for MyBatis 3.0. Its expected to be there in Spring 3.1 release (Source: &lt;a class="newWindow" href="http://code.google.com/p/mybatis/downloads/list?can=3&amp;amp;q=Product%3DSpring"&gt;Spring-MyBatis integration RC2 reference doc&lt;/a&gt;). But thanks to MyBatis community, there is already a project for myabtis-spring integrations. At start I struggled a bit on how to wire Spring beans, dao with MyBatis  mapper configuration files. As I was googling around, I stumbled upon a &lt;a class="newWindow" href="http://www.jpadbf.org/2010/09/mybatis3-spring3-integration-a-first-look/"&gt;very good post&lt;/a&gt; by Giovanni Cuccu on this. It was very enlightening and provided me a good start. I created a maven/spring/mybatis project in my eclipse and started writing down some quick and crude code to test out. As soon as I tried to run my sample code I encountered...&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;java.lang.IllegalArgumentException: Property 'sqlSessionTemplate' is required&lt;/pre&gt;After debugging the mybatis-spring integration source code, I found that since I was using Spring DAO using mybatis-spring integration,  &lt;span class="inlinecode"&gt;org.mybatis.spring.support.SqlSessionDaoSupport&lt;/span&gt; class' &lt;span class="inlinecode"&gt;checkDaoConfig&lt;/span&gt; explicitly checks for the &lt;span class="inlinecode"&gt;sqlSessionTemplate&lt;/span&gt; property to be defined. After trying for some time and to no success, I changed my DAO implementation to be a mapper interface using MapperFactoryBean. This eliminated of having a class implementing SqlSessionDaoSupport just to invoke Spring's SqlMapClientTemplate's helper methods. Instead now its just an interface holding method signatures mirroring the java representation of mapped sql statements in MyBatis mapper configuration files. With this changed implementation, everything worked like a charm. &lt;br /&gt;&lt;br /&gt;Here is the spring wiring I did to make mybatis-spring work with mapper files. Usually I keep my spring configuration logically separated by keep configuration related to data access in one file and application DAOs go to another. So with this I end up creating four configuration files and one java interface for this project.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;data-access-spring-context.xml: Holding spring configuration defining my data access&lt;/li&gt;&lt;li&gt;mybatis-config.xml: Standard MyBatis configuration file&lt;/li&gt;&lt;li&gt;user-dao.xml: MyBatis mapper file. One mapper file for one DAO defined in dao-spring-context.xml&lt;/li&gt;&lt;li&gt;dao-spring-context.xml: Holding all DAOs used by application&lt;/li&gt;&lt;li&gt;UserDAO.java&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Version of various plugin and framework I used for this little POC...&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Spring&amp;nbsp;3.0.5&lt;/li&gt;&lt;li&gt;MyBatis 3.0.2&lt;/li&gt;&lt;li&gt;MyBatis-Spring 1.0.0-RC2&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;Let's start visiting each of these files to understand the required configuration...&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;data-access-spring-context.xml:&lt;/b&gt;&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;beans xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans" xsi:schemalocation="http://www.springframework.org/schema/beans &lt;br /&gt;                        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd&lt;br /&gt;                        http://www.springframework.org/schema/tx &lt;br /&gt;                        http://www.springframework.org/schema/tx/spring-tx-3.0.xsd&lt;br /&gt;                        http://www.springframework.org/schema/aop &lt;br /&gt;                        http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"&gt;&lt;br /&gt;&lt;br /&gt;    &lt;bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" id="propertyConfigurer"&gt;&lt;br /&gt;        &lt;property name="location"&gt;&lt;br /&gt;            &lt;value&gt;classpath:jdbc.properties&lt;/value&gt;&lt;br /&gt;        &lt;/property&gt;&lt;br /&gt;    &lt;/bean&gt;&lt;br /&gt;&lt;br /&gt;    &lt;bean class="org.springframework.jndi.JndiObjectFactoryBean" id="dataSource"&gt;&lt;br /&gt;        &lt;property name="jndiName"&gt;&lt;br /&gt;            &lt;value&gt;${DataSource.JndiName.DS}&lt;/value&gt;&lt;br /&gt;        &lt;/property&gt;&lt;br /&gt;        &lt;property name="resourceRef"&gt;&lt;br /&gt;            &lt;value&gt;false&lt;/value&gt;&lt;br /&gt;        &lt;/property&gt;&lt;br /&gt;    &lt;/bean&gt;&lt;br /&gt;&lt;br /&gt;   &lt;bean class="org.mybatis.spring.SqlSessionFactoryBean" id="sqlSessionFactory"&gt;&lt;br /&gt;        &lt;property name="configLocation" value="classpath:com/jak/sandbox/config/dataaccess/sqlmap/mybatis-config.xml"&gt;&lt;br /&gt;        &lt;property name="dataSource" ref="dataSource"&gt;&lt;br /&gt;    &lt;/property&gt;&lt;/property&gt;&lt;/bean&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;bean class="org.mybatis.spring.SqlSessionTemplate" id="sqlSessionTemplate"&gt;&lt;br /&gt;        &lt;property name="sqlSessionFactory" ref="sqlSessionFactory"&gt;&lt;br /&gt;    &lt;/property&gt;&lt;/bean&gt;&lt;br /&gt;    &lt;br /&gt;&lt;/beans&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;For simplicity, I've not included the transaction manager, advice point cut etc in this. So here, main point of interest is how the sql session factory and sql session template is configured which actually wires MyBatis configuration to Spring data access&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;mybatis-config.xml:&lt;/b&gt;&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;configuration&gt;&lt;br /&gt;    &lt;typealiases&gt;&lt;br /&gt;        &lt;typealias alias="User" type="com.jak.sandbox.shared.dto.model.User"&gt;&lt;br /&gt;    &lt;/typealias&gt;&lt;/typealiases&gt;&lt;br /&gt;    &lt;mappers&gt;&lt;br /&gt;        &lt;mapper resource="com/jak/sandbox/biz/dataaccess/sqlmap/module/user-dao.xml"&gt;&lt;br /&gt;    &lt;/mapper&gt;&lt;/mappers&gt;&lt;br /&gt;&lt;/configuration&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;This is a standard MyBatis configuration file, holding all the mappers of the applications.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;user-dao.xml&lt;/b&gt;&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;mapper namespace="com.jak.sandbox.biz.dao.UserDAO"&gt;&lt;br /&gt;    &lt;resultmap id="UserMap" type="User"&gt;&lt;br /&gt;        &lt;result column="ID" property="userId"&gt;&lt;br /&gt;        &lt;result column="NAME" property="userName"&gt;&lt;br /&gt;    &lt;/result&gt;&lt;/result&gt;&lt;/resultmap&gt;&lt;br /&gt;&lt;br /&gt;    &lt;select id="selectUsers" resultmap="UserMap"&gt;&lt;br /&gt;        SELECT ID, NAME FROM&lt;br /&gt;        USERS&lt;br /&gt;    &lt;/select&gt;&lt;br /&gt;&lt;/mapper&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;Here I've defined a SQL queries required my my User DAO. User DAO is wired to spring data access and mybatis in my DAO spring context i.e. dao-spring-context.xml&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;dao-spring-context.xml:&lt;/b&gt;&lt;br /&gt;&lt;pre class="brush: xml"&gt;&lt;beans xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans" xsi:schemalocation="http://www.springframework.org/schema/beans &lt;br /&gt;                        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"&gt;&lt;br /&gt;&lt;br /&gt;    &lt;bean class="org.mybatis.spring.MapperFactoryBean" id="userDAO"&gt;&lt;br /&gt;        &lt;property name="sqlSessionTemplate" ref="sqlSessionTemplate"&gt;&lt;br /&gt;        &lt;property name="mapperInterface" value="com.jak.sandbox.biz.dao.UserDAO"&gt;&lt;br /&gt;    &lt;/property&gt;&lt;/property&gt;&lt;/bean&gt;&lt;br /&gt;&lt;/beans&gt;&lt;br /&gt;&lt;/pre&gt;Notice that the fully qualified interface name defined as mapperInterface serves as the namespace for the mapper in &lt;span class="inlinecode"&gt;user-dao.xml&lt;/span&gt;. &lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;UserDAO.java&lt;/b&gt;:&lt;br /&gt;&lt;pre class="brush: java"&gt;package com.jak.sandbox.biz.dao;&lt;br /&gt;&lt;br /&gt;import java.util.List;&lt;br /&gt;&lt;br /&gt;import com.jak.sandbox.shared.dto.model.User;&lt;br /&gt;&lt;br /&gt;public interface UserDAO&lt;br /&gt;{&lt;br /&gt;    List&amp;lt;User&amp;gt; selectUsers();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Well this is pretty much you need to do in order to use MyBatis with Spring. Now just write a test program which loads both spring context as defined above, inject &lt;span class="inlinecode"&gt;userDAO&lt;/span&gt; bean to any of your Java class (typically a business service) and invoke &lt;span class="inlinecode"&gt;selectUsers&lt;/span&gt; method. &lt;br /&gt;&lt;br /&gt;MyBatis &amp;amp; Spring made data access so simple and using interface as your data access and having implementation as MyBatis mappers, makes data access more cleaner. This is because ideally your data access should only be taking request from business tier to perform some operations like select/insert/update/delete and return the result of such operation back. There should not be any logic. Having your data access as interfaces, takes the any chances of developer mistakenly putting any logic.&lt;br /&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-2518533291314995842?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/2518533291314995842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2010/11/using-mybatis-3-with-spring-3-using.html#comment-form' title='23 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/2518533291314995842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/2518533291314995842'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2010/11/using-mybatis-3-with-spring-3-using.html' title='Using MyBatis 3 with Spring 3 Using Mapper XML Files'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><thr:total>23</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-2845447321187626581</id><published>2010-11-10T00:21:00.025+01:00</published><updated>2010-11-13T19:44:18.042+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Emulator'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>With JavaScript Android Emulator Webkit Is More Forgiving Then Webkit on Phone</title><content type='html'>Recently I was developing a mobile application on Android platform which involves various widgets of Android along with some stuff with JavaScript and WebView (Would like to write a post on my experience with Android development - may be later). Actually I wanted to plot some graphs and for that matter I opted for jQuery and &lt;a href="http://code.google.com/p/flot/" class="newWindow"&gt;flot plugin&lt;/a&gt;. Flot is an amazing plugin you can get to plot some really professional graphs. Well, while plotting some of the graphs, I started with some JavaScript code and writing a JavaScript handle which basically just creates JSON objects and arrays to use as my input data to flot to plot the graphs.&lt;br /&gt;&lt;br /&gt;As most of the Android developers, I also use Android emulator to test my code. Once I have a bit of working code, I put it on my HTC Desire to get the actual feeling. So with these graph, I wrote couple of JS function along with JS handler, I deployed my first cut of the graph to my Android 1.6 emulator (API Level 4) and launched the application. Graph got plotted as expected. So far so good. I added couple of improvements, like enabling hovers, clicks, legends etc and then again tested on emulator. It gave expected results. So now it was time to deploy it on my HTC Desire. After deploying it, when I launched the application, I could just see the white screen of WebView and nothing else. No beautiful graphs. Checked LogCat, Eclipse console, everything was fine. No error/warning messages. I again tested the same on emulator and it was working like a charm.&lt;br /&gt;&lt;br /&gt;After doing a lot of debugging with JavaScript code (let me confess, it was more of hit-and-try) I found that I declared couple of JS variables like&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: jscript"&gt;    var x = 0,&lt;br /&gt;    var y = 1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Notice the comma after &lt;span class="inlinecode"&gt;var x = 0 &lt;/span&gt; ? Ideally it should be semicolon but as all developers do silly mistakes, I also had slip of finger. This was not highlighted by the Eclipse HTML editor and it worked quite well on emulator. But when it came to actual phone, this was caught and it stopped everything. Liked that WebKit/WebView is very strict, but at the same time emulator behaved differently. Also there were no logs logged in LogCat. This behavior of emulator really scared me. I know it was a mistake on my part, but at least emulator should behave in same manner as actual software does. I sincerely hope that with new upcoming updates (may be with Gingerbread) this kind of issues are resolved and we can see the consistent behavior of emulator and phone software. &lt;br /&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-2845447321187626581?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/2845447321187626581/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2010/11/with-javascript-android-emulator-webkit.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/2845447321187626581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/2845447321187626581'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2010/11/with-javascript-android-emulator-webkit.html' title='With JavaScript Android Emulator Webkit Is More Forgiving Then Webkit on Phone'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-6285092024714376711</id><published>2010-10-30T09:49:00.003+02:00</published><updated>2010-10-30T09:52:22.858+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='install'/><category scheme='http://www.blogger.com/atom/ns#' term='10.10'/><category scheme='http://www.blogger.com/atom/ns#' term='usb'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Problems With Ubuntu 10.x USB Installation</title><content type='html'>Recently I was trying to install Ubuntu 10.10 on one of my friends' Dell mini notebook after his windows 7 starter &amp;nbsp;crashed horribly and left him with black/blue screen and no more boots. After trying for 2-3 days to get windows back to life without any success, my friend heard some golden worlds to move to Ubuntu. We decided to get his mini a great OS. Since I ran out of blank CD/DVD, we decided to create a bootable USB with Ubuntu installer on it and install Ubuntu over the weekend.&lt;br /&gt;&lt;br /&gt;So it was Friday night where we were quite excited to get Maverick Meerkat installed and to start with downloaded the ISO image of it from Ubuntu site. I never tried a USB install so was bit skeptic too on if it will go well on my friend's Dell mini. For this my dear friend also bought a brand new 4GB &lt;a href="http://goo.gl/GfbI" class="newWindow"&gt;Duracell&lt;/a&gt; USB drive on which we decided to make a startup disk. We started following the guidelines as mentioned on &lt;a href="http://www.ubuntu.com/desktop/get-ubuntu/download" class="newWindow"&gt;Ubuntu download page&lt;/a&gt;. After download was complete, my friend's brand new USB drive was deflowered by creating the Ubuntu startup disk. So far so good, all went well. &lt;br /&gt;&lt;br /&gt;After ensuring that USB device is the first in boot sequence, we started the notebook. Within seconds we saw Ubuntu up and running from USB with an icon to start installation on the desktop. Without further ado, we started the installation by clicking the install icon. It first asked for the language to select, then timezone and third was keyboard selection. So far so good, everything was going quite well. After we hit forward button from Keyboard selection, nothing happened except the tiny loading image circulating. &lt;br /&gt;&lt;br /&gt;After sometime when nothing happened, I turned to my dear friend - &lt;a href="http://www.google.com/" class="newWindow"&gt;Google&lt;/a&gt; - for rescue. Tried couple of "smart solutions" posted by many and to no help, I found a &lt;a href="http://www.uluga.ubuntuforums.org/showthread.php?p=9467136" class="newWindow"&gt;post&lt;/a&gt; with an &lt;a href="http://ubuntuforums.org/showthread.php?p=9467124" class="newWindow"&gt;unusual solution&lt;/a&gt;. &lt;b&gt;Change the USB drive you are using as startup disk&lt;/b&gt;. Can you believe this? But as you know a frustrated person will do anything to get things work, I took out my &lt;a href="http://www3.pny.com/category_buymulti.aspx?Category_ID=395" class="newWindow"&gt;PNY Micro Attaché&lt;/a&gt;, dumped all crap from it to my laptop and created a fresh startup disk. With very less hopes we booted friend's notebook with it and restarted the installation. To my surprise installation progressed like a charm. I did see the partition manager after clicking forward on keyboard selection dialog and rest of the installation went well. &lt;br /&gt;&lt;br /&gt;At the end, this whole process brought my friend again back to life when he could surf and do all stuff on his notebook again and left me with many questions to which I'm still trying to understand such a behavior. What possibly could go wrong with installation and what it has to do with the make of a USB drive. If system can be booted from a USB drive and Ubuntu just working fine booted from USB then why installation can not go ahead with the same USB drive? Let me know if you have any clue or a proper answer to this.&lt;br /&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-6285092024714376711?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/6285092024714376711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2010/10/problems-with-ubuntu-10x-usb.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/6285092024714376711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/6285092024714376711'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2010/10/problems-with-ubuntu-10x-usb.html' title='Problems With Ubuntu 10.x USB Installation'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-8677415203181866809</id><published>2010-07-16T17:59:00.004+02:00</published><updated>2010-11-13T19:45:17.132+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Struts 2'/><category scheme='http://www.blogger.com/atom/ns#' term='FileNotFound'/><category scheme='http://www.blogger.com/atom/ns#' term='WAS 6.1'/><category scheme='http://www.blogger.com/atom/ns#' term='HTTP 404'/><title type='text'>Struts 2.x Application Deployment On WAS 6.1</title><content type='html'>Recently one my colleagues - @chaituvj - was trying to deploy a Struts 2.1 web application on WAS 6.1. Upon hitting the first action (*.action), page showed HTTP 404: File Not Found error and  WAS threw following exception&lt;br /&gt;&lt;pre class="brush: java"&gt;java.io.FileNotFoundException: /login.action&lt;br /&gt;      at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:414)&lt;br /&gt;      at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:113)&lt;br /&gt;      at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3276)&lt;br /&gt;      at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)&lt;br /&gt;      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)&lt;br /&gt;      at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)&lt;br /&gt;      at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:113)&lt;br /&gt;      ...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Same war file works like a charm on JBoss and Tomcat container, but when it comes to WAS 6.1, it just cant find the struts action URLs. &lt;br /&gt;&lt;br /&gt;Upon reviewing application code, configurations a zillion time we turned to the life saver - Google. Instantly we realized that we are not the only unlucky soles. Upon going through many posts we found that WAS 6.1 web container by default does not invoke any of the custom servlet filters defined in web.xml. This means that it does not invoke the Struts 2 filter and hence Struts application context was never initialized (Smart IBM guys). To change this behavior and enable invocation of custom filters, a custom property needs to be defined for the web container under WAS 6.1. Here is what you need to do...&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Open the WAS admin console.&lt;/li&gt;&lt;li&gt;Select the application server where you are deploying the *ill-fated* Struts 2 application&lt;/li&gt;&lt;li&gt;Select &lt;span class="inlinecode"&gt;Web Container Settings&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Select &lt;span class="inlinecode"&gt;Web Container&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Select &lt;span class="inlinecode"&gt;Custom Properties&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Define new property &lt;span class="inlinecode"&gt;com.ibm.ws.webcontainer.invokefilterscompatibility&lt;/span&gt; and set its value as &lt;span class="inlinecode"&gt;true&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Restart application server&lt;/li&gt;&lt;li&gt;Done !!!&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;With above change your Struts 2 web app should start working with WAS 6.1&lt;br /&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-8677415203181866809?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/8677415203181866809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2010/07/struts-2x-applications-on-was-61.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/8677415203181866809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/8677415203181866809'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2010/07/struts-2x-applications-on-was-61.html' title='Struts 2.x Application Deployment On WAS 6.1'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-970671487798581092</id><published>2010-06-22T17:58:00.017+02:00</published><updated>2010-11-13T19:46:19.290+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><category scheme='http://www.blogger.com/atom/ns#' term='JBoss'/><title type='text'>Connecting MySQL 5.1 Database Remotely Using JDBC</title><content type='html'>Recently I installed MySQL 5.1 on my &lt;a class="newWindow" href="https://wiki.ubuntu.com/LucidLynx/"&gt;Ubuntu Lucid Lynx&lt;/a&gt; and then was trying to connect to database from my windows machine and stuck with following exception&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: java"&gt;com.mysql.jdbc.CommunicationsException: Communications link failure&lt;br /&gt;&lt;br /&gt;Last packet sent to the server was 0 ms ago.&lt;br /&gt;     at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1070)&lt;br /&gt;     at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2104)&lt;br /&gt;     at com.mysql.jdbc.ConnectionImpl.&lt;init&gt;(ConnectionImpl.java:729)&lt;br /&gt;     at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:298)&lt;br /&gt;     at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:283)&lt;br /&gt;     at java.sql.DriverManager.getConnection(DriverManager.java:512)&lt;br /&gt;     at java.sql.DriverManager.getConnection(DriverManager.java:171)&lt;br /&gt;     at com.jak.sandbox.hsm.HSMTest.testJDBC(HSMTest.java:35)&lt;br /&gt;     at com.jak.sandbox.hsm.HSMTest.main(HSMTest.java:24)&lt;br /&gt;Caused by: java.net.ConnectException: Connection refused: connect&lt;br /&gt;     at java.net.PlainSocketImpl.socketConnect(Native Method)&lt;br /&gt;     at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)&lt;br /&gt;     at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)&lt;br /&gt;     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)&lt;br /&gt;     at java.net.Socket.connect(Socket.java:452)&lt;br /&gt;     at java.net.Socket.connect(Socket.java:402)&lt;br /&gt;     at java.net.Socket.&lt;init&gt;(Socket.java:309)&lt;br /&gt;     at java.net.Socket.&lt;init&gt;(Socket.java:153)&lt;br /&gt;     at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)&lt;br /&gt;     at com.mysql.jdbc.MysqlIO.&lt;init&gt;(MysqlIO.java:276)&lt;br /&gt;     at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2027)&lt;br /&gt; ... 7 more&lt;br /&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/init&gt;&lt;/pre&gt;&lt;br /&gt;After googling a lot and reading may forums finally found solution from &lt;a class="newWindow" href="http://ubuntuforums.org/showthread.php?t=491471"&gt;Ubuntu Forums&lt;/a&gt;. Here is the deal&lt;br /&gt;&lt;ol&gt;&lt;li&gt;By default MySQL 5.1 allows only local connection&lt;/li&gt;&lt;li&gt;Remote connections should explicitly be turned on&lt;/li&gt;&lt;/ol&gt;As with the previous version of MySQL, where server starts with &lt;span class="inlinecode"&gt;--skip-networking&lt;/span&gt; to prevent all TCP/IP connections, MySQL 5.1 does this by means of configuration in &lt;span class="inlinecode"&gt;my.cnf&lt;/span&gt; file. This file stores all the configuration on how server starts.  Default configuration is to prevent all TCP/IP connections. This means that if you want your JAVA application to talk to MySQL database, you will see the above mentioned exception. This default configuration is displayed in below snapshot...&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;img border="0" height="88" src="http://1.bp.blogspot.com/_8kCP03qMfVs/TCDcvQ9FCOI/AAAAAAAAAvc/bqhosdNgZXw/s640/Screenshot.png" width="640" /&gt;&lt;/div&gt;&lt;br /&gt;So to allow TCP/IP connections just comment out the line &lt;span class="inlinecode"&gt;bind-address  =  127.0.0.1&lt;/span&gt; and restart the server. Settings mentioned here opens up connection from any IP. So not might be a very good configuration if we think in terms of database administration or security. But for a developer like me, this suffices the requirement. Regarding database administration and security, let me not poke my nose and leave it upto smart database administrators.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;[UPDATE - 22 July 2010 16:48] &lt;/b&gt;- Found same issue (rather default configuration) for JBoss too. When you run JBoss application server with default configuration, it will not be accessible over internet/intranet. It will be accessible only on localhost. To make it available over the internet/intranet, start JBoss with &lt;span class="inlinecode"&gt;run -b 0.0.0.0&lt;/span&gt; and it should work.&lt;br /&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-970671487798581092?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/970671487798581092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2010/06/connecting-mysql-51-database-remotely.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/970671487798581092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/970671487798581092'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2010/06/connecting-mysql-51-database-remotely.html' title='Connecting MySQL 5.1 Database Remotely Using JDBC'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_8kCP03qMfVs/TCDcvQ9FCOI/AAAAAAAAAvc/bqhosdNgZXw/s72-c/Screenshot.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-1374229912952436690</id><published>2010-04-09T14:52:00.031+02:00</published><updated>2010-11-13T19:52:04.715+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Debian'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache2'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='proxy'/><title type='text'>Setting Reverse Proxy With Apache2 on Ubuntu (Debian)</title><content type='html'>Apache HTTP server is probably the most used open source free web server and does not require any introduction. Also setting up reverse proxy using Apache is also not new. In fact this blog entry does not talk about anything new. Over here I'm just jotting down easy to follow steps to setup a reverse proxy using &lt;a class="newWindow" href="http://httpd.apache.org/"&gt;Apache 2.2&lt;/a&gt; on Ubuntu or any Debian flavor. &lt;br /&gt;&lt;br /&gt;Main reason for writing this is, I've basically used Apache2 on windows and configuration is bit different then how it's on Debian. In windows typically you will find all configuration under httpd.conf file where you can load any particular module using &lt;span class="inlinecode"&gt;LoadModule&lt;/span&gt;. This is not how Apache2 works exactly with Debian. With a typical install, you will find httpd.conf totally empty. Also loading modules dynamically does not work by having &lt;span class="inlinecode"&gt;LoadModule&lt;/span&gt; declaration.&lt;br /&gt;&lt;br /&gt;Without going much into details of these differences, I'll just write down how to setup reverse proxy...&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;Load required modules&lt;/b&gt; - &lt;span class="inlinecode"&gt;proxy&lt;/span&gt;, &lt;span class="inlinecode"&gt;proxy_http&lt;/span&gt;, &lt;span class="inlinecode"&gt;proxy_connect&lt;/span&gt;&lt;br /&gt;&lt;div class="code"&gt;sudo a2enmode proxy_connect&lt;br /&gt;sudo a2enmode proxy_http&lt;/div&gt;Above will automatically enable &lt;span class="inlinecode"&gt;proxy&lt;/span&gt; module.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Configure Site&lt;/b&gt; - Change your directory to the site for which you want to setup reverser proxy. For simplicity, I'll refer to the default site located at &lt;span class="inlinecode"&gt;/etc/apache2/sites-enabled&lt;/span&gt;. You need to have root privilege to modify the site configuration. Below is the typical content for the default site i.e. &lt;span class="inlinecode"&gt;000-default&lt;/span&gt;&lt;br /&gt;&lt;pre class="brush: xml"&gt;&amp;lt;virtualhost *:80&gt;&lt;br /&gt;    ServerAdmin webmaster@localhost&lt;br /&gt;&lt;br /&gt;    DocumentRoot /var/www&lt;br /&gt;    &amp;lt;directory /&gt;&lt;br /&gt;        Options FollowSymLinks&lt;br /&gt;        AllowOverride None&lt;br /&gt;    &amp;lt;/Directory&gt;&lt;br /&gt;    &amp;lt;directory /var/www/&gt;&lt;br /&gt;        Options Indexes FollowSymLinks MultiViews&lt;br /&gt;        AllowOverride None&lt;br /&gt;        Order allow,deny&lt;br /&gt;        Allow from all&lt;br /&gt;    &amp;lt;/Directory&gt;&lt;br /&gt;&lt;br /&gt;    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/&lt;br /&gt;    &amp;lt;directory "/usr/lib/cgi-bin"&gt;&lt;br /&gt;        AllowOverride None&lt;br /&gt;        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch&lt;br /&gt;        Order allow,deny&lt;br /&gt;        Allow from all&lt;br /&gt;    &amp;lt;/Directory&gt;&lt;br /&gt;&lt;br /&gt;    ErrorLog /var/log/apache2/error.log&lt;br /&gt;&lt;br /&gt;    # Possible values include: debug, info, notice, warn, error, crit,&lt;br /&gt;    # alert, emerg.&lt;br /&gt;    LogLevel warn&lt;br /&gt;&lt;br /&gt;    CustomLog /var/log/apache2/access.log combined&lt;br /&gt;&lt;br /&gt;    Alias /doc/ "/usr/share/doc/"&lt;br /&gt;    &amp;lt;directory "/usr/share/doc/"&gt;&lt;br /&gt;        Options Indexes MultiViews FollowSymLinks&lt;br /&gt;        AllowOverride None&lt;br /&gt;        Order deny,allow&lt;br /&gt;        Deny from all&lt;br /&gt;        Allow from 127.0.0.0/255.0.0.0 ::1/128&lt;br /&gt;    &amp;lt;/Directory&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/VirtualHost&gt;&lt;/pre&gt;&lt;br /&gt;To setup a reverse proxy for URL http://localhost:8080/myapp/ please add following lines at the end of the VirtualHost tag as displayed above...&lt;br /&gt;&lt;div class="code"&gt;ProxyPass /myapp/ http://localhost:8080/myapp/&lt;br /&gt;ProxyPassReverse /myapp/ http://localhost:8080/myapp/&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Enable access&lt;/b&gt; - To allow access for all requests to this proxy, edit &lt;span class="inlinecode"&gt;/etc/apache2/mods-available/proxy.conf&lt;/span&gt;.  By default access to all is denied. To enable the access, put line &lt;span class="inlinecode"&gt;Allow from all&lt;/span&gt;. Typical proxy.conf after this change will look something like...&lt;br /&gt;&lt;pre class="brush: xml"&gt;&amp;lt;IfModule mod_proxy.c&gt;&lt;br /&gt;    #turning ProxyRequests on and allowing proxying from all may allow&lt;br /&gt;        #spammers to use your proxy to send email.&lt;br /&gt;&lt;br /&gt;        ProxyRequests Off&lt;br /&gt;&lt;br /&gt;        &amp;lt;Proxy *&gt;&lt;br /&gt;                AddDefaultCharset off&lt;br /&gt;                Order deny,allow&lt;br /&gt;                Deny from all&lt;br /&gt;                Allow from all&lt;br /&gt;        &amp;lt;/Proxy&gt;&lt;br /&gt;&lt;br /&gt;        # Enable/disable the handling of HTTP/1.1 "Via:" headers.&lt;br /&gt;        # ("Full" adds the server version; "Block" removes all outgoing Via: headers)&lt;br /&gt;        # Set to one of: Off | On | Full | Block&lt;br /&gt;&lt;br /&gt;        ProxyVia On&lt;br /&gt;&amp;lt;/IfModule&gt;&lt;/pre&gt;&lt;br /&gt;Note the line &lt;span class="inlinecode"&gt;ProxyRequests Off&lt;/span&gt;. This is important in order to enable reverse proxy&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Restart Apache2&lt;/b&gt; - To get all of above configuration changes in effect, have a clean restart. Recommended way is...&lt;br /&gt;&lt;div class="code"&gt;sudo apache2ctl graceful&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Done !!!&lt;/b&gt; Happy reverse proxying&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-1374229912952436690?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/1374229912952436690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2010/04/setting-reverse-proxy-with-apache2-on.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/1374229912952436690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/1374229912952436690'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2010/04/setting-reverse-proxy-with-apache2-on.html' title='Setting Reverse Proxy With Apache2 on Ubuntu (Debian)'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-2564626564115198533</id><published>2010-03-23T23:40:00.008+01:00</published><updated>2010-03-23T23:44:59.381+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SIP'/><category scheme='http://www.blogger.com/atom/ns#' term='VOIP'/><category scheme='http://www.blogger.com/atom/ns#' term='SmartVoip'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Using SmartVoip on Ubuntu 9.10 using Linphone</title><content type='html'>Since long time I was looking a way to use &lt;a class="newWindow" href="https://www.smartvoip.com/en/index.html"&gt;SmartVoip&lt;/a&gt; on Ubuntu. I searched some forums just to discover that there are many who are looking for the same. One of the articles mentioned that Ekiga Softphone shipped with default Ubuntu installation can be configured to use SmartVoip SIP details, but unfortunately I could not manage to configure it 100%.&lt;br /&gt;&lt;br /&gt;Finally today I managed to find how using &lt;a class="newWindow" href="http://www.linphone.org/"&gt;Linphone&lt;/a&gt;&amp;nbsp;I can use SmartVoip SIP details and make calls. In this article I'll mention how to configure Linphone to use&amp;nbsp;your&amp;nbsp;SmartVoip account details on Ubuntu 9.10 a.k.a "Karmic Koala" with a hope that it will help some poor soul like me who is looking for really easy to configure softphone to use SmartVoip on Ubuntu. So here it goes...&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Get Linphone. Either download it from&amp;nbsp;&lt;a class="newWindow" href="http://www.linphone.org/"&gt;http://www.linphone.org/&lt;/a&gt;&amp;nbsp;OR use Ubuntu Software Center to download and install it easily.&lt;/li&gt;&lt;li&gt;Once installed open Linphone...&lt;br/&gt;&lt;br /&gt;&lt;div style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_8kCP03qMfVs/S6k-liCDW1I/AAAAAAAAAq8/Zuesji38QBs/s1600-h/Screenshot-linphone-3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="188" src="http://1.bp.blogspot.com/_8kCP03qMfVs/S6k-liCDW1I/AAAAAAAAAq8/Zuesji38QBs/s320/Screenshot-linphone-3.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&amp;nbsp;Open&amp;nbsp;preferences&amp;nbsp;from Linphone menu, select "Manage SIP Accounts" and click Add button &lt;br/&gt;&lt;br /&gt;&lt;div style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_8kCP03qMfVs/S6k_SNlcocI/AAAAAAAAArE/PHbgIPGSWq8/s1600-h/Screenshot-Linphone+-+Configure+a+SIP+account.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="152" src="http://4.bp.blogspot.com/_8kCP03qMfVs/S6k_SNlcocI/AAAAAAAAArE/PHbgIPGSWq8/s320/Screenshot-Linphone+-+Configure+a+SIP+account.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;In above "Configure a SIP account" enter information of your SmartVoip account as below... &lt;/li&gt;&lt;ol&gt;&lt;li&gt;Your SIP identity:&amp;nbsp;&lt;span class="inlinecode"&gt;sip:&lt;i&gt;&amp;lt;SmartVoip UserName&amp;gt;&lt;/i&gt;@smartvoip.com&lt;/span&gt;. Replace &lt;i&gt;&amp;lt;SmartVoip UserName&amp;gt;&lt;/i&gt; with your SmartVoip user name.&lt;/li&gt;&lt;li&gt;SIP Proxy address:&amp;nbsp;&lt;span class="inlinecode"&gt;sip:sip.smartvoip.com&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Leave rest of the fields as is and click Ok.&lt;/li&gt;&lt;li&gt;Your SmartVoip SIP details are now configured with Linphone.&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;div&gt;Now you can start making calls to other SIP phone or call to any mobile or land line number using your SmartVoip account.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Cheers !!!&lt;/div&gt;&lt;div&gt;- Jay&lt;/div&gt;&lt;ol&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-2564626564115198533?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/2564626564115198533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2010/03/using-smartvoip-on-ubuntu-910-using.html#comment-form' title='44 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/2564626564115198533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/2564626564115198533'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2010/03/using-smartvoip-on-ubuntu-910-using.html' title='Using SmartVoip on Ubuntu 9.10 using Linphone'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_8kCP03qMfVs/S6k-liCDW1I/AAAAAAAAAq8/Zuesji38QBs/s72-c/Screenshot-linphone-3.png' height='72' width='72'/><thr:total>44</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-7250915553064722605</id><published>2010-02-06T16:33:00.008+01:00</published><updated>2010-11-10T00:51:30.927+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fun'/><category scheme='http://www.blogger.com/atom/ns#' term='Humor'/><title type='text'>Life Cycle Is All Backwards</title><content type='html'>Have you ever wondered what would be like if we were born old and die as a baby?&amp;nbsp;&lt;a class="newWindow" href="http://en.wikipedia.org/wiki/George_Costanza"&gt;George Costanza&lt;/a&gt; describes it best. Enjoy it...&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;The most unfair thing about life is the way it ends. I mean, life is tough. It takes up a lot of your time. What do you get at the end of it? Death! What’s that, a bonus?! I think the life cycle is all backwards. You should die first, get it out of the way. Then you go live in an old age home. You get kicked out for being too healthy, go collect your pension, then, when you start work, you get a gold watch on your first day. You work forty years until you’re young enough to enjoy your retirement. You drink alcohol, you party, and you get ready for high school. You go to primary school, you become a kid, you play, you have no responsibilities, you become a little baby, you go back, you spend your last 9 months floating with luxuries like central heating, spa, room service on tap, then you finish off as an orgasm! :-)&lt;/div&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-7250915553064722605?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/7250915553064722605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2010/02/born-old-and-die-as-baby.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/7250915553064722605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/7250915553064722605'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2010/02/born-old-and-die-as-baby.html' title='Life Cycle Is All Backwards'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-7030353903704284742</id><published>2010-01-24T09:13:00.052+01:00</published><updated>2010-01-26T11:49:09.185+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java jar classpath utility'/><title type='text'>Searching classes in a JAR or multiple JARs</title><content type='html'>It's very common in the world of Java that you are developing an application using some libraries or open source frameworks or some 3rd party jar and while executing your application/program all of a sudden you get &lt;span class="inlinecode"&gt;NoClassDefFoundError&lt;/span&gt;. This is because the runtime dependency of one of the jars you are using is not in the classpath of your application. Next step you do is start wondering where you will find that particular class. Probably you already know which jar to include and probably you have no clue where to look for that particular class. In the later case (almost all the time with me :-)) you end up hitting the icon of your favorite browser and start googling. In 99% cases you will get the name of the jar where to look for the class but in some cases, where the missing class is a part of some jar which is very much specific to some internal application or 3rd party library, google will be of little help. &lt;br /&gt;&lt;br /&gt;I've been in such a situation many times and there are instances where I have invested (read wasted) significant amount of time just clicking through directories, opening jar files and finding the class am looking for. One fine day I realized that I should have something which does this for me automatically and easily. Result of this thought was a small utility - &lt;span class="inlinecode"&gt;JAR Reader&lt;/span&gt; - which is having a small cute swing UI where I can &lt;br /&gt;&lt;ol&gt;&lt;li&gt;Specify which class to find&lt;/li&gt;&lt;li&gt;In which directory to find&lt;/li&gt;&lt;li&gt;Whether to look for the exact match or just part of. This is useful when I'm just looking for a package name or when I just know the name of the class and not sure of package name. &lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;img border="0" height="253" src="http://1.bp.blogspot.com/_8kCP03qMfVs/S1wD8o4kwMI/AAAAAAAAAh0/iy7XVrWrMxI/s320/jar-reader.PNG" width="320" /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://khimani.info/files/jarreader.jar"&gt;Download JAR Reader&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;This small handy utility has save a lot of time of mine. It searches for class in all the available jars under one directory and all the sub-directories within the search root directory. I'm sure there are many out there who would be facing same problem and for all those poor souls, I've made &lt;a href="http://khimani.info/files/jarreader.jar"&gt;this download link&lt;/a&gt; available to download the utility. Download it and use it however and when ever you want to use it.&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;To start the JAR reader utility, just open the command prompt, change the directory where you have copied the &lt;span class="inlinecode"&gt;jarreader.jar&lt;/span&gt; file and execute following command...&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator code" style="clear: both; text-align: left;"&gt;java -jar jarreader.jar&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;with above you should be seeing as swing window as the snapshot above...&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;@Also See: Online site which can tell you the name of the jar file for a particular class. A nice bookmark to have with you all the time. http://www.jarfinder.com/ &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-7030353903704284742?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/7030353903704284742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2010/01/searching-classes-in-jar-or-multiple.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/7030353903704284742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/7030353903704284742'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2010/01/searching-classes-in-jar-or-multiple.html' title='Searching classes in a JAR or multiple JARs'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_8kCP03qMfVs/S1wD8o4kwMI/AAAAAAAAAh0/iy7XVrWrMxI/s72-c/jar-reader.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-3210065196265720436</id><published>2009-10-04T16:51:00.015+02:00</published><updated>2010-04-20T13:19:00.086+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='ojdbc14'/><category scheme='http://www.blogger.com/atom/ns#' term='jdbc'/><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>Problem with OJDBC 14, PreparedStatement &amp; Statement batch execution</title><content type='html'>Recently I was working on an application where we are using &lt;a class="newWindow" href="http://ibatis.apache.org/java.cgi"&gt;iBatis&lt;/a&gt; data persistence framework with Oracle 10g and Java 1.4.2. This application basically plays with considerably huge amount of data which it reads from some file over the queues. Just few days back we received a huge file with around 66976 records. Application reads/parses all records, does some logic processing and then inserts all records in database as a JDBC batch through iBatis. To our surprise it was just inserting 1446 records and returned silently. It was behaving like everything went well and all records have been inserted.&lt;br /&gt;&lt;br /&gt;After debugging a lot (for 2 days) at 2 in the morning we came to know that application's business logic is just working fine and is not gobbling up records due to some bug. Its the iBatis call to executeBatch was creating problem. All of a sudden one of the team members - &lt;a class="newWindow" href="http://www.linkedin.com/in/chaitanyajadhav"&gt;Chaitanya&lt;/a&gt;(@chaituvj) - realized that missing number of records are 65536 (66976 - 1446 ) i.e 2^16. He had haunch that somehow iBatis is not able to handle a batch with more than 65536 records. Upon doing a small PoC this turned out to be true. In PoC we also wrote a small pure JDBC code where we created a batch of  java.sql.Statement with 66000 records and tried to insert it. It just went fine. Further debugging iBatis code we came to know that iBatis internally calls  java.sql.PreparedStatement.executeBatch() and till that point everything is fine. No records are lost. We almost came to a conclusion that iBatis is the culprit. To enforce our finding, we extended our PoC to have batch execution with &lt;a class="newWindow" href="http://www.mysql.com/"&gt;MySQL&lt;/a&gt; to insert more than 65536 records with iBatis and pure JDBC calls. It went fine. No issues. So once again our understanding was reinforced by this PoC result - iBatis is the culprint.&lt;br /&gt;&lt;br /&gt;After one more day of brain storming we noticed that in our pure JDBC code we had a batch of  java.sql.Statement and iBatis is using  java.sql.PreparedStatement. Since PreparedStatement extends Statement, there was no reason to doubt there might be any problem with PreparedStatement's executeBatch() method implementation. But still there was no satisfactory resolution to this strange behavior, we thought to give it a try and changed our pure JDBC PoC to use java.sql.PreparedStatement instead of java.sql.Statement and execute the program to insert 66000 records. To our surprise, it inserted only 464 records i.e. 66000 - 65536. So now we found our real culprit - Oracle implementation of java.sql.PreparedStatement with ojdbc14.jar&lt;br /&gt;&lt;br /&gt;This is a real strange implementation of PreparedStatement's from Oracle's ojdbc driver. If Oracle guys are reading this hope to hear some nice explanation for such implementation. ;-)&lt;br /&gt;&lt;br /&gt;[Update: 3rd Dec 09]: Posted the same issue on OTN forum and found that its a bug with oracle driver version 10.1.x. Check &lt;a class="newWindow" href="http://forums.oracle.com/forums/thread.jspa?threadID=970315&amp;amp;tstart=75"&gt;this link&lt;/a&gt; for more details.&lt;br /&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-3210065196265720436?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/3210065196265720436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2009/10/problem-with-ojdbc-14-preparedstatement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/3210065196265720436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/3210065196265720436'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2009/10/problem-with-ojdbc-14-preparedstatement.html' title='Problem with OJDBC 14, PreparedStatement &amp; Statement batch execution'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-6044427771475845928</id><published>2009-08-13T07:14:00.022+02:00</published><updated>2009-08-13T13:32:34.855+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='plug-in'/><category scheme='http://www.blogger.com/atom/ns#' term='plugin'/><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><title type='text'>Exporting eclipse plugins locally from one instance to another</title><content type='html'>As an ardent fan of &lt;a href="http://www.eclipse.org/" class="newWindow"&gt;Eclipse IDE&lt;/a&gt; I always try to use the latest available release to see what all new cookies are there for me.&lt;br /&gt;&lt;br /&gt;With this the only painful thing I've faced till now is every time I've to install/download all of my plugins like &lt;a href="http://m2eclipse.sonatype.org/" class="newWindow"&gt;Maven&lt;/a&gt;, &lt;a href="http://www.eclipseplugincentral.com/Web_Links-index-req-viewlink-cid-432.html" class="newWindow"&gt;SpringIDE&lt;/a&gt;, &lt;a href="http://www.eclipse.org/subversive/index.php" class="newWindow"&gt;Subversive&lt;/a&gt; etc. Many provides local archive installation and many needs to be updated every time using Eclipse. This is very time consuming and also some times not possible in cases where I do not have internet connectivity for what so ever reason.&lt;br /&gt;&lt;br /&gt;Recently I downloaded &lt;a href="http://www.eclipse.org/galileo/" class="newWindow"&gt;Galileo&lt;/a&gt; and again faced the same problem as I described above and this time I discovered that Eclipse has an inbuilt feature to import plugins from any of the existing eclipse install to new install without need to go to update site or download it from the internet. Here I'll display how to do this...&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download latest Eclipse from &lt;a href="http://www.eclipse.org/downloads/" class="newWindow"&gt;download&lt;/a&gt; page and start the IDE.&lt;/li&gt;&lt;li&gt;Setup a local repository to point to your old-eclipse-install's plugin download directory. Eclipse stores all downloaded plugins to &lt;span class="inlinecode"&gt;&amp;lt;eclipse-install-directory&gt;/p2&lt;/span&gt; directory. Below are the steps to setup new local repository with &lt;a href="http://www.eclipse.org/galileo/" class="newWindow"&gt;Galileo&lt;/a&gt;&lt;ol&gt;&lt;li&gt;Select &lt;span class="inlinecode"&gt;Install New Software...&lt;/span&gt; from Help menu&lt;/li&gt;&lt;li&gt;Click &lt;span class="inlinecode"&gt;Add...&lt;/span&gt; button to add new repository. See below snapshot...&lt;/li&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_8kCP03qMfVs/SoOref2EYOI/AAAAAAAAASU/uBeLWluyVzA/s1600-h/local-repo-1.JPG"&gt;&lt;img title="Click to see higher resolution image" style="cursor: pointer; width: 320px; height: 250px;" src="http://3.bp.blogspot.com/_8kCP03qMfVs/SoOref2EYOI/AAAAAAAAASU/uBeLWluyVzA/s320/local-repo-1.JPG" alt="" id="BLOGGER_PHOTO_ID_5369323721188466914" border="0" /&gt;&lt;/a&gt;&lt;li&gt;Click on &lt;span class="inlinecode"&gt;Local...&lt;/span&gt; button and select the p2 directory of your existing eclipse install. For e.g. if your existing eclipse is installed at C:/eclipse then browse for folder &lt;span class="inlinecode"&gt;C:/eclipse/p2&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Provide appropriate name of your choice for this new repository and click &lt;span class="inlinecode"&gt;OK&lt;/span&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;You should see the list of plugins available in your existing eclipse install. In case you do not see it then uncheck &lt;span class="inlinecode"&gt;Group items by category&lt;/span&gt; checkbox. See below snapshot...&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_8kCP03qMfVs/SoOwA5W13DI/AAAAAAAAASc/nrmTzGPSiqc/s1600-h/local-repo-added.JPG"&gt;&lt;img style="cursor: pointer; width: 320px; height: 298px;" src="http://2.bp.blogspot.com/_8kCP03qMfVs/SoOwA5W13DI/AAAAAAAAASc/nrmTzGPSiqc/s320/local-repo-added.JPG" alt="" id="BLOGGER_PHOTO_ID_5369328710198877234" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;Once your local repository is set, select all the plugins you want in your new install and click Next and then Finish.&lt;/li&gt;&lt;li&gt;This will calculate the dependencies and then install the selected plugins from your existing/old install.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Done.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;Cheers !!!&lt;br /&gt;- Jay&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-6044427771475845928?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/6044427771475845928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2009/08/exporting-eclipse-plugins-locally-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/6044427771475845928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/6044427771475845928'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2009/08/exporting-eclipse-plugins-locally-from.html' title='Exporting eclipse plugins locally from one instance to another'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_8kCP03qMfVs/SoOref2EYOI/AAAAAAAAASU/uBeLWluyVzA/s72-c/local-repo-1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-7748373545884160760</id><published>2009-07-02T15:00:00.005+02:00</published><updated>2009-12-03T01:18:26.802+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Struts 2'/><category scheme='http://www.blogger.com/atom/ns#' term='OGNL'/><title type='text'>Static method access using OGNL &amp; Struts 2.1.x</title><content type='html'>We know that if we want to access any static method using OGNL in Struts 2 we use notation &lt;span class="inlinecode"&gt;@classname@methodname( args )&lt;/span&gt; and it works well. With Struts 2.1.x, by default this has been turned off due to some security issues. You can still access static methods but, you need to tell struts explicitly to allow access to static methods. To do this in you &lt;span class="inlinecode"&gt;struts.properties&lt;/span&gt; put following line…&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;struts.ognl.allowStaticMethodAccess=true&lt;/div&gt;For more details on this change check &lt;a href="https://issues.apache.org/struts/browse/WW-2160" class="newWindow"&gt;Jira WW-2160&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I wasted an hour on figuring out why my static method is not called and found this fix with Struts 2.1.x. If you guys are working on 2.1.x then keep this in mind in order to stay away from frustration ;-).&lt;br /&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;br /&gt;&lt;br /&gt;P.S.: Actually I should have read Struts 2.0.x to Struts 2.1.x &lt;a href="http://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html" class="newWindow"&gt;migration guide&lt;/a&gt; before starting working on Struts 2.1.x&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-7748373545884160760?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/7748373545884160760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2009/07/static-method-access-using-ognl-struts.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/7748373545884160760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/7748373545884160760'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2009/07/static-method-access-using-ognl-struts.html' title='Static method access using OGNL &amp; Struts 2.1.x'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-6516437901330373843</id><published>2009-06-24T07:58:00.020+02:00</published><updated>2009-07-02T15:07:42.996+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='ATM'/><title type='text'>ATM Security Myth ------- Busted</title><content type='html'>Many of us have received a mail saying what to do when a thief/mugger traps you at a ATM. Below is one such mail I received couple of days back...&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;WHEN A THIEF FORCES YOU TO TAKE MONEY FROM THE ATM, DO NOT ARGUE OR RESIST, YOU MIGHT NOT KNOW WHAT HE OR SHE MIGHT DO TO YOU. WHAT YOU SHOULD DO IS TO PUNCH YOUR PIN IN THE REVERSE, I..E IF YOUR PIN IS 1254, YOU PUNCH 4521.&lt;br /&gt;&lt;br /&gt;THE MOMENT YOU PUNCH IN THE REVERSE, THE MONEY WILL COME OUT BUT WILL BE STUCK INTO THE MACHINE HALF WAY OUT AND IT WILL ALERT THE POLICE WITHOUT THE NOTICE OF THE THIEF.  EVERY ATM HAS IT; IT IS SPECIALLY MADE TO SIGNIFY DANGER AND HELP. NOT EVERYONE IS AWARE OF THIS.&lt;br /&gt;&lt;br /&gt;FORWARD THIS TO ALL YOUR LOVED ONES, FRIENDS AND THOSE YOU CARE&lt;/div&gt;I instantly forwarded this mail to HDFC and ICICI banks and below is the response which I received from the HDFC bank...&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;Dear Mr. Khimani,&lt;br /&gt;&lt;br /&gt;Thank you for writing to us.&lt;br /&gt;&lt;br /&gt;This is with reference to your e-mail dated June 16, 2009 regarding Security issues in ATM.&lt;br /&gt;&lt;br /&gt;Currently, this facility is not available with HDFC Bank. We request you not to try using your ATM PIN in wrong way. It might block your ATM transaction.&lt;/div&gt;And below is the response from ICICI bank...&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;Dear Customer,&lt;br /&gt;&lt;br /&gt;Thank you for writing to us and bringing the e-mail below to our notice.&lt;br /&gt;&lt;br /&gt;We affirm that keying a PIN in reverse order into our ATMs will not yield the result described in the e-mail that you have quoted.&lt;br /&gt;&lt;br /&gt;It will yield an “Error” message on the ATM screen.&lt;br /&gt;&lt;br /&gt;Thank you for the opportunity of issuing this clarification.&lt;br /&gt;&lt;br /&gt;Looking forward to more opportunities to be of service to you.&lt;br /&gt;&lt;br /&gt;Sincerely,&lt;br /&gt;Rose&lt;br /&gt;Customer Service Manager&lt;/div&gt;Such facility is not only &lt;span style="color: rgb(255, 0, 0);"&gt;NOT&lt;/span&gt; available with an Indian bank, but no bank ATMs in world provide such reverse pin feature. Myth busters Barbara and David Mikkelson of &lt;a href="http://www.snopes.com/" class="newWindow"&gt;snopes.com&lt;/a&gt; has also turned such information (read rumor/spam) as false. For more details check this article on snopes. &lt;a href="http://www.snopes.com/business/bank/pinalert.asp" class="newWindow"&gt;http://www.snopes.com/business/bank/pinalert.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So friends, please &lt;span style="color: rgb(255, 0, 0);"&gt;DO NOT&lt;/span&gt; try to display any such smartness until you are sure whether the ATM you are using is providing such facility. Instead try to be as cautious as possible while entering any ATM and try to avoid any ATM which is in very remote location and you do not see anybody around.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-6516437901330373843?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/6516437901330373843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2009/06/atm-security-myth.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/6516437901330373843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/6516437901330373843'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2009/06/atm-security-myth.html' title='ATM Security Myth ------- Busted'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-2102376022643937300</id><published>2009-06-11T08:14:00.009+02:00</published><updated>2009-07-03T15:16:24.839+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google Notebook'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>Firefox 3.5 &amp; Google Notebook extension</title><content type='html'>Being an ardent Firefox fan, I could not wait to download Firefox 3.5 beta and see how fast it is and what all new features are added. After installing it over 3.0.10 and restarted in anticipation to see something new, something cool, surprisingly I saw a message that my favorite google notebook extension is no more compatible with Firefox 3.5. With utter despair, all thoughts of exploring new Firefox vanished and I started googling on how can I get my notebook back. Didn't had to wait long. Found this quite useful blog which made me happy again with no complaints for Firefox. ;-)&lt;br /&gt;&lt;br /&gt;http://googlesystem.blogspot.com/2009/06/google-notebooks-extension-url.html&lt;br /&gt;&lt;br /&gt;Follow the instruction on above and you can get have your google notebook extension back.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;Addition on July 03, 2009 18:41:29&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;If you are too lazy to do all the above then Steve is your savior. Visit &lt;a href="http://www.notebookaddon.tk/" class="newWindow"&gt;http://www.notebookaddon.tk/&lt;/a&gt; and you can install modified google notebook extension without all the jugglery. Thanks Steve. &lt;span style="font-size:78%;"&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;br /&gt;&lt;br /&gt;P.S.: Above blog also introduced me to a good free archiving utility &lt;a href="http://www.7-zip.org/" class="newWindow"&gt;7-zip&lt;/a&gt;. No annoying winzip evaluation dialogue or winrar's purchase license dialogue. ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-2102376022643937300?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/2102376022643937300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2009/06/firefox-35-google-notebook-extension.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/2102376022643937300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/2102376022643937300'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2009/06/firefox-35-google-notebook-extension.html' title='Firefox 3.5 &amp; Google Notebook extension'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-3939657010472519865</id><published>2009-06-05T10:50:00.018+02:00</published><updated>2010-11-13T19:57:03.619+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='parsing'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='commons digester'/><title type='text'>Parsing XML with Commons Digester 2.0</title><content type='html'>Parsing XMLs with &lt;a class="newWindow" href="http://commons.apache.org/digester/"&gt;Commons Digester&lt;/a&gt; is no longer mystery or new. Probably one of the most easy and convenient way to parse XMLs. For more details, following links can be visited for very detailed explanation on XML parsing using commons digester...&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a class="newWindow" href="http://www.onjava.com/pub/a/onjava/2004/12/22/jakarta-gems-1.html"&gt;O'Reilly article&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class="newWindow" href="http://www-106.ibm.com/developerworks/java/library/j-lucene/"&gt;IBM developerWorks article&lt;/a&gt;&lt;/li&gt;&lt;li&gt; &lt;a class="newWindow" href="http://www.javaworld.com/javaworld/jw-10-2002/jw-1025-opensourceprofile.html"&gt;JavaWorld&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class="newWindow" href="http://www.onjava.com/pub/a/onjava/2002/10/23/digester.html"&gt;OnJava&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;As many occasions, this project of mine required parsing a XML configuration file and for that I took shelter of digester, but this time I upgraded to 2.0 from 1.8. With 2.0, digester provides XML schema validation support using javax.xml.validation.Schema. Below is the code snippet to use XML Schema while parsing the XML for ready reference...&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: java"&gt;// Load digester rules&lt;br /&gt;Digester digester = DigesterLoader.createDigester( getClass().getClassLoader().getResource( digesterRules ) );&lt;br /&gt;&lt;br /&gt;// XML Schema used for XML parsing&lt;br /&gt;URI uri = getClass().getClassLoader().getResource( NOTES_XSD ).toURI();&lt;br /&gt;Schema schema = SchemaFactory.newInstance( XMLConstants.W3C_XML_SCHEMA_NS_URI ).newSchema( new File( uri ) );&lt;br /&gt;digester.setXMLSchema( schema );&lt;br /&gt;digester.setNamespaceAware( true );&lt;br /&gt;digester.setErrorHandler( myErrorHandler );&lt;br /&gt;&lt;br /&gt;// XML file to parse&lt;br /&gt;InputStream stream = getClass().getClassLoader().getResourceAsStream( FILE_TO_PARSE );&lt;br /&gt;Object parse = digester.parse( stream );&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;With this you can get rid of your dependency on DTD and leverage power of XSD type support and better validation.&lt;br /&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-3939657010472519865?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/3939657010472519865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2009/06/parsing-xml-with-commons-digester-20.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/3939657010472519865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/3939657010472519865'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2009/06/parsing-xml-with-commons-digester-20.html' title='Parsing XML with Commons Digester 2.0'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-7689801270935650127</id><published>2009-05-01T10:15:00.073+02:00</published><updated>2009-10-14T00:10:26.269+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='remote debugging'/><title type='text'>Remote Debugging Java Applications Using Eclipse</title><content type='html'>Ok so after completing the &lt;a href="http://jaykhimani.blogspot.com/2009/05/which-os-im.html" class="newWindow"&gt;BBSpot quiz&lt;/a&gt;, I was really in mood to do something interesting. Suddenly I remembered a technical paper which I need to submit to my manager for some news letter (yes one more news letter of dozens of them you get every day from all over the net)&lt;br /&gt;&lt;br /&gt;So was just thinking some interesting topic which will catch interest of all in developer community of my team. I did not want to come up with some new emerging technology with lots of technical jargon and theories. After all am not preparing a presentation for any (dumb) client who gets impressed by such not-so-useful articles/papers. My target audience is a bunch of smart and intelligent Java developers. So I was thinking of a topic which can catch the interest of these worldly creatures who then can use it for some better purpose to ease their development/debugging life. So the idea struck to my mind was Remote Debugging. I know this is nothing new to Java world, but still I find this feature very exciting, helpful &amp;amp; powerful. Remote debugging has always been an integral part of JDK or J2SE SDK since long and perhaps most unused or less explored by most of us. So what's remote debugging and why we actually need it?&lt;br /&gt;&lt;br /&gt;Many a times, it so happens that some nasty bug shows up on the functional testing or the business testing environment, which are typically on the customer network infrastructure with very limited or no debugging tools? To make matters worse, when you try to reproduce the same bug on your local development environment, it won't show up and system will behave just fine. This is a scenario which each and every software project and its developers face without exception.&lt;br /&gt;&lt;br /&gt;Traditionally, in such scenarios, we tend to put in a lot of debug statements (&lt;span class="inlinecode"&gt;logger.debug&lt;/span&gt; or &lt;span class="inlinecode"&gt;System.out.println&lt;/span&gt;) or in the case of web applications some hidden buttons which just the developer is aware of and on click of which a specific business scenario is executed and the logs, thereof, are generated. This approach has many flaws, as the typical algorithm illustrates:&lt;br /&gt;1. Correctly identify [or guess] the piece of code which might be causing the bug to show up on env other then dev.&lt;br /&gt;2. Code change to introduce debug statements. [Prone to introduce more bugs.]&lt;br /&gt;3. Code change means extra round of unit/sanity testing and then new deployment.&lt;br /&gt;4. Once deployed, collect the log and carefully analyze it to find the root cause. If nothing found, introduce more detailed debug statements i.e. Go back to step 1/2 and repeat.&lt;br /&gt;5. If the root cause is found, fix it locally assuming that the bug is fixed [if the bug is not reproducible locally], remove all the debug statements introduced as a part of step 2 and generate a new build after successful unit/sanity testing.&lt;br /&gt;6. Pray hard and hope the bug does not resurface again in your lifetime!&lt;br /&gt;&lt;br /&gt;This technique is highly error prone and time consuming. To overcome this, as with most of the other matured programming languages, Java too ships with a capability to debug a remotely deployed application from your local development environment using your favorite IDE such as Eclipse. Java debugging capabilities is a result of JPDA (Java Platform Debugger Architecture). For more details on JPDA please refer &lt;a href="http://java.sun.com/j2se/1.5.0/docs/guide/jpda/" class="newWindow"&gt;JPDA Architecture&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In this article, I won't dig much into the details of JPDA, but will focus on how to remotely debug an application using our good old friend – Eclipse. Here, I take up three common application scenarios and describe the remote debugging steps for each of them:&lt;br /&gt;1. A standalone application. (such as a batch application)&lt;br /&gt;2. A web application deployed on Apache Tomcat Servlet container.&lt;br /&gt;3. A web application deployed on IBM WebSphere 5.1 application server.&lt;br /&gt;&lt;br /&gt;To debug any application remotely, you need to...&lt;ol&gt;&lt;li&gt;Make sure you are building (compiling) your application with available debug information.&lt;/li&gt;&lt;ol&gt;&lt;li&gt;In Eclipse you can control these settings from Windows -&gt; Preferences -&gt; Java -&gt; Compiler.&lt;br /&gt;&lt;img style="width: 320px; height: 94px;" src="http://1.bp.blogspot.com/_8kCP03qMfVs/SgLJXlmOcOI/AAAAAAAAAP4/o5bol5Ehi9U/s320/clip_image001.jpg" alt="" id="BLOGGER_PHOTO_ID_5333046315826704610" border="0" /&gt;&lt;/li&gt;&lt;li&gt;If you are building your application with an ANT build script, then in the &lt;span class="inlinecode"&gt;&amp;lt;javac&amp;gt;&lt;/span&gt; task, set the “debug” attribute to “true”.&lt;/li&gt;&lt;li&gt;If you are building your application with Maven, set the debug configuration tag for &lt;span class="inlinecode"&gt;maven-compiler-plugin&lt;/span&gt; to “true”.&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;Deploy the application in the debug mode. This opens up a port for your debugger to get attached to the application's process and do its magic&lt;span style="font-size:130%;"&gt;&lt;sup&gt;&lt;a href="#fn1" target="_self"&gt;&lt;b&gt;1&lt;/b&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/span&gt;. This is done by passing some pre-defined VM arguments in the application's launch scripts. The commonly used VM arguments are:&lt;/li&gt;&lt;/ol&gt;&lt;table border="1" style="border-collapse:collapse;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th nowrap="nowrap"&gt;VM Argument&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;br /&gt;&lt;tr&gt;&lt;td class="inlinecode" nowrap="nowrap" valign="top" width="1%"&gt;-Xdebug&lt;/td&gt;&lt;td&gt;Enables debugging&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="inlinecode" nowrap="nowrap" valign="top" width="1%"&gt;-Xrunjdwp:&amp;lt;options&amp;gt;&lt;/td&gt;&lt;td&gt;Loads the JPDA implementation residing in targeted JVM.&lt;br /&gt;The commonly used &amp;lt;options&amp;gt;...&lt;br /&gt;1. &lt;span class="inlinecode"&gt;transport&lt;/span&gt;: Transport to use in connecting to debugger application. There can be many transport implementations out of which Sun comes with two mostly used implementation - A socket transport based on TCP/IP and a shared memory transport.&lt;br /&gt;2. &lt;span class="inlinecode"&gt;address&lt;/span&gt;: Transport address for the debugger application to attach.&lt;br /&gt;3. &lt;span class="inlinecode"&gt;server&lt;/span&gt;: If set to 'y'(mostly used), it listens for a debugger application to attach. Otherwise, attach to the debugger application at the specified address.&lt;br /&gt;4. &lt;span class="inlinecode"&gt;suspend&lt;/span&gt;: If set to 'y', JVM starts in suspended mode and stays suspended until a debugger is attached to it.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;For a full JVM-version-specific list of 'runjdwp' options, please refer to:&lt;ol&gt;&lt;li&gt;Java 1.4.2: http://java.sun.com/j2se/1.4.2/docs/guide/jpda/conninv.html#Invocation&lt;/li&gt;&lt;li&gt;Java 1.5: http://java.sun.com/j2se/1.5.0/docs/guide/jpda/conninv.html#Invocation&lt;/li&gt;&lt;li&gt;Java 6: http://java.sun.com/javase/6/docs/technotes/guides/jpda/conninv.html#Invocation&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;Remote debugging a standalone application&lt;/span&gt;&lt;br /&gt;To remotely debug a standalone application, the first thing you need to do is compile the application source with available debug information, as mentioned in the above section and package it as a &lt;span class="inlinecode"&gt;.jar&lt;/span&gt; file.&lt;br /&gt;&lt;br /&gt;For example your jar file name is &lt;span class="inlinecode"&gt;sandbox.jar&lt;/span&gt; and the class launches the application is &lt;span class="inlinecode"&gt;foo.bar.Test&lt;/span&gt;, then you can run Test as&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;java -cp ./sandbox.jar foo.bar.Test&lt;/div&gt;However, with just this, the application will not allow remote debugging. In order to debug &lt;span class="inlinecode"&gt;Test&lt;/span&gt; application remotely, start it in the debug mode by providing the additional VM arguments, as shown below:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=10007,suspend=n&lt;/div&gt;These options will allow the Test application to execute in debug mode with a socket open on port 10007 for a debugger to attach to.&lt;br /&gt;&lt;br /&gt;To verify if your application is truly running in debug mode and has opened a socket on 10007 listening for debugger to attach, on windows machine open a command prompt and type &lt;span class="inlinecode"&gt;netstat /a&lt;/span&gt; or on Unix/Linux environment &lt;span class="inlinecode"&gt;netstat -a&lt;/span&gt; and you should be able to see a TCP socket on port 10007 with state as &lt;span class="inlinecode"&gt;LISTEN&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;In a real life scenario, you won't be starting your standalone application directly by issuing java command. You will have a script file which will be invoking your application. So to avoid any script change to run application under debug mode or not, you can set an environment variable &lt;span class="inlinecode"&gt;_JAVA_OPTIONS&lt;/span&gt; before your script invokes java command. For instance, if your application is launched by a script file called &lt;span class="inlinecode"&gt;sandbox.sh&lt;/span&gt; then before executing &lt;span class="inlinecode"&gt;sandbox.sh&lt;/span&gt; you can simply set &lt;span class="inlinecode"&gt;_JAVA_OPTIONS&lt;/span&gt; environment variable as:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;set _JAVA_OPTIONS="-Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=10007,suspend=n"&lt;/div&gt;Once you are done with your debugging, you can reset &lt;span class="inlinecode"&gt;_JAVA_OPTIONS&lt;/span&gt; to blank and then re-execute &lt;span class="inlinecode"&gt;sandbox.sh&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;a name="EclipseConfig"&gt;Eclipse configuration&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;Once your application is running in debug mode, you can switch back to Eclipse and open the Debug configuration dialogue from Run -&gt; Debug Configuration... menu item. Over there, select “Remote Java Application” from the left navigation tree. Right click and select New.&lt;br /&gt;&lt;br /&gt;On the right hand side, under Connect tab, select the project which holds the &lt;span class="inlinecode"&gt;foo.bar.Test&lt;/span&gt; class which you intend to debug remotely. Select connection type as &lt;span class="inlinecode"&gt;"Standard (Socket Attach)"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Under the 'Connection Properties', enter the host name or IP where you are running your &lt;span class="inlinecode"&gt;foo.bar.Test&lt;/span&gt; class in debug mode and port as 10007. Depending upon your remote JVM settings and your wish you can check/uncheck "Allow termination of remote VM" checkbox.&lt;br /&gt;&lt;br /&gt;Click Debug button and your eclipse debugger is now connected to your remote application and ready to debug. Insert debug points in your program and you are ready to debug your application remotely.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Remote debugging a web application on Apache Tomcat&lt;/span&gt;&lt;br /&gt;The steps for compiling and building your application remains the same, as described above. What changes is how we start the Tomcat server. To start Tomcat in the debug mode, set two environment variables as...&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;JPDA_TRANSPORT=dt_socket&lt;br /&gt;JPDA_ADDRESS=10007&lt;br /&gt;&lt;/div&gt;After setting the above system environment variables, start Tomcat using following command…&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;%CATALINA_HOME%\bin\catalina.bat jpda start&lt;br /&gt;&lt;/div&gt;OR on Linux...&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;$CATALINA_HOME/bin/catalina.sh jpda start&lt;br /&gt;&lt;/div&gt;Once the server is up, it's in debug mode with a socket on port 10007 open for any debugger to attach for debugging the deployed application. Once Tomcat is running in debug mode you can follow the &lt;a href="http://www.blogger.com/post-edit.g?blogID=2291731444407685134&amp;amp;postID=7689801270935650127#EclipseConfig" target="_self"&gt;Eclipse Configuration&lt;/a&gt; steps to debug the web application. Once you are done with debugging, you can stop the server by:&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;%CATALINA_HOME%\bin\catalina.bat stop&lt;br /&gt;&lt;/div&gt;OR on Linux...&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;$CATALINA_HOME/bin/catalina.sh stop&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Remote debugging a web application on IBM WebSphere 5.1&lt;/span&gt;&lt;br /&gt;Once again, the steps for compiling and building your application remains the same, as described above. What changes is how we inform WebSphere to run in debug mode. To do this:&lt;br /&gt;1. Open WebSphere admin console.&lt;br /&gt;2. Navigate to Servers -&gt; Application Servers -&gt; &amp;lt;YOUR_SERVER_NAME&amp;gt; -&gt; Process Definitions -&gt; Java Virtual Machine.&lt;br /&gt;3. Scroll down and check the Debug Mode check box.&lt;br /&gt;4. You can either accept the default debug arguments in  Debug Arguments textbox or can provide as per your requirement.&lt;br /&gt;5. Restart your application server.&lt;br /&gt;6. Done !!!&lt;br /&gt;&lt;br /&gt;Once your WebSphere is running debug mode, follow &lt;a href="http://www.blogger.com/post-edit.g?blogID=2291731444407685134&amp;amp;postID=7689801270935650127#EclipseConfig" target="_self"&gt;Eclipse Configuration&lt;/a&gt; to do debug the web application.&lt;br /&gt;&lt;br /&gt;Some times you might get an error message while you try to connect to remote JVM through Eclipse...&lt;br /&gt;&lt;br /&gt;&lt;div class="code"&gt;Failed to connect to remote VM. Connection refused.&lt;/div&gt;The most likely case if you are on a Windows machine is that, you have the Windows firewall on and it is preventing you from connecting.  Stop the firewall and try to reconnect. Don’t forget to turn your firewall on once you are done, else you might end up debugging your Windows for mysterious behavior if some hacker gets hold of your PC ;-)&lt;br /&gt;&lt;br /&gt;Here’s to smarter debugging!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Reference&lt;/span&gt;&lt;br /&gt;Links to JPDA documentation &amp;amp; debug options across J2SE 1.4.2., 1.5.0 &amp;amp; 6:&lt;br /&gt;http://java.sun.com/javase/technologies/core/toolsapis/jpda/&lt;br /&gt;&lt;br /&gt;Detailed article on Remote Debugging in Java:&lt;br /&gt;http://www.ibm.com/developerworks/opensource/library/os-eclipse-javadebug/index.html&lt;br /&gt;&lt;br /&gt;Remote Debugging with Eclipse&lt;br /&gt;http://www.jacoozi.com/index.php?option=com_content&amp;amp;task=view&amp;amp;id=119&amp;amp;Itemid=134&lt;br /&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;br /&gt;&lt;br /&gt;&lt;fn id="fn1"&gt;&lt;span style="color: rgb(153, 153, 153);font-size:130%;" &gt;&lt;sup&gt;&lt;b&gt;1 &lt;/b&gt;&lt;/sup&gt;&lt;/span&gt;&lt;span style="font-size:78%;"&gt; You can also configure your remote debugging so that the application you are interested to remotely debug attaches itself to the debugger. For this article I’ll limit discussion in debugging application by attaching debugger to application.&lt;/span&gt;&lt;/fn&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-7689801270935650127?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/7689801270935650127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2009/05/remote-debugging-java-applications.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/7689801270935650127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/7689801270935650127'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2009/05/remote-debugging-java-applications.html' title='Remote Debugging Java Applications Using Eclipse'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_8kCP03qMfVs/SgLJXlmOcOI/AAAAAAAAAP4/o5bol5Ehi9U/s72-c/clip_image001.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-4793233639845556454</id><published>2009-05-01T09:54:00.007+02:00</published><updated>2010-11-10T00:51:14.248+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='quiz'/><category scheme='http://www.blogger.com/atom/ns#' term='fun'/><category scheme='http://www.blogger.com/atom/ns#' term='Humor'/><title type='text'>Which OS I'm?</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bbspot.com/News/2003/01/os_quiz.php"&gt;&lt;img style="margin: 20pt 0pt 10px 10px; float: right; cursor: pointer; width: 300px; height: 90px;" src="http://www.bbspot.com/Images/News_Features/2003/01/os_quiz/debian.jpg" alt="You are Debian Linux. People have difficulty getting to know you.  Once you finally open your shell they're apt to love you." border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Its start of the long weekend and start was of course the best you can expect. Sleeping till noon after working late night. Anyway had to wake up after a lot of pinching from my wife. Somehow made it out of my bed, brushed the teeth, holding a mug full of tea wondering what &lt;span style="font-style: italic;"&gt;creative&lt;/span&gt; thing I can do. Obviously first thought was to check the mails if I won some million $ lottery ;). As always marked all mails as read and trashed switched to google and encountered to this bit weired but interesting quiz on &lt;a href="http://bbspot.com/" class="newWindow"&gt;BBSpot&lt;/a&gt;. Just thought to give it a try and started answering the questions and found myself as a Debian Linux :). Coincidentally I recently got myself Ubuntu - the debian flavor. Seems BBSpot guys are intelligent. Give it a try...&lt;br /&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-4793233639845556454?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/4793233639845556454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2009/05/which-os-im.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/4793233639845556454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/4793233639845556454'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2009/05/which-os-im.html' title='Which OS I&apos;m?'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-796477475975601542</id><published>2009-04-29T08:18:00.001+02:00</published><updated>2009-05-08T10:35:15.921+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='apache http'/><category scheme='http://www.blogger.com/atom/ns#' term='proxy'/><title type='text'>Problem with JDK and network proxy validation</title><content type='html'>I was just playing around with &lt;span class="inlinecode"&gt;java.net&lt;/span&gt; package to use amazing &lt;a class="newWindow" href="http://code.google.com/apis/ajaxsearch/"&gt;Google Search API&lt;/a&gt;. For this I need to pass through the proxy setup by my company and hence tried the usual &lt;span class="inlinecode"&gt;java.net.URL&lt;/span&gt; and providing &lt;span class="inlinecode"&gt;java.net.Authenticator&lt;/span&gt; / &lt;span class="inlinecode"&gt;java.net.Proxy&lt;/span&gt; classes. Call to  &lt;span class="inlinecode"&gt;URL#getContent()&lt;/span&gt; or &lt;span class="inlinecode"&gt;HttpURLConnection#getInputStream()&lt;/span&gt; results in following exception...&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;java.net.ProtocolException: Server redirected too many  times (20)&lt;br /&gt;at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1180)&lt;/pre&gt;&lt;br /&gt;After googling a lot, trying many different solutions suggested by various posts and nothing to my help, I discussed this with &lt;a href="http://www.sandeepdeb.com/" class="newWindow"&gt;Sandy&lt;/a&gt; and came to know that its a typical known issue with JDK provided proxy authentication that code goes into recursive loop trying to resolve the proxy and fetch the URL content where server sends a 3xx code asking for the redirection. When enough of redirection has happened above mentioned ProtocolException is thrown. Better way to handle the proxy authentication is to use Apahce's HTTP Component's &lt;a class="newWindow" href="http://hc.apache.org/httpcomponents-client/index.html"&gt;HttpClient&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So at the end I removed JDK provided proxy authentication to Apache HttpClient and its very clean, easy to use and overcomes JDK's proxy authentication problem very neatly. Apache HTTP Client is still under beta stage and not much of user guide sort of documentation is available except some examples showcasing the capabilities of Apache HTTP Components. For the easy reference below is the code excerpt for the basic proxy authentication for &lt;a href="http://hc.apache.org/httpcomponents-client/download.html" class="newWindow"&gt;Apache HttpClient 4.0-beta2&lt;/a&gt; I used in my code...&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;...&lt;br /&gt;...&lt;br /&gt;DefaultHttpClient httpclient = new DefaultHttpClient() ;&lt;br /&gt;HttpHost proxy = new HttpHost( &lt;i&gt;proxy.ip&lt;/i&gt;, &lt;i&gt;proxy.port&lt;/i&gt; ) ;&lt;br /&gt;httpclient.getParams().setParameter( ConnRoutePNames.DEFAULT_PROXY, proxy ) ;&lt;br /&gt;String localhost = InetAddress.getLocalHost().getHostName() ;&lt;br /&gt;NTCredentials credentials = new NTCredentials( &lt;i&gt;proxy.username&lt;/i&gt;, &lt;i&gt;proxy.password&lt;/i&gt;, localhost, &lt;i&gt;proxy.domain&lt;/i&gt; )  ;&lt;br /&gt;httpclient.getCredentialsProvider().setCredentials( AuthScope.ANY, credentials) ;&lt;br /&gt;...&lt;br /&gt;...&lt;/pre&gt;With above you have a HttpClient object configured to pass through your proxy with authentication enabled... Happy "proxying"... :)&lt;br /&gt;&lt;br /&gt;Cheers !!!&lt;br /&gt;- Jay&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-796477475975601542?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/796477475975601542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2009/04/problem-with-jdk-and-network-proxy.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/796477475975601542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/796477475975601542'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2009/04/problem-with-jdk-and-network-proxy.html' title='Problem with JDK and network proxy validation'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2291731444407685134.post-4419631560954615500</id><published>2009-04-26T00:43:00.002+02:00</published><updated>2009-06-03T07:39:05.265+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Installing J2EE 5.0 SDK on Ubuntu 8.10</title><content type='html'>Just 2 days back I installed Ubuntu 8.10 on my laptop along with Windows XP and made my system multiboot. Next step was to get my tools onboard. i.e. J2SE SDK, J2EE SDK, Eclipse and list goes on...&lt;br /&gt;&lt;br /&gt;So to start with I &lt;a class="newWindow" href="http://java.sun.com/javaee/downloads/index.jsp"&gt;downloaded J2EE 5.0&lt;/a&gt; self extracting bin file java_ee_sdk-5_01-linux.bin and started the installation after changing the file permissions (chmod a+x java_ee_sdk-5_01-linux.bin)&lt;br /&gt;&lt;br /&gt;As soon as the installer started, it ended with an pinching error message...&lt;br /&gt;&lt;br /&gt;&lt;p class="code"&gt;./java_ee_sdk-5_01-linux.bin: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory&lt;/p&gt;&lt;br /&gt;My immediate thought was required shared library libstdc++.so.5 is missing with Ubuntu 8.10 release. So tried to get it using...&lt;br /&gt;&lt;br /&gt;&lt;p class="code"&gt;sudo apt-get install libstdc++5&lt;/p&gt;&lt;br /&gt;This failed, saying no such package. Probably default packages does not list this. Then I started looking in /usr/lib and found libstdc++.so.6.0.10. Having found this I just made a soft link to libstdc++.so.5 to point to existing version 6.0.10.&lt;br /&gt;&lt;br /&gt;&lt;p class="code"&gt;ln -s /usr/lib/libstdc++.so.6.0.10 /usr/lib/libstdc++.so.5&lt;/p&gt;&lt;br /&gt;Started again installation and everything went on fine and I was a happy man when I saw the output of... &lt;span&gt;&lt;p class="code"&gt;java -version&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt; :)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;Cheers !!!&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal;"&gt;- Jay&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2291731444407685134-4419631560954615500?l=jaykhimani.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jaykhimani.blogspot.com/feeds/4419631560954615500/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jaykhimani.blogspot.com/2009/04/installing-j2ee-50-sdk-on-ubuntu-810.html#comment-form' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/4419631560954615500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2291731444407685134/posts/default/4419631560954615500'/><link rel='alternate' type='text/html' href='http://jaykhimani.blogspot.com/2009/04/installing-j2ee-50-sdk-on-ubuntu-810.html' title='Installing J2EE 5.0 SDK on Ubuntu 8.10'/><author><name>Jay Khimani</name><uri>http://www.blogger.com/profile/05578378976289426130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='30' height='32' src='http://1.bp.blogspot.com/-am0jRNXjfqg/ToI_oXvXA_I/AAAAAAAABEw/zh5YBACUs-U/s220/Screen%2BShot%2B2011-09-27%2Bat%2B11.09.14%2BPM.png'/></author><thr:total>10</thr:total></entry></feed>
