JUnit report StackOverflowError ; a quick hack fix

Posted by Rajesh Shetty on June 08, 2010

Blog post after a long time but this one deserves it because this can save someone a day or few minutes/hours of their time for sure.

Issue: When you run JUnit report generation using Ant target you will run into java.lang.StackOverflowError.

Where: Happens only on Windows machine (at least I have seen it). Works fine on linux/mac os x.

Why: When XSLT engine runs thru all the properties supplied to it while doing the actual test case to report translation, it runs into java.class.path variable specified and if your class path has too many path elements , it goes into infinite death loop.

How to fix: A Quick hack or fix (whatever you want to call it as); is to tell XSLT engine ignore the java.class.path while evaluating properties. To do that you will have to explicitly specify where to pick up the stylesheet from. Luckily junitreport lets us specify the external xsl folder location using styledir attribute in

 <report ... 

tag. So this is what you need to do.

  1. get a copy of junit-noframes.xsl (if you are using with frames get a copy of that) from the internet. or you should be able to get this from the latest version of Apache Ant and it should be located in /etc folder. Now copy this xsl fi
  2. Now change

    <xsl:template match="properties"> 

    section from

    <xsl:for-each select="property">

    to

    <xsl:for-each select="property[not(@name = 'java.class.path')]">

    and save this file in some location e.g c:/junit/xsl

  3. In your ant target explicitly specify the junit-noframes.xsdl location by adding styledir . It should look something like this

    <report format="noframes" todir="${junit.test.reports.dir}" styledir="c:/junit/xsl" />

That should fix the issue.
Point # 2 above tells the xsl engine to ignore classpath variable.

Rails, Phusion Passenger, Apache httpd Permission Denied error - Resolved one way.

Posted by Rajesh Shetty on February 25, 2009

This blog post is long due. Once again its a quick tip which can save lot of developers time in setting up rails with phusion passenger when they run into permission denied error.

After installing Passenger Phusion on a existing Apache HTTP web server when I started the Apache server and try to launch the app in browser I was getting following error.

[client ::1] (13)Permission denied: access to /favicon.ico denied, referer: http://localhost/

[client ::1] (13)Permission denied: access to / denied


After fixing obvious issues around permission like below, still no luck.
  • chmod on rails directory , so that Apache/Phusion would have all the permission to access the rails directory
  • Adjusting VirtualHost directory permission in Apache config (httpd.conf) file to allow all which would look something like this

<VirtualHost *:80>
ServerName localhost
DocumentRoot  <rails app directory>
<Directory  <rails app directory> >
Allow from all
</Directory>
RailsEnv development
RailsDefaultUser root
</VirtualHost>

As I was going thru httpd.conf in detail, I noticed that Apache kicking off the process under user  ”Daemon” every time I started the web server. This surely sounded like a issue to me and can lead to permission problems. So it was just a matter of changing this user to the my default user and bounce the server. This finally fixed it.
Look for following in your httpd.conf

User daemon


change this to

User <default machine user>


Here is one reference which talks about solution similar to what I explained above.

Following are some references for installing phusion passenger

Blogged with MessageDance using Gmail | Reply On Twitter

Amazon Kindle 2 Has Arrived - Is new kindle a podcast device too ?

Posted by Rajesh Shetty on February 11, 2009

Saw this email from Amazon and looks like they are coming up with features that do matter. Although I’m not a book reader, but I like the words of “Text to Speech”. Kindle is turning into a podcast device also.
More possibilities for college/universities. Lets hope Kindle becomes iPod for books.

Dear Customers,

I am proud to introduce
Kindle 2—the next generation of our wireless reading device.

Since launching the original Kindle a little over a year ago, the customer response has far surpassed our highest hopes—and were grateful and appreciative for that. More people are reading more books, periodicals, and blogs on Kindle sooner than we ever imagined. We kept everything readers love about the original Kindle—the convenience of reading what you want, when you want it, the immediacy of getting book wirelessly delivered in less than 60 seconds, and Kindles ability to disappear in your hands so you can get lost in the authors words.

Improved battery life means you can read up to four days on a single charge. Its new, streamlined design makes Kindle 2 as thin as a typical magazine and lighter than a paperback. We added more storage, allowing you to carry over 1,500 titles. An advanced display provides even crisper images and clear text for an improved book-like reading experience.
Our new new Text-to-Speech feature means Kindle can read every book, blog, magazine, and newspaper out loud to you.

At Amazon, weve always been obsessed with selection, and we know that even the best reading device would be useless without the books you want to read. Today, the Kindle Store has more than 230,000 books, including 103 of the 110 New York Times Best Sellers, plus top newspapers, magazines, and blogs. We added over 40,000 new titles in just the last three months. Our vision for Kindle is to have every book ever printed, in any language, all available in under 60 seconds.


We hope you enjoy
Kindle 2.


Jeff
Jeff Bezos
Founder, Amazon.com

Blogged with MessageDance using Gmail | Reply On Twitter

Free Trip For Two - by Leigh Rubin

Posted by Rajesh Shetty on January 20, 2009

Blogged with MessageDance using iPhone | Reply On Twitter

A R Rahman gets Critics choice award for Best music

Posted by Rajesh Shetty on January 09, 2009

For movie Slumdog Millionair

e

Blogged with MessageDance using iPhone | Reply On Twitter

Leadership in market share & power of brilliant design- Part 1 : YouTube & JVC

Posted by Rajesh Shetty on September 08, 2008

How far can someone take a simple idea and turn into billion dollar industry around it without really knowing about it ?. YouTube is that success.

Did YouTube founders ever thought that one day their idea will have such massive impact on the industry that video hardware manufacturers will design their products to support this phenomena?. Probably not. If founders say yes to this question then probably they will be lieing.

Check this JVC camcorder out. Designed for one touch upload to YouTube. I would say smart move from JVC’s marketing team. Riding on a already successfull product can potentially go a long way.

For all those YouTube video producers this might be the perfect device. Even though I have not seen or used this one, but looks like a good one.

Blogged with MessageDance using iPhone | Reply On Twitter

Atherton man trades his 2 mercedes car for scooter,smart car & hybrid car

Posted by Rajesh Shetty on August 06, 2008

It’s interesting how people go full throttle on “change” in life.

Blogged with MessageDance using iPhone | Reply On Twitter

Apple’s new push notification service API

Posted by Rajesh Shetty on July 31, 2008

http://www.crunchgear.com/2008/07/31/apple-hands-out-push-notification-service-api-to-developers-background-apps-ftw/

This should open up interesting transaction model for application developers. But this is a two-edged sword, cuts both ways. On one end applications can provide more real time information , to the point notifications which can serve like a virtual assistant to iPhone users. On the other end if not used right this can potentially be a spam/annoyance.

I’m sure API will mandate developers to provides user options to decide if device owners want application developers to push notifications or not. Depending on how important the app is users can drive the destiny of this interesting feature.

Blogged with MessageDance | Reply On Twitter

AOL Radio is one of the best apps on iPhone appstore

Posted by Rajesh Shetty on July 24, 2008

Truley satisfies the basic need of listening to diversed music from around the world. The best part is surprise element of discovering new music. Sometimes “surprise me!” is better than “I’m looking for…” Sent from my iPhone

Blogged with MessageDance using iPhone | Reply On Twitter

How to avoid SSL verification on Ruby SOAP calls

Posted by Rajesh Shetty on July 22, 2008

Problem


You will get following error when you are making SOAP calls to external web service using ruby’s SOAP library 

OpenSSL::SSL::SSLError: certificate verify failed 

code might look something like this

driverSOAP::RPC::Driver.new(“https://<your soap end point>”, “<soap URN>”)

driver.add_method(‘<method>’,“name”, “password”)

…..


Solution

 


Just add following line to your code (right before you make a call to end point )

driver.options[“protocol.http.ssl_config.verify_mode” ] = nil 


Above line turns off the SSL verification while making soap calls.


 



Blogged with MessageDance using Gmail | Reply On Twitter