<?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-29682506</id><updated>2011-12-15T08:13:57.571+05:30</updated><title type='text'>Neeraj's Tech Scribbles</title><subtitle type='html'>Simply put, this is my very own google index into the technology world. I intend to post my learnings in various technologies as and when I learn 'em.
&lt;br/&gt;
Beyond this, there shouldn't be a single line here which is not useful to someone else :).</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-29682506.post-1924158581308175612</id><published>2007-06-20T15:43:00.000+05:30</published><updated>2007-06-20T15:46:07.357+05:30</updated><title type='text'>Trac (Rails): Cannot uplaod attachment - size more than xxx kb</title><content type='html'>If you get this error when trying to &lt;b&gt;attach a large file to a trac wiki page&lt;/b&gt;, simply edit the trac.ini file (located at &lt;trac_project_home&gt;/conf/trac.ini to contain the following:&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;[attachment]&lt;br /&gt;max_size = 5242880&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;That's it. No need to restart the server etc. It should take effect as soon as you save trac.ini.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29682506-1924158581308175612?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/1924158581308175612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=1924158581308175612' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/1924158581308175612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/1924158581308175612'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2007/06/trac-rails-cannot-uplaod-attachment.html' title='Trac (Rails): Cannot uplaod attachment - size more than xxx kb'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29682506.post-116875134151598460</id><published>2007-01-14T10:34:00.000+05:30</published><updated>2007-01-14T10:51:03.986+05:30</updated><title type='text'>Ruby On Rails + FastCGI / fcgi malformed header error</title><content type='html'>&lt;b&gt;For RoR applications running on fcgi&lt;/b&gt;&lt;br /&gt;If you are getting a 500 error on some page and the only error you see on the server side is &lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;FastCGI: comm with server "/&lt;some_path&gt;/public/dispatch.fcgi" aborted: error parsing headers: malformed header 'some text here'&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;This is NOT because of any configuration issues with fcgi etc. You are doing "puts" somewhere (or trying to write to stdout somehow) in your application.&lt;br /&gt;Just run this to catch the culprit and change puts to logger.debug or just remove it:&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;find . -name '*.rb' -exec grep -q 'puts' '{}' \; -print&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/29682506-116875134151598460?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/116875134151598460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=116875134151598460' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/116875134151598460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/116875134151598460'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2007/01/ruby-on-rails-fastcgi-fcgi-malformed.html' title='Ruby On Rails + FastCGI / fcgi malformed header error'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29682506.post-116661304268265731</id><published>2006-12-20T16:33:00.000+05:30</published><updated>2006-12-20T16:41:45.863+05:30</updated><title type='text'>Spring: Error message not displayed in JSP after calling errors.rejectValue</title><content type='html'>I spent about half an hour trying to debug a simple (seemingly stupid) error today.&lt;br /&gt;I had a controller doing some validation and rejecting a value that it didn't like, as follows:&lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;errors.rejectValue("file", "Attachments.file", args, "File");&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;In the JSP I had the following boilerplate code to display these errors:&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;&amp;lt;spring:bind path="Attachments.*"&amp;gt;&lt;br /&gt; &amp;lt;b&amp;gt;Got some errors? ${status.errorMessages}&amp;lt;/b&amp;gt;&lt;br /&gt; &amp;lt;c:if test="${not empty status.errorMessages}"&amp;gt;&lt;br /&gt;  &amp;lt;div class="error"&amp;gt;&amp;lt;c:forEach var="error"&lt;br /&gt;   items="${status.errorMessages}"&amp;gt;&lt;br /&gt;   &amp;lt;img src="&amp;lt;c:url value="/images/iconWarning.gif"/&amp;gt;"&lt;br /&gt;    alt="&amp;lt;fmt:message key="icon.warning"/&amp;gt;" class="icon" /&amp;gt;&lt;br /&gt;   &amp;lt;c:out value="${error}" escapeXml="false" /&amp;gt;&lt;br /&gt;   &amp;lt;br /&amp;gt;&lt;br /&gt;  &amp;lt;/c:forEach&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt; &amp;lt;/c:if&amp;gt;&lt;br /&gt;&amp;lt;/spring:bind&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;And &lt;h3&gt;no matter what I did, those errors wouldn't display on the JSP!&lt;/h3&gt;. Finally I figured that lines &amp;lt;spring:bind path="Attachments.*"&amp;gt;....&amp;lt;/spring:bind&amp;gt; &lt;b&gt;must be inside the &amp;lt;body&amp;gt; tag of the JSP.&lt;/b&gt; Now don't ask me why, but &amp;lt;spring:bind&amp;gt; tag won't get evaluated unless it's in the body of the JSP. Just moved it in the body and poof! it worked :).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29682506-116661304268265731?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/116661304268265731/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=116661304268265731' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/116661304268265731'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/116661304268265731'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2006/12/spring-error-message-not-displayed-in.html' title='Spring: Error message not displayed in JSP after calling errors.rejectValue'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29682506.post-116375136083834796</id><published>2006-11-17T13:41:00.000+05:30</published><updated>2006-11-17T13:46:00.850+05:30</updated><title type='text'>Why is my browsing speed so slow on my new Ubuntu machine?</title><content type='html'>Well, I'm no networking expert and I can't say that this will solve your problem. But then, I had to note it down for my own reference and who knows, may be you are having the same problem!&lt;br /&gt;In a nutshell, on my machine, the DNS lookup was taking way too long - much longer than other windows machines on the same subnet. Turns out the windows boxes were connected to an Active Directory server which also happens to be a local DNS server. Those guys were getting fast response and my poor ubuntu box wasn't!&lt;br /&gt;So, what's the answer? Switch back to windows?????? NO WAY!! :)&lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;Check this out:&lt;br /&gt;&lt;br /&gt;http://ubuntu.wordpress.com/2006/08/02/local-dns-cache-for-faster-browsing/&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;It took me exactly 5 minutes to get this working on my box, and I think I'll recover those 5 minutes within the next two days! &lt;br /&gt;Rock on, Ubuntu!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29682506-116375136083834796?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/116375136083834796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=116375136083834796' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/116375136083834796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/116375136083834796'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2006/11/why-is-my-browsing-speed-so-slow-on-my.html' title='Why is my browsing speed so slow on my new Ubuntu machine?'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29682506.post-116324938504697032</id><published>2006-11-11T18:07:00.000+05:30</published><updated>2006-11-11T18:19:45.060+05:30</updated><title type='text'>How to install beryl 3D desktop on Ubuntu Edgy 64 bit</title><content type='html'>To install the popular 3D desktop manager &lt;a href="http://wiki.beryl-project.org/index.php/Main_Page"&gt;beryl&lt;/a&gt; on a 64 bit &lt;a href="http://www.ubuntu.com"&gt;ubuntu&lt;/a&gt; installation can be somewhat annoying if you are a newbie to ubuntu like myself. There are a bunch of sites that tell you how to install berryl package etc. and they are all very good. I followed them and kept getting this error:&lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;Reading package lists... Done&lt;br /&gt;Building dependency tree       &lt;br /&gt;Reading state information... Done&lt;br /&gt;E: Couldn't find package bery1&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Did you get that too?&lt;br/&gt;&lt;br /&gt;Well don't give up hope just yet. Chances are you did the same stupid thing I did. Here's the crux of the problem.&lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;When I added the source repository to /etc/apt/sources.list, I copy/pasted the following:&lt;br/&gt;&lt;br /&gt;deb http://ubuntu.beryl-project.org/ edgy main-edgy&lt;br/&gt;&lt;br /&gt;THAT's NOT CORRECT!&lt;br/&gt;&lt;br /&gt;For a 64 bit processor what you need is this:&lt;br/&gt;&lt;br /&gt;deb http://ubuntu.beryl-project.org/ edgy main-edgy main-edgy-amd64&lt;br/&gt;&lt;br /&gt;If you add that and update the package list, you should then be able to install beryl along with its dependencies. Here's an article which describes it better:&lt;br/&gt;&lt;br /&gt;&lt;a href="http://wiki.beryl-project.org/index.php/Install/Ubuntu/Edgy/XGL"&gt;&lt;br /&gt;http://wiki.beryl-project.org/index.php/Install/Ubuntu/Edgy/XGL&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;And BTW, it's all worth it. Ubuntu with beryl ROCKS!!!&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29682506-116324938504697032?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/116324938504697032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=116324938504697032' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/116324938504697032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/116324938504697032'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2006/11/how-to-install-beryl-3d-desktop-on.html' title='How to install beryl 3D desktop on Ubuntu Edgy 64 bit'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29682506.post-116188229770690454</id><published>2006-10-26T22:31:00.000+05:30</published><updated>2006-10-26T22:34:57.720+05:30</updated><title type='text'>Java alpha-numeric security image generator (CAPTCHA) libraries</title><content type='html'>I've been asked this question more than once. Are there any Java based libraries out there that can generate those skew alpha-numeric images to block bots from entering certain parts of my web-site?&lt;br /&gt;&lt;br /&gt;Yes, of course, there are! Look at:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://simplecaptcha.sourceforge.net/index.html"&gt;http://simplecaptcha.sourceforge.net/index.html&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.retrologic.com/capture-download.html"&gt;http://www.retrologic.com/capture-download.html&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://skewpassim.sourceforge.net/"&gt;http://skewpassim.sourceforge.net/&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://rimggen.sourceforge.net/"&gt;http://rimggen.sourceforge.net/&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29682506-116188229770690454?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/116188229770690454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=116188229770690454' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/116188229770690454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/116188229770690454'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2006/10/java-alpha-numeric-security-image.html' title='Java alpha-numeric security image generator (CAPTCHA) libraries'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29682506.post-116004725056303178</id><published>2006-10-05T16:44:00.000+05:30</published><updated>2006-10-05T16:51:03.830+05:30</updated><title type='text'>Web 2.0 and scalability issues of Servlet Containers</title><content type='html'>We are often told that client side polling in a typical web-app is a &lt;b&gt;poor design choice&lt;/b&gt; but often they don't explain why it is so. Of course, at a high level we know that each client request is associated with a server thread and the thread and it's allocated resources are &lt;b&gt;blocked&lt;/b&gt; until the client request finishes. Therefore if we have too many polling type requests which are "no-op"s, we are potentially tying down a lot of server resources essentially serving a bunch of "no-ops" while eating a chunk of memory each.&lt;br/&gt;&lt;br /&gt;With web 2.0 we are going to have these type of scenarios, whether we like it or not! So is there a better way? Is anybody doing anything about it? Here are two very interesting articles for anyone looking for answers to these questions:&lt;br/&gt;&lt;br /&gt;&lt;a href="http://blogs.sun.com/andi/entry/comet_basics"&gt; http://blogs.sun.com/andi/entry/comet_basics&lt;/a&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;a href="http://www.webtide.com/downloads/whitePaperAjaxJetty.html"&gt;&lt;br /&gt;http://www.webtide.com/downloads/whitePaperAjaxJetty.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29682506-116004725056303178?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/116004725056303178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=116004725056303178' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/116004725056303178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/116004725056303178'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2006/10/web-20-and-scalability-issues-of.html' title='Web 2.0 and scalability issues of Servlet Containers'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29682506.post-116004687363704521</id><published>2006-10-05T16:39:00.000+05:30</published><updated>2006-10-05T16:44:33.650+05:30</updated><title type='text'>EL expression not evaluated! ${msg} appears as ${msg} in the output!</title><content type='html'>If your JSP is printing your ${whatever} el expressions as they are, verify that:&lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt; &lt;li&gt;You are using a JSP2.0 compliant servlet container.&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Your web.xml starting tag looks like this:&lt;br/&gt;&lt;br /&gt;&amp;lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee"&lt;br /&gt;    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;br /&gt;    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&lt;br /&gt;    version="2.4"&amp;gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&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/29682506-116004687363704521?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/116004687363704521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=116004687363704521' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/116004687363704521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/116004687363704521'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2006/10/el-expression-not-evaluated-msg.html' title='EL expression not evaluated! ${msg} appears as ${msg} in the output!'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29682506.post-115970807923117274</id><published>2006-10-01T18:19:00.000+05:30</published><updated>2006-10-01T18:39:41.643+05:30</updated><title type='text'>Spring Error - ModelAndView [ModelAndView: materialized View is [null]</title><content type='html'>I've been struggling with this stupid error for an hour now. Well, don't they all look stupid after they are resolved! &lt;b&gt;If you searched on this exception, read on, you might just find the solution here :).&lt;/b&gt;&lt;br /&gt;I kept getting the following exception in my controller and I just couldn't figure out what I had done wrong.&lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;javax.servlet.ServletException: ModelAndView [ModelAndView: materialized View is [null]; model is {org.springframework.validation.BindException.recipe=org.springframework.validation.BindException: BindException: 0 errors, recipe=com.foo.bar.Recipe@cf710e}] neither contains a view name nor a View object in servlet with name 'action'&lt;br /&gt; at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:919)&lt;br /&gt; at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:705)&lt;br /&gt; at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)&lt;br /&gt; at org.springframework.web.servlet.FrameworkServlet.serviceWrapper(FrameworkServlet.java:386)&lt;br /&gt; at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:346)&lt;br /&gt; at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)&lt;br /&gt; at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)&lt;br /&gt; at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:445)&lt;br /&gt; at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:356)&lt;br /&gt; at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:226)&lt;br /&gt; at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:627)&lt;br /&gt; at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)&lt;br /&gt; at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:123)&lt;br /&gt; at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)&lt;br /&gt; at org.mortbay.jetty.Server.handle(Server.java:269)&lt;br /&gt; at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:430)&lt;br /&gt; at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:687)&lt;br /&gt; at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:492)&lt;br /&gt; at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:199)&lt;br /&gt; at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:339)&lt;br /&gt; at org.mortbay.jetty.nio.HttpChannelEndPoint.run(HttpChannelEndPoint.java:270)&lt;br /&gt; at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;After much googling, I found nothing. Finally I turned on the DEBUG logging for spring and tried to solve it the hard way - logically.&lt;br /&gt;Long story short, here's why I was getting the exception:&lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;&lt;br /&gt;        I had a bean mapping as follows:&lt;br /&gt;&lt;br /&gt; &amp;lt;bean id="barManager"&lt;br /&gt;  class="com.foo.ui.controller.BarManager" &lt;br /&gt;  autowire="byName"&amp;gt;&lt;br /&gt;  &amp;lt;property name="commandName" value="bar" /&amp;gt;&lt;br /&gt;  &amp;lt;property name="commandClass"&lt;br /&gt;   value="com.foo.dao.Bar" /&amp;gt;&lt;br /&gt; &amp;lt;/bean&amp;gt;   &lt;br /&gt; &lt;br /&gt;        I also had a URL mapping as follows:&lt;br /&gt; &amp;lt;bean id="urlMapping"  class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"&amp;gt;&lt;br /&gt;  &amp;lt;property name="mappings"&amp;gt;&lt;br /&gt;   &amp;lt;props&amp;gt;&lt;br /&gt;    &amp;lt;prop key="/barlink.html"&amp;gt;barManager&amp;lt;/prop&amp;gt;&lt;br /&gt;   &amp;lt;/props&amp;gt;&lt;br /&gt;  &amp;lt;/property&amp;gt;&lt;br /&gt; &amp;lt;/bean&amp;gt;&lt;br /&gt;I kept getting the above exception when I tried to access http://localhost:8080/myapp/barlink.html&lt;br /&gt;&lt;b&gt;The solution to the problem was adding the following line to the barManager definition:&lt;br /&gt;&lt;i&gt; &amp;lt;property name="formView" value="bars" /&amp;gt; &lt;/i&gt;&lt;br /&gt;Also, the value "bars" MUST map to an existing view name. In my case, it mapped to bars.jsp.&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;After adding this, the definition looks like this:&lt;br /&gt; &amp;lt;bean id="barManager"&lt;br /&gt;  class="com.foo.ui.controller.BarManager" &lt;br /&gt;  autowire="byName"&amp;gt;&lt;br /&gt;  &amp;lt;property name="commandName" value="bar" /&amp;gt;&lt;br /&gt;  &amp;lt;property name="commandClass"&lt;br /&gt;   value="com.foo.dao.Bar" /&amp;gt;&lt;br /&gt;                &amp;lt;property name="formView" value="bars" /&amp;gt;&lt;br /&gt; &amp;lt;/bean&amp;gt;   &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;That's it. It took me an hour and a half to figure out and about 15 min to write this. Hopefully this will save you some time :).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29682506-115970807923117274?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/115970807923117274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=115970807923117274' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115970807923117274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115970807923117274'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2006/10/spring-error-modelandview-modelandview.html' title='Spring Error - ModelAndView [ModelAndView: materialized View is [null]'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29682506.post-115882967024743358</id><published>2006-09-21T14:19:00.000+05:30</published><updated>2006-09-21T14:44:14.270+05:30</updated><title type='text'>Are localhost:8080, [ipaddress]:8080 and [machine_name]:8080 all different for an HTTP session?</title><content type='html'>A very common (and quite frustrating) situation faced by J2EE programmers is the following:&lt;br /&gt;&lt;b&gt;I log in to http://localhost:8080/myApp and do stuff. Then I type http://machine_name:8080/myApp in the browser (where machine_name is the name of my machine - localhsot). The stupid app server asks me to log in again!&lt;/b&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;OR&lt;br /&gt;&lt;b&gt;I log in to http://localhost:8080/myApp and do stuff. My application generates a link such as "http://10.10.0.90:8080/myApp/doSomething.jsp" in the browser. In reality 10.10.0.90 is the ip address of my machine - localhsot. The stupid app server asks me to log in again!&lt;/b&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;Well, think again. May be the app server is not all that stupid after all :).&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;This has to do with how the &lt;b&gt;&lt;i&gt;browser&lt;/i&gt;&lt;/b&gt; is &lt;b&gt;&lt;i&gt;supposed to&lt;/i&gt;&lt;/b&gt; handle sessions. &lt;br /&gt;As far as the browser is concerned, 10.10.0.90, machine_name, 127.0.0.1 and localhost are all &lt;i&gt;different servers&lt;/i&gt;, even though in reality they might end up on the same machine. The browser has no way of knowing that they are all the same servers, and therefore it must (as per standard) try to establish a new session when the URL changes - which it does, and your webapp sends the browser to the log in page.&lt;br /&gt;Diving a level deeper, the server "understands" that a particular request is bound to an existing session by looking at the JSessionID in the HTTP header of the request. For all requests subsequent to login, the browser sends this JSessionID in the HTTP header &lt;b&gt;&lt;i&gt;as long as the request is to the same server with which the session was&lt;br /&gt;established&lt;/i&gt;&lt;/b&gt;. For the browser, 10.10.0.90 and machine_name appear to be different servers, and hence when the server address changes, the browser doesn't end a JSessionID. Basically the browser treats these two as two separate sessions.&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;This may sound complex, but is actually quite simple to observe. For firefox, you get an extension called live http headers (http://livehttpheaders.mozdev.org) which displays all HTTP headers, including cookies, session ids etc. that the browser&lt;br /&gt;sends. If you like (or are forced to use) IE, there's also a freeware plug-in for IE&lt;br /&gt;(http://www.blunck.info/iehttpheaders.html) which does the same. Observe the headers of your requests and you'll see for yourself what I'm talking about.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29682506-115882967024743358?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/115882967024743358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=115882967024743358' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115882967024743358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115882967024743358'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2006/09/are-localhost8080-ipaddress8080-and.html' title='Are localhost:8080, [ipaddress]:8080 and [machine_name]:8080 all different for an HTTP session?'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29682506.post-115374701255550833</id><published>2006-07-24T18:35:00.000+05:30</published><updated>2006-07-24T18:49:04.416+05:30</updated><title type='text'>Subversion with Apache 2.2: incorrect mod_dav_svn.so</title><content type='html'>I was trying to set up subversion's latest binary on windows (version 1.3.2) with Apache's latest version on windows (version2.2) and just couldn't get the darn thing to work. It kept on saying that it &lt;b&gt;couldn't load mod_dav_svn.so&lt;/b&gt; even after copying the .so files from the subversion zip file.&lt;br /&gt;After much wasted effort, I found that the subversion binary (1.3.2) had the .so files compiled against apache 2.0 and not 2.2.&lt;br /&gt;But don't worry! It's not necessary for you to compile these. Someone else was smart enough to do it and yes, kind enough to share it :).  The correct binary files for the same are posted here:&lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;http://www.nabble.com/Windows-binaries-of-mod_dav_svn.so-and-mod_authz_svn.so-for-apache-2.2-t1221958.html&lt;br /&gt;http://rapidshare.de/files/14820216/svn130_apache22_mods.zip.html&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;I have verified that after putting these files in apache's modules directory, subversion works fine with Apache 2.2.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29682506-115374701255550833?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/115374701255550833/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=115374701255550833' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115374701255550833'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115374701255550833'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2006/07/subversion-with-apache-22-incorrect.html' title='Subversion with Apache 2.2: incorrect mod_dav_svn.so'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29682506.post-115373318626944136</id><published>2006-07-24T14:46:00.000+05:30</published><updated>2006-07-24T15:01:18.326+05:30</updated><title type='text'>Apache 2.2 - Active Directory authentication</title><content type='html'>&lt;h2&gt;Using ldap_module for Apache to authenticate against an Active Directory Server&lt;/h2&gt;&lt;br /&gt;&lt;br /&gt;I recently configured our intranet site to use Active Directory for authentication/authorization. Though I found a number of conflicting mail threads, postings on the web, here's the configuration that worked for me. I was doing this with my Apache server on Windows 2003, however it would also apply to an apache installation on linux just as is.&lt;br /&gt;&lt;b&gt;First load the two apache modules required for ldap authentication:&lt;/b&gt;&lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;LoadModule ldap_module modules/util_ldap.so&lt;br /&gt;LoadModule auth_ldap_module modules/mod_auth_ldap.so&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Now edit your httpd.conf file as follows.&lt;/b&gt; &lt;br /&gt;Simply change the lines in bold according to your environment.&lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;&amp;lt;Directory /&amp;gt;&lt;br /&gt;    Options FollowSymLinks&lt;br /&gt;    AllowOverride None&lt;br /&gt;    Order deny,allow&lt;br /&gt;    Deny from all&lt;br /&gt;    Satisfy all&lt;br /&gt;AuthBasicProvider ldap&lt;br /&gt;# This must be set to off for the ldap "require valid-user" directive to work.&lt;br /&gt;AuthzLDAPAuthoritative off&lt;br /&gt;# Do basic password authentication in the clear&lt;br /&gt;AuthType Basic&lt;br /&gt;# The name of the protected area or "realm"&lt;br /&gt;AuthName "&lt;b&gt;Secured Area&lt;/b&gt;"&lt;br /&gt;# Active Directory requires an authenticating DN to access records&lt;br /&gt;AuthLDAPBindDN "CN=&lt;b&gt;Existing User,CN=users,DC=yourcompany,DC=com&lt;/b&gt;"&lt;br /&gt;# This is the password for the AuthLDAPBindDN user in Active Directory&lt;br /&gt;AuthLDAPBindPassword "&lt;b&gt;yourPasswordInClearText&lt;/b&gt;"&lt;br /&gt;# The LDAP query URL&lt;br /&gt;AuthLDAPURL "&lt;b&gt;ldap://myADServer:389/cn=Users,dc=myCompany,dc=com?sAMAccountName?sub?(objectClass=user)&lt;/b&gt;"&lt;br /&gt;require valid-user&lt;br /&gt;&amp;lt;/Directory&amp;gt;&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/29682506-115373318626944136?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/115373318626944136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=115373318626944136' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115373318626944136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115373318626944136'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2006/07/apache-22-active-directory.html' title='Apache 2.2 - Active Directory authentication'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29682506.post-115348133040704454</id><published>2006-07-21T16:55:00.000+05:30</published><updated>2006-07-21T17:05:41.006+05:30</updated><title type='text'>Java JNDI : Look up IP address by host name</title><content type='html'>&lt;h2&gt;NSLookup using pure Java?&lt;/h2&gt;&lt;br /&gt;So, is it even possible to do this in pure Java code? &lt;br /&gt;That's the question I was struggling with for one of my recent projects. &lt;br /&gt;&lt;br /&gt;If you googled for something like that, you came to the right place.&lt;br /&gt;&lt;br /&gt;This is not a tutorial. So without much lecture, here's some sample code that works. &lt;br /&gt;&lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;import java.util.Hashtable;&lt;br /&gt;&lt;br /&gt;import javax.naming.NamingException;&lt;br /&gt;import javax.naming.directory.Attribute;&lt;br /&gt;import javax.naming.directory.Attributes;&lt;br /&gt;import javax.naming.directory.DirContext;&lt;br /&gt;import javax.naming.directory.InitialDirContext;&lt;br /&gt;&lt;br /&gt;import org.apache.commons.logging.Log;&lt;br /&gt;import org.apache.commons.logging.LogFactory;&lt;br /&gt;&lt;br /&gt;public class IPLookup {&lt;br /&gt;&lt;br /&gt; private static final String IP_ADDR_ATTR = "A";&lt;br /&gt;&lt;br /&gt; private static final Log LOG = LogFactory.getLog(IPLookup.class);&lt;br /&gt;&lt;br /&gt; private static Hashtable conf = new Hashtable();&lt;br /&gt;&lt;br /&gt; public static final void init(String dnsServer, String domain) {&lt;br /&gt;  conf.put("java.naming.factory.initial",&lt;br /&gt;    "com.sun.jndi.dns.DnsContextFactory");&lt;br /&gt;  conf.put("java.naming.provider.url", "dns://" + dnsServer + "/"&lt;br /&gt;    + domain);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public static final String lookupIPAddress(String dnsHostName) {&lt;br /&gt;  String ipAddress = null;&lt;br /&gt;&lt;br /&gt;  try {&lt;br /&gt;   DirContext ictx = new InitialDirContext(conf);&lt;br /&gt;   System.out.println("Created initial context. Looking up "&lt;br /&gt;     + dnsHostName + "...");&lt;br /&gt;   Attributes attrs = ictx.getAttributes(dnsHostName,&lt;br /&gt;     new String[] { IP_ADDR_ATTR });&lt;br /&gt;   Attribute ipAddrAttr = attrs.get(IP_ADDR_ATTR);&lt;br /&gt;   if (ipAddrAttr != null) {&lt;br /&gt;    ipAddress = (String) ipAddrAttr.get();&lt;br /&gt;   }&lt;br /&gt;  } catch (NamingException ne) {&lt;br /&gt;   LOG.error("Failed to Lookup IP address for " + dnsHostName, ne);&lt;br /&gt;  }&lt;br /&gt;  return ipAddress;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&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/29682506-115348133040704454?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/115348133040704454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=115348133040704454' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115348133040704454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115348133040704454'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2006/07/java-jndi-look-up-ip-address-by-host.html' title='Java JNDI : Look up IP address by host name'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29682506.post-115166083380851554</id><published>2006-06-30T14:54:00.000+05:30</published><updated>2006-06-30T15:19:57.493+05:30</updated><title type='text'>Creating a branch in CVS and using it from Eclipse</title><content type='html'>&lt;b&gt; Wanna create a branch in your CVS tree and use it from Eclipse for develpoment? Read on...&lt;/b&gt;&lt;br /&gt;     We had never created a branch in our CVS tree thus far, partly because there aren't very nice visual merge tools for CVS (like clearcase, for example). That makes it a bit tricky to merge from one branch to another - basically you gotta know what you are doing! :). &lt;br /&gt;     Anyhow, we reached a point in our development cycle that we had to create a branch for a release. After much googling, I found &lt;a href="http://www.badgertronics.com/writings/cvs/labeling-n-branching.html"&gt;this concise article&lt;/a&gt; which was very helpful. Still, in short, what we did boils down to this:&lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;&lt;b&gt;Set up the branch in CVS:&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt; cd your-project-directory &lt;/li&gt;&lt;br /&gt;&lt;li&gt; cvs tag -R -b tag-name &lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Checking out code from this branch:&lt;/b&gt;&lt;br/&gt;&lt;br /&gt;&lt;i&gt;For those using cvs from command line - &lt;/i&gt;&lt;br/&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;gt;cvs checkout -r tag-name project-name&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;i&gt;For those using Eclipse:&lt;/i&gt;&lt;br/&gt;&lt;br /&gt;It's slightly more tricky than you'd think :). At first we were all worried since our branch was just not showing up in the CVS Tree. Here's how to get your branch to display there correctly.&lt;br/&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;Go to "CVS Repository Exploring" perspective and select your project from "HEAD"&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Now right-click on this node and click on "Tag with Existing..."&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;In the dialog that pops up, click on "Refresh Tags". This forces eclipse to go fetch the latest branch and tag information.&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Now click "Cancel" on the "Tag with Existing..." dialog.&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Now in the "CVS Repositories" tab in eclipse, you should see your new branch under the "Branches" node (at the same level as "HEAD").&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Find your module under this node, tagged with the branch you wanted. Then check out as usual by right-clicking on it and selecting "Check out as"&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;Disclaimer: I'm no expert in doing this stuff, but I've found a way that worked for me. If you know a better way, please post it here!&lt;br/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29682506-115166083380851554?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/115166083380851554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=115166083380851554' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115166083380851554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115166083380851554'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2006/06/creating-branch-in-cvs-and-using-it.html' title='Creating a branch in CVS and using it from Eclipse'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29682506.post-115095824627743024</id><published>2006-06-22T11:43:00.000+05:30</published><updated>2006-06-22T12:13:11.383+05:30</updated><title type='text'>xsl:fo dynamically insert external image.</title><content type='html'>We were trying to insert a dynamically generated image in our PDF document generated using &lt;a href="http://xmlgraphics.apache.org/fop/"&gt;apache FOP&lt;/a&gt;. Reading the &lt;a href="http://xmlgraphics.apache.org/fop/fo.html#external-resources"&gt;documentation on their site&lt;/a&gt; it was clear that you can insert an external image by specifying the URL to that image. However, it wasn't quite clear how I could &lt;b&gt;&lt;i&gt;dynamically&lt;/i&gt;&lt;/b&gt; generate this image URL. &lt;br /&gt;We needed this badly as we wanted to insert scanned signature images (which of course were not public URLs :). &lt;br /&gt;The end goal in our case was to generate something like this:&lt;br /&gt;&lt;codelines&gt;&lt;br /&gt;&amp;lt;fo:external-graphic src="url('file:d:///images/toms_signature.jpg')"/&amp;gt;&lt;br /&gt;&lt;/codelines&gt;&lt;br /&gt;when tom is logged in, and&lt;br /&gt;&lt;codelines&gt;&lt;br /&gt;&amp;lt;fo:external-graphic src="url('file:d:///images/teenas_signature.jpg')"/&amp;gt;&lt;br /&gt;&lt;/codelines&gt;&lt;br /&gt;when teena is logged in.&lt;br /&gt;After much googling, we found the solution. Simply put, you &lt;i&gt;can extract your image URL from the XML.&lt;/i&gt; I'm assuming you know how to dynamically generate it in the XML (duh!). Here's how:&lt;br/&gt;&lt;br /&gt;&lt;b&gt;We changed the XML to generate a &amp;lt;signatureImage&amp;gt; element as follows:&lt;/b&gt;&lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;&amp;lt;document&amp;gt;&lt;br /&gt;     .....&lt;br /&gt;     &amp;lt;signatureImage&amp;gt;url('file:d:///images/teenas_signature.jpg')&amp;lt;/signatureImage&amp;gt;&lt;br /&gt;     .....&lt;br /&gt;&amp;lt;/document&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Then we added the following element in our XSL:FO in the correct place (the place in the document where the signature was to be displayed).&lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;&amp;lt;xsl:template match="document"&amp;gt;&lt;br/&gt;&lt;br /&gt;   .....&lt;br/&gt;&lt;br /&gt;    &amp;lt;fo:external-graphic src="{signatureImage}"/&amp;gt;&lt;br/&gt;&lt;br /&gt;   .....&lt;br/&gt;&lt;br /&gt;&amp;lt;/xsl:template match="document"&amp;gt;&lt;br/&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;That's it! It works like a charm!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29682506-115095824627743024?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/115095824627743024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=115095824627743024' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115095824627743024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115095824627743024'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2006/06/xslfo-dynamically-insert-external.html' title='xsl:fo dynamically insert external image.'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29682506.post-115088976276543296</id><published>2006-06-21T16:57:00.000+05:30</published><updated>2006-06-21T17:06:02.773+05:30</updated><title type='text'>Spring Validator "does not support command class" problem - and solution</title><content type='html'>If you are using Spring Validator (with XDoclet maybe) and are frustrated with an exception that looks like the following, read on. You are in luck!&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;org.springframework.beans.factory.BeanCreationException: &lt;br/&gt;Error creating bean with name 'myController' defined in ServletContext resource [/WEB-INF/action-servlet.xml]: &lt;br/&gt;Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: &lt;br/&gt;Validator [org.springmodules.commons.validator.DefaultBeanValidator@1be2de2] &lt;codelines&gt;does not support command class [com.foo.model.MyClass]&lt;/codelines&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This happens because you have not specified any validation requirements for &lt;codelines&gt;com.foo.model.MyClass&lt;/codelines&gt;&lt;br /&gt;&lt;codelines&gt;If using XDoclet, the most common reason is specifying your validation tags on the getFooBar() method rather than the setFooBar() method of MyClass.&lt;/codelines&gt;&lt;br/&gt;&lt;br /&gt;&lt;br /&gt;If you think you've done everything right, check the generated (or hand-edited) validation.xml file (typically deployed in the WEB-INF directory of your war file). It must contain a &amp;lt;form&amp;gt; stanza for MyClass with some fields to validate.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29682506-115088976276543296?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/115088976276543296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=115088976276543296' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115088976276543296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115088976276543296'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2006/06/spring-validator-does-not-support.html' title='Spring Validator &quot;does not support command class&quot; problem - and solution'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29682506.post-115088402844523667</id><published>2006-06-21T15:11:00.000+05:30</published><updated>2006-06-21T15:52:10.970+05:30</updated><title type='text'>Cron job - quick &amp; dirty</title><content type='html'>Here's how you set up a cron job on a linux machine:&lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt; Write the shell script you want to execute wherever you want. Say, /tmp/myCron.sh&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Try executing this script manually from the console. Make sure it does what you need. &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;codelines&gt; &amp;gt;sudo vi /etc/crontab &lt;/codelines&gt;&lt;br /&gt;   Here I'm assuming that you have root access using sudo and you know that you ought to be careful with sudo etc.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Now in this file, you will see something like this:&lt;br/&gt;&lt;br /&gt;&lt;codelines&gt;47 1 * * * root run-parts /etc/cron.daily&lt;/codelines&gt;&lt;br/&gt;&lt;br /&gt;This means : Run all scripts under the directory /etc/cron.daily every day at 01:47 (AM). See what your crontab file is set up to do. Here is the generic description of the format:&lt;br /&gt;&lt;table&gt;&lt;br /&gt;&lt;tr&gt;&lt;td colspan="2"&gt;&lt;br /&gt;    00,30 12,13,14 1 4 3 &amp;lt;user&amp;gt; run-parts &amp;lt;dir&amp;gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;    00,30    &lt;td&gt;  This is where you specify the minutes (0-59) We have &lt;br /&gt;                chosen both :00 and :30 (right on the hour and &lt;br /&gt;                half hour)&lt;br /&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;    12,13,14 &lt;td&gt;  These are the hours, it is in military time so 0-23 &lt;br /&gt;                (this example equals to 12pm, 1pm, and 2pm)&lt;br /&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;    1        &lt;td&gt;  The day of the month (1-31) This is of course the first&lt;br /&gt;                day of the month.&lt;br /&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;    4        &lt;td&gt;  This is the month (1-12) April in this case&lt;br /&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;    3        &lt;td&gt;  This is the day of the week (0-6 with 0 being Sunday)&lt;br /&gt;                Wednesday is being used in example.&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&amp;lt;user&amp;gt;&lt;td&gt; Run the cron job as this user &lt;/td&gt; &lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&amp;lt;dir&amp;gt;&lt;td&gt; Run the cron job parts (scripts) from this dir&lt;/td&gt; &lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Based on the contents of your crontab file, copy your script in the right place. In my case it would be: &lt;codelines&gt; &amp;gt;sudo cp /tmp/myCron.sh /etc/cron.daily/ &lt;/codelines&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt; Make sure the script is executable.&lt;br/&gt;&lt;codelines&gt;&amp;gt;sudo chmod +x /etc/cron.daily/myCron.sh &lt;/codelines&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt; That's it! Now to test your cron job, look at the system date as:&lt;br/&gt;&lt;br /&gt;&lt;codelines&gt;&amp;gt;date&lt;br/&gt;Wed Jun 21 03:34:00 PDT 2006&lt;/codelines&gt;&lt;br/&gt;Assuming you got the above output for the system date, you can schedule the cron job (cron.daily) to run at the next minute as:&lt;br /&gt;&lt;codelines&gt;34 3 * * * root run-parts /etc/cron.daily&lt;/codelines&gt;&lt;br/&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;That's of course, the quick &amp; dirty way to get you going. If you need more information, just do &lt;a href="http://www.hmug.org/man/5/crontab.php"&gt;man crontab&lt;/a&gt; or &lt;a href="http://www.google.com/search?q=cron+job+set+up+on+linux"&gt; google it! &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29682506-115088402844523667?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/115088402844523667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=115088402844523667' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115088402844523667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115088402844523667'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2006/06/cron-job-quick-dirty.html' title='Cron job - quick &amp; dirty'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29682506.post-115086968198194682</id><published>2006-06-21T11:25:00.000+05:30</published><updated>2006-06-21T11:36:42.596+05:30</updated><title type='text'>AJAX - unplugged</title><content type='html'>These days, everyone developing webapps seems to be doing AJAX. If you got bogged down by the hype around it (as I did at first), here's a posting from the web that I found very useful in cutting through the hype. This is really the core of AJAX, and like most successful technologies, it's very very easy to understand. I'm pasting below the contents of the &lt;a href="http://marc.theaimsgroup.com/?l=php-general&amp;m=112198633625636&amp;w=2"&gt;original posting&lt;/a&gt;&lt;br /&gt;&lt;div id="code"&gt;&lt;br /&gt;I find a lot of this AJAX stuff a bit of a hype.  Lots of people have&lt;br /&gt;been using similar things long before it became "AJAX".  And it really&lt;br /&gt;isn't as complicated as a lot of people make it out to be.  Here is a&lt;br /&gt;simple example from one of my apps.  First the Javascript:&lt;br /&gt;&lt;br /&gt;function createRequestObject() {&lt;br /&gt;    var ro;&lt;br /&gt;    var browser = navigator.appName;&lt;br /&gt;    if(browser == "Microsoft Internet Explorer"){&lt;br /&gt;        ro = new ActiveXObject("Microsoft.XMLHTTP");&lt;br /&gt;    }else{&lt;br /&gt;        ro = new XMLHttpRequest();&lt;br /&gt;    }&lt;br /&gt;    return ro;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;var http = createRequestObject();&lt;br /&gt;&lt;br /&gt;function sndReq(action) {&lt;br /&gt;    http.open('get', 'rpc.php?action='+action);&lt;br /&gt;    http.onreadystatechange = handleResponse;&lt;br /&gt;    http.send(null);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function handleResponse() {&lt;br /&gt;    if(http.readyState == 4){&lt;br /&gt;        var response = http.responseText;&lt;br /&gt;        var update = new Array();&lt;br /&gt;&lt;br /&gt;        if(response.indexOf('|' != -1)) {&lt;br /&gt;            update = response.split('|');&lt;br /&gt;            document.getElementById(update[0]).innerHTML = update[1];&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This creates a request object along with a send request and handle&lt;br /&gt;response function.  So to actually use it, you could include this js in&lt;br /&gt;your page.  Then to make one of these backend requests you would tie it&lt;br /&gt;to something.  Like an onclick event or a straight href like this:&lt;br /&gt;&lt;br /&gt;  &lt;a href="javascript:sndReq('foo')"&gt;[foo]&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That means that when someone clicks on that link what actually happens&lt;br /&gt;is that a backend request to rpc.php?action=foo will be sent.&lt;br /&gt;&lt;br /&gt;In rpc.php you might have something like this:&lt;br /&gt;&lt;br /&gt;  switch($_REQUEST['action']) {&lt;br /&gt;    case 'foo':&lt;br /&gt;      /* do something */&lt;br /&gt;      echo "foo|foo done";&lt;br /&gt;      break;&lt;br /&gt;    ...&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;Now, look at handleResponse.  It parses the "foo|foo done" string and&lt;br /&gt;splits it on the '|' and uses whatever is before the '|' as the dom&lt;br /&gt;element id in your page and the part after as the new innerHTML of that&lt;br /&gt;element.  That means if you have a div tag like this in your page:&lt;br /&gt;&lt;br /&gt;  &lt;div id="foo"&gt;&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Once you click on that link, that will dynamically be changed to:&lt;br /&gt;&lt;br /&gt;  &lt;div id="foo"&gt;&lt;br /&gt;  foo done&lt;br /&gt;  &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;That's all there is to it.  Everything else is just building on top of&lt;br /&gt;this.  Replacing my simple response "id|text" syntax with a richer XML&lt;br /&gt;format and makine the request much more complicated as well.  Before you&lt;br /&gt;blindly install large "AJAX" libraries, have a go at rolling your own&lt;br /&gt;functionality so you know exactly how it works and you only make it as&lt;br /&gt;complicated as you need.  Often you don't need much more than what I&lt;br /&gt;have shown here.&lt;br /&gt;&lt;br /&gt;Expanding this approach a bit to send multiple parameters in the&lt;br /&gt;request, for example, would be really simple.  Something like:&lt;br /&gt;&lt;br /&gt;  function sndReqArg(action,arg) {&lt;br /&gt;    http.open('get', 'rpc.php?action='+action+'&amp;arg='+arg);&lt;br /&gt;    http.onreadystatechange = handleResponse;&lt;br /&gt;    http.send(null);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;And your handleResponse can easily be expanded to do much more&lt;br /&gt;interesting things than just replacing the contents of a div.&lt;br /&gt;&lt;br /&gt;-Rasmus&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/29682506-115086968198194682?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/115086968198194682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=115086968198194682' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115086968198194682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115086968198194682'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2006/06/ajax-unplugged.html' title='AJAX - unplugged'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29682506.post-115025681040137408</id><published>2006-06-14T09:13:00.000+05:30</published><updated>2006-06-14T11:57:06.046+05:30</updated><title type='text'>Installing Mysql Server on Red Hat Linux (for the impatient)</title><content type='html'>I have a red-hat linux 9 server on which I needed to install MySQL 4.1.20. I had already tried using the rpm, and for whatever reason, that just didn't work. So I decided to go with the binary distribution, and boy, it was so much easier!&lt;br /&gt;&lt;br /&gt;Here's what I did:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt; Downloaded Mysql server archive for RedHat Linux from ftp://mysql.mirror.rafal.ca/pub/mysql/Downloads/MySQL-4.1/mysql-max-4.1.20-pc-linux-gnu-i686.tar.gz&lt;br /&gt;There are of course other mirrors you could download from.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The basic commands that you must execute to install and use a MySQL binary distribution are:&lt;br /&gt;&lt;div id="code"&gt; shell&gt; groupadd mysql&lt;br /&gt;   shell&gt; useradd -g mysql mysql&lt;br /&gt;   shell&gt; cd /usr/local&lt;br /&gt;   shell&gt; gunzip &lt; /PATH/TO/MYSQL-VERSION-OS.tar.gz | tar xvf -      shell&gt; ln -s FULL-PATH-TO-MYSQL-VERSION-OS mysql&lt;br /&gt;   shell&gt; cd mysql&lt;br /&gt;   shell&gt; scripts/mysql_install_db --user=mysql&lt;br /&gt;   shell&gt; chown -R root  .&lt;br /&gt;   shell&gt; chown -R mysql data&lt;br /&gt;   shell&gt; chgrp -R mysql .&lt;br /&gt;   shell&gt; bin/mysqld_safe --user=mysql &amp;amp;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;If you are upgrading from a 4.1.x version (as I was, from 4.1.11), you could simply replace the &lt;code&gt;[path/to/mysql]/data &lt;/code&gt; directory with your old data directory and then restart the server.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;That's it. It was a heck of a lot simpler than I had thought after reading many articles :).&lt;br /&gt;If you read this and are as lucky as I was - it shouldn't take more than 15 minutes to get it up and running!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29682506-115025681040137408?l=tech-scribbles.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tech-scribbles.blogspot.com/feeds/115025681040137408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29682506&amp;postID=115025681040137408' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115025681040137408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29682506/posts/default/115025681040137408'/><link rel='alternate' type='text/html' href='http://tech-scribbles.blogspot.com/2006/06/installing-mysql-server-on-red-hat.html' title='Installing Mysql Server on Red Hat Linux (for the impatient)'/><author><name>neeraj</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
