<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Crazy Ideas</title>
	<atom:link href="http://sinister2010.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sinister2010.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Fri, 25 Nov 2011 07:10:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sinister2010.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Crazy Ideas</title>
		<link>http://sinister2010.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sinister2010.wordpress.com/osd.xml" title="Crazy Ideas" />
	<atom:link rel='hub' href='http://sinister2010.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Reading eBooks on Andoid</title>
		<link>http://sinister2010.wordpress.com/2011/11/25/reading-ebooks-on-andoid/</link>
		<comments>http://sinister2010.wordpress.com/2011/11/25/reading-ebooks-on-andoid/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 06:44:03 +0000</pubDate>
		<dc:creator>sinister</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[amazon kindle]]></category>
		<category><![CDATA[andoid app]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[azw]]></category>
		<category><![CDATA[eBook reading]]></category>
		<category><![CDATA[kindle on android]]></category>
		<category><![CDATA[mobi]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[reading apps on android]]></category>

		<guid isPermaLink="false">http://sinister2010.wordpress.com/?p=81</guid>
		<description><![CDATA[Yesterday, I was trying to read a book on my Android phone. But reading on native pdf reader was rather painful. So I browsed through the android market and found &#8220;Amazon Kindle&#8221; app on android. Reading on the kindle app was a complete different experience. We can&#8217;t compare reading on this app with the quality <a href="http://sinister2010.wordpress.com/2011/11/25/reading-ebooks-on-andoid/" class="excerpt-more-link">[&#8230;]</a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sinister2010.wordpress.com&amp;blog=11585653&amp;post=81&amp;subd=sinister2010&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I was trying to read a book on my Android phone. But reading on native pdf reader was rather painful. So I browsed through the android market and found &#8220;Amazon Kindle&#8221; app on android. Reading on the kindle app was a complete different experience. We can&#8217;t compare reading on this app with the quality on Kindle device but still its comparable. </p>
<p>Now the next challenge was to convert the pdf I am interested in to the format supported by Kindle app(.mobi or .azw). So found this online <a href="http://www.convertfiles.com/convert/document/PDF-to-MOBI.html" title="Converter" target="_blank">converter</a>. It will convert .pdf to .mobi . Move this .mobi into your /kindle directory and you will found the book in your Kindle bookshelf.<br />
Happy reading !!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sinister2010.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sinister2010.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sinister2010.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sinister2010.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sinister2010.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sinister2010.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sinister2010.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sinister2010.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sinister2010.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sinister2010.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sinister2010.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sinister2010.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sinister2010.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sinister2010.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sinister2010.wordpress.com&amp;blog=11585653&amp;post=81&amp;subd=sinister2010&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sinister2010.wordpress.com/2011/11/25/reading-ebooks-on-andoid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d534521605d4fd362af259ac0934afa9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sinister</media:title>
		</media:content>
	</item>
		<item>
		<title>Drawing program using javascript</title>
		<link>http://sinister2010.wordpress.com/2011/11/03/zwibbler/</link>
		<comments>http://sinister2010.wordpress.com/2011/11/03/zwibbler/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 03:47:00 +0000</pubDate>
		<dc:creator>sinister</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[draw js]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[rotate javascript]]></category>

		<guid isPermaLink="false">http://sinister2010.wordpress.com/?p=71</guid>
		<description><![CDATA[I was just going through a blog entry and found this pretty interesting program. It allows you to create drawings and then rotate it according to your need, save them and much more. You can check out &#8211; Zwibbler here<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sinister2010.wordpress.com&amp;blog=11585653&amp;post=71&amp;subd=sinister2010&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was just going through a blog entry and found this pretty interesting program. It allows you to create drawings and then rotate it according to your need, save them and much more. You can check out &#8211; <a title="Zwibbler" href="http://zwibbler.com/" target="_blank">Zwibbler</a> here</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sinister2010.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sinister2010.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sinister2010.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sinister2010.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sinister2010.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sinister2010.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sinister2010.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sinister2010.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sinister2010.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sinister2010.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sinister2010.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sinister2010.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sinister2010.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sinister2010.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sinister2010.wordpress.com&amp;blog=11585653&amp;post=71&amp;subd=sinister2010&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sinister2010.wordpress.com/2011/11/03/zwibbler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d534521605d4fd362af259ac0934afa9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sinister</media:title>
		</media:content>
	</item>
		<item>
		<title>Tutorial to create Java Web Start (Jnlp) file</title>
		<link>http://sinister2010.wordpress.com/2010/12/24/tutorial-to-create-java-web-start-jnlp-file/</link>
		<comments>http://sinister2010.wordpress.com/2010/12/24/tutorial-to-create-java-web-start-jnlp-file/#comments</comments>
		<pubDate>Fri, 24 Dec 2010 06:27:24 +0000</pubDate>
		<dc:creator>sinister</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jnlp]]></category>
		<category><![CDATA[webstart]]></category>

		<guid isPermaLink="false">http://sinister2010.wordpress.com/?p=66</guid>
		<description><![CDATA[Java Web Start is a mechanism for program delivery through a standard Web server. Typically initiated through the browser, these programs are deployed to the client and executed outside the scope of the browser. Once deployed, the programs do not need to be downloaded again, and they can automatically download updates on startup without requiring <a href="http://sinister2010.wordpress.com/2010/12/24/tutorial-to-create-java-web-start-jnlp-file/" class="excerpt-more-link">[&#8230;]</a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sinister2010.wordpress.com&amp;blog=11585653&amp;post=66&amp;subd=sinister2010&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Java Web Start is a mechanism for program delivery through a standard Web server. Typically initiated through the browser, these programs are deployed to the client and executed outside the scope of the browser. Once deployed, the programs do not need to be downloaded again, and they can automatically download updates on startup without requiring the user to go through the whole installation process again.<a href="http://www.mkyong.com/java/java-web-start-jnlp-tutorial-unofficial-guide/">Here is an interesting link to create jnlp files </a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sinister2010.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sinister2010.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sinister2010.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sinister2010.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sinister2010.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sinister2010.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sinister2010.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sinister2010.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sinister2010.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sinister2010.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sinister2010.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sinister2010.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sinister2010.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sinister2010.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sinister2010.wordpress.com&amp;blog=11585653&amp;post=66&amp;subd=sinister2010&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sinister2010.wordpress.com/2010/12/24/tutorial-to-create-java-web-start-jnlp-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d534521605d4fd362af259ac0934afa9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sinister</media:title>
		</media:content>
	</item>
		<item>
		<title>CXF-RS on google app engine exposed(3)</title>
		<link>http://sinister2010.wordpress.com/2010/01/22/cxf-rs-on-google-app-engine-exposed3/</link>
		<comments>http://sinister2010.wordpress.com/2010/01/22/cxf-rs-on-google-app-engine-exposed3/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 07:18:18 +0000</pubDate>
		<dc:creator>sinister</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[apache cxf]]></category>
		<category><![CDATA[google app engine]]></category>
		<category><![CDATA[jaxb]]></category>
		<category><![CDATA[jre white list]]></category>

		<guid isPermaLink="false">http://sinister2010.wordpress.com/?p=37</guid>
		<description><![CDATA[This is the final and most important post in the series which will make the CXF-RS app running on GAE. Till now we have seen What are the issues of running CXF on GAE ? How to run JAXB on GAE ? In this post we will see how will we run make changes in <a href="http://sinister2010.wordpress.com/2010/01/22/cxf-rs-on-google-app-engine-exposed3/" class="excerpt-more-link">[&#8230;]</a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sinister2010.wordpress.com&amp;blog=11585653&amp;post=37&amp;subd=sinister2010&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is the final and most important post in the series which will make the CXF-RS app running on GAE.</p>
<p>Till now we have seen</p>
<ol>
<li><a href="http://sinister2010.wordpress.com/2010/01/22/cxf-rs-on-google-app-engine-exposed/" target="_blank">What are the issues of running CXF on GAE ?<br />
</a></li>
<li><a href="http://sinister2010.wordpress.com/2010/01/22/cxf-rs-on-google-app-engine-exposed2/" target="_blank">How to run JAXB on GAE ?</a></li>
</ol>
<p>In this post we will see how will we run make changes in Apache CXF source so that everything starts working.</p>
<p>The ideas and changes are influenced by one of the apache CXF developer <a href="http://www.dankulp.com/blog/?p=173" target="_self">Daniel Kulp</a> who gave some interesting insights about CXF.</p>
<p><strong><span style="text-decoration:underline;">Issues:</span></strong></p>
<p><strong> </strong></p>
<ol>
<li> Writing to file should be disabled as it is restricted by GAE</li>
<li> GAE doesn’t allow to spawn new threads</li>
<li> Changes in JAXB source should be integrated with CXF</li>
</ol>
<p>Changes are done keeping in mind that</p>
<ul>
<li>We are interested only in JAX-RS</li>
<li>WSDL is not required</li>
</ul>
<p>CXF has “workqueues” using threads which provides support for one-way operations. But as in JAX-RS we hardly have any one way operations so we need not consider about “workqueues.</p>
<p>For attachments and message logging, a special output stream is used such that once a threshold is reached, it starts saving to temporary files on the file system.  As on GAE we can’t create new files. So we have two options</p>
<ul>
<li>To save all that data which was earlier written by CXF in a temp file to GAE datastore.</li>
<li>We can just proceed keeping them in memory.</li>
</ul>
<p>But the, the maximum message size GAE allows in or out is 10MB(which also sometimes cause a problem as some kind of “Server Error” starts coming  on sending a request of ≥1MB and so we are only able to send a request of ≤1MB successfully ) Thus, the message sizes are small enough to keep them in memory itself. So we will proceed by disabling this feature of saving to temp files.</p>
<p>We also have to reflect the changes in JAXB (i.e. to add jaxb.jar) and change the classes to use the new packages(changed names) from jaxb.jar instead of jaxb-impl*.jar and jaxb-api*.jar</p>
<p><strong><span style="text-decoration:underline;">Changes:</span></strong></p>
<p>1.  In  org.apache.cxf.io.CachedOutputStream.java</p>
<p>Comment out regions using <em>FleOutputStream</em> , <em>boolean inmem</em> and <em>threshold </em></p>
<p>After commenting out these things CXF won’t make any temporary files for storing logs or attachments.</p>
<p style="text-align:left;">2.  Change the package name from javax.xml.bind.* to ae.javax.xml.bind.* in the following files :-</p>
<ul>
<li>org.apache.cxf.jaxrs.provider.XSLTJaxbProvider.java</li>
<li>org.apache.cxf.ws.policy.builder.jaxb.JaxbAssertionBuilder.java
<ul>
<li>org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder.java</li>
<li>org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder.java</li>
<li>org.apache.cxf.transport.AbstractMultiplexDestination.java</li>
<li>org.apache.cxf.jaxrs.provider. AbstractJAXBProvider.java</li>
</ul>
</li>
</ul>
<p>3. Disable saving to file in</p>
<ul>
<li>org.apache.cxf.interceptor.LoggingInInterceptor.java by commenting out</li>
</ul>
<blockquote><p><em>if (bos.getTempFile() != null) {</em></p>
<p><em> //large thing on disk&#8230;</em></p>
<p><em> buffer.getMessage().append(&#8220;\nMessage (saved to tmp file):\n&#8221;);</em></p>
<p><em>buffer.getMessage().append(&#8220;Filename: &#8221; + bos.getTempFile().getAbsolutePath() + &#8220;\n&#8221;);</em></p>
<p><em> }</em></p></blockquote>
<ul>
<li> org.apache.cxf.interceptor.LoggingOutInterceptor.java by commenting out</li>
</ul>
<blockquote><p><strong><em>if</em></strong><em> (cos.<span style="text-decoration:underline;">getTempFile</span>() == <strong>null</strong>) {</em></p>
<p><em> //buffer.append(&#8220;<span style="text-decoration:underline;">Outbound</span> Message:\n&#8221;);</em></p>
<p><em> <strong>if</strong> (cos.size() &gt; limit) {</em></p>
<p><em>buffer.getMessage().append(&#8220;(message truncated to &#8221; + limit + &#8221; bytes)\n&#8221;);</em></p>
<p><em> }</em></p>
<p><em> }<strong>else</strong> {</em></p>
<p><em>buffer.getMessage().append(&#8220;Outbound Message (saved to tmp file):\n&#8221;);</em></p>
<p><em>buffer.getMessage().append(&#8220;Filename: &#8221; + cos.<span style="text-decoration:underline;">getTempFile</span>().getAbsolutePath() + &#8220;\n&#8221;);</em></p>
<p><em> <strong>if</strong> (cos.size() &gt; limit) {</em></p>
<p><em>buffer.getMessage().append(&#8220;(message truncated to &#8221; + limit + &#8221; bytes)\n&#8221;);</em></p>
<p><em> }</em></p>
<p><em> }</em></p></blockquote>
<p>4. In the file org.apache.cxf.jaxrs.provider.JAXBElementProvider.java</p>
<p>Change the package name from javax.xml.bind.* to ae.javax.xml.bind.*</p>
<p>Change the function as</p>
<blockquote><p><strong><em>protected</em></strong><em> Object unmarshalFromReader(Unmarshaller unmarshaller, XMLStreamReader reader, MediaType mt) <strong>throws</strong> JAXBException {</em></p>
<p><strong><em>return</em></strong><em> unmarshaller.unmarshal ((ae.javax.xml.stream.XMLStreamReader)reader);</em></p>
<p><em>}</em></p>
<p><em> </em></p>
<p><strong><em>public</em></strong><em> Object readFrom(Class&lt;Object&gt; type, Type genericType, Annotation[] anns, MediaType mt, </em></p>
<p><em> MultivaluedMap&lt;String, String&gt; headers, InputStream is) </em></p>
<p><em> <strong>throws</strong> IOException {</em></p>
<p><em> <strong>try</strong> {</em></p>
<p><em> Class&lt;?&gt; theType = getActualType(type, genericType, anns);</em></p>
<p><em> Unmarshaller unmarshaller = (Unmarshaller)createUnmarshaller(theType, genericType);</em></p>
<p><em>……..</em></p>
<p><em>……..</em></p>
<p><em>……..</em></p></blockquote>
<p>The changes done are normal typecasting of reader and unmarshaller.</p>
<p>With these changes I got my CXF-RS app running on GAE.</p>
<p>A sample CXF-RS app on GAE can be viewed on <a href="http://cxfdataservices.appspot.com/"> appengine </a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sinister2010.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sinister2010.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sinister2010.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sinister2010.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sinister2010.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sinister2010.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sinister2010.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sinister2010.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sinister2010.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sinister2010.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sinister2010.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sinister2010.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sinister2010.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sinister2010.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sinister2010.wordpress.com&amp;blog=11585653&amp;post=37&amp;subd=sinister2010&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sinister2010.wordpress.com/2010/01/22/cxf-rs-on-google-app-engine-exposed3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d534521605d4fd362af259ac0934afa9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sinister</media:title>
		</media:content>
	</item>
		<item>
		<title>CXF-RS on google app engine exposed(2)</title>
		<link>http://sinister2010.wordpress.com/2010/01/22/cxf-rs-on-google-app-engine-exposed2/</link>
		<comments>http://sinister2010.wordpress.com/2010/01/22/cxf-rs-on-google-app-engine-exposed2/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 07:00:45 +0000</pubDate>
		<dc:creator>sinister</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[apache cxf]]></category>
		<category><![CDATA[google app engine]]></category>
		<category><![CDATA[jaxb]]></category>
		<category><![CDATA[jre white list]]></category>
		<category><![CDATA[progress software]]></category>

		<guid isPermaLink="false">http://sinister2010.wordpress.com/?p=15</guid>
		<description><![CDATA[In this post I will explain the changes you have to do to get JAXB running on GAE. This has been discussed in one of the Google appengine developer forums and I think now GAE developers have included JAXB in  JRE whitelist too. But below I am going to tell the changes I have done <a href="http://sinister2010.wordpress.com/2010/01/22/cxf-rs-on-google-app-engine-exposed2/" class="excerpt-more-link">[&#8230;]</a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sinister2010.wordpress.com&amp;blog=11585653&amp;post=15&amp;subd=sinister2010&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this post I will explain the changes you have to do to get JAXB running on GAE.</p>
<p>This has been discussed in one of the Google appengine developer forums and I think now GAE developers have included JAXB in  JRE whitelist too. But below I am going to tell the changes I have done to get my JAXB running on GAE (though it is not required for most of you as now there&#8217;s is a support already but for the interested ones below are the changes I had done)</p>
<p><strong><span style="text-decoration:underline;">Issues :</span></strong></p>
<ol>
<li>
<address><em>FileOutputStream</em> in com.sun.xml.bind.v2.runtime.MarshallerImpl and javax.xml.bind.helpers.AbstractMarshallerImpl</address>
</li>
<li>
<address>use of <em>AWT</em> in com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl</address>
</li>
<li>
<address><em>java.util.logging.ConsoleHandler</em>, which is also not supported by Google App</address>
</li>
</ol>
<p>Engine&#8217;s Java runtime environment, but used in <em>javax.xml.bind.ContextFinder</em></p>
<p><strong><span style="text-decoration:underline;">Steps :</span></strong></p>
<ol>
<li>Download JAXB source code from</li>
</ol>
<p><a href="https://jaxb.dev.java.net/2.1.11/jaxb-ri-2_1_11.src.zip">https://jaxb.dev.java.net/2.1.11/jaxb-ri-2_1_11.src.zip</a></p>
<p>Put it in an Eclipse project at ~/workspace/jaxb-ri-2_1_11</p>
<p>2.    Build the runtime as we need to do this so that generated source gets generated.</p>
<p>3.    In <em>com.sun.xml.bind.v2.model.impl.ReferencePropertyInfoImpl.java</em></p>
<p>Change</p>
<p><strong>boolean</strong> isRequired(XmlElementRef ref)</p>
<p>to always return true.</p>
<p>As it deals with something related to compatibility issues in 2.2 API.</p>
<p>The same issue stops <em>xjc</em> subproject from building, but we don&#8217;t care about that.</p>
<p>To avoid that I changed the compile task in <em>build.xml</em> to read:</p>
<blockquote><p>&lt;target</p>
<p>depends=&#8221;init-standalone&#8221;</p>
<p>description=&#8221;compile runtime, and xjc sub-projects&#8221;&gt;</p>
<p>&lt;ant dir=&#8221;apgen&#8221;               target=&#8221;compile&#8221; /&gt;</p>
<p>&lt;ant dir=&#8221;runtime&#8221;             target=&#8221;compile&#8221; /&gt;</p>
<p>&lt;ant dir=&#8221;runtime-fi&#8221;          target=&#8221;compile&#8221; /&gt;</p>
<p>&lt;ant dir=&#8221;runtime-staxex&#8221;      target=&#8221;compile&#8221; /&gt;</p>
<p>&lt;ant dir=&#8221;runtime-deprecated&#8221;  target=&#8221;compile&#8221; /&gt;</p>
<p>&lt;!&#8211;    &lt;ant dir=&#8221;xjc&#8221;                 target=&#8221;compile&#8221; /&gt;</p>
<p>&lt;ant dir=&#8221;tools&#8221;               target=&#8221;compile&#8221; /&gt; &#8211;&gt;</p>
<p>&lt;/target&gt;</p></blockquote>
<p>4.    Copy <em>runtime/src</em> and <em>runtime/build/src</em> to your GAE project [here called <em>myproj</em>] src dir</p>
<p>runtime/src$ cp com /home/dev/workspace/myproj/src/ -rR</p>
<p>runtime/build/src$ cp * /home/dev/workspace/myproj/src/ -rR</p>
<p><em>5.</em> Find <em>jaxb-api-src.zip</em> in <em>tools/lib/redist</em>. It contains <em>javax.xml.bind </em></p>
<p>Unzip that, and put it your <em>myproject src</em> dir</p>
<p>6.    Find jsr173_1.0_src.jar; it is in tools/lib/src.  This contains <em>javax.xml.stream.XMLStreamWriter</em> and <em>XMLStreamException </em>which we need but aren&#8217;t whitelisted.</p>
<p>Extract them and copy to myproject.</p>
<p>src tree should now include</p>
<p><em> /com/sun/xml/bind</em></p>
<p><em> /javax/xml/bind</em></p>
<p><em> /javax/xml/stream</em></p>
<p><em> </em></p>
<p>7.    Add the missing jars</p>
<p><em>cp tools/lib/redist/jsr173_1.0_api.jar</em></p>
<p><em>/home/dev/workspace/myproj/war/WEB-INF/lib/</em></p>
<p><em> </em></p>
<p><em> cp tools/lib/redist/activation.jar /home/dev/workspace/myproj/war/WEB-INF/lib/</em></p>
<p><em> </em></p>
<p><em> cp tools/lib/rebundle/runtime2/*.jar /home/dev/workspace/myproj/war/WEB-INF/lib/</em></p>
<p>8.    Now fix the major issues :-</p>
<ul>
<li>com.sun.xml.bind.v2.runtime.MarshallerImpl</li>
</ul>
<p>Comment out the <em>FileOutputStream</em> part as we won’t have file for marshalling in our case</p>
<ul>
<li>javax.xml.bind.helpers.AbstractMarshallerImpl</li>
</ul>
<p>Comment out</p>
<p><strong>void</strong> marshal(Object jaxbElement, File output)</p>
<p>as we won’t be dealing with marshalling of files and also its not supported J</p>
<ul>
<li>com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl.java</li>
</ul>
<p>As <em>AWT</em> is not supported so we have to comment out</p>
<p>PcdataImpl&lt;Image&gt;(Image.class, createXS(&#8220;base64Binary&#8221;))</p>
<p>convertToBufferedImage(Image image)</p>
<p>Base64Data print(Image v)</p>
<ul>
<li>ae.javax.xml.bind.ContextFinder.java</li>
</ul>
<p>As <em>java.util.logging.ConsoleHandler</em> is not supported comment out the <em>logger</em> part</p>
<p>9.    Exclude the classes  from validation (<em>right click &gt; Google &gt; App Engine Settings &gt;App Engine &gt; Validation</em>).  These are</p>
<ul>
<li><em> com.sun.xml.bind.v2.runtime.property.SingleMapNodeProperty</em></li>
</ul>
<ul>
<li><em> com.sun.xml.bind.v2.util.TypeCast</em></li>
</ul>
<p>Interestingly, the validator wonn&#8217;t complain about javax.xml.bind, now that it is in our source tree. And it’s enough for the app to start in the Jetty simulation environment.</p>
<p>But it will try to use the JAXB in Java 6, not the ones in my source tree.  So ename:</p>
<ul>
<li><em>com.sun.xml.bind &#8211;&gt; ae.com.sun.xml.bind</em></li>
</ul>
<ul>
<li><em>javax.xml.bind   &#8211;&gt; ae.javax.xml.bind</em></li>
</ul>
<ul>
<li><em>javax.xml.stream   &#8211;&gt; ae.javax.xml.stream</em></li>
</ul>
<p><strong>For JAXBContext: <em>ae.com.sun.xml.bind.v2.runtime.JAXBContextImpl</em></strong></p>
<p><strong>For marshaller: <em>ae.com.sun.xml.bind.v2.runtime.MarshallerImpl</em></strong></p>
<p>10. Finally in <em>ae.com.sun.xml.bind.v2.runtime.reflect.opt.Injector.java</em></p>
<p>Comment out</p>
<blockquote><p><em>AccessController.doPrivileged(new PrivilegedAction&lt;Void&gt;() {</em></p>
<p><em> public Void run() {</em></p>
<p><em> defineClass.setAccessible(true);</em></p>
<p><em> resolveClass.setAccessible(true);</em></p>
<p><em> return null;</em></p>
<p><em> }</em></p>
<p><em> });</em></p></blockquote>
<p>As it will cause create some security related issues.</p>
<p>This will make JAXB running on GAE.</p>
<p>Reference:</p>
<p><a href="http://code.google.com/p/googleappengine/issues/detail?id=1267"><em>http://code.google.com/p/googleappengine/issues/detail?id=1267</em></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sinister2010.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sinister2010.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sinister2010.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sinister2010.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sinister2010.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sinister2010.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sinister2010.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sinister2010.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sinister2010.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sinister2010.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sinister2010.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sinister2010.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sinister2010.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sinister2010.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sinister2010.wordpress.com&amp;blog=11585653&amp;post=15&amp;subd=sinister2010&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sinister2010.wordpress.com/2010/01/22/cxf-rs-on-google-app-engine-exposed2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d534521605d4fd362af259ac0934afa9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sinister</media:title>
		</media:content>
	</item>
		<item>
		<title>CXF-RS on google app engine exposed</title>
		<link>http://sinister2010.wordpress.com/2010/01/22/cxf-rs-on-google-app-engine-exposed/</link>
		<comments>http://sinister2010.wordpress.com/2010/01/22/cxf-rs-on-google-app-engine-exposed/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 06:29:55 +0000</pubDate>
		<dc:creator>sinister</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[apache cxf]]></category>
		<category><![CDATA[google app engine]]></category>
		<category><![CDATA[jaxb]]></category>
		<category><![CDATA[jre white list]]></category>
		<category><![CDATA[progress software]]></category>

		<guid isPermaLink="false">http://sinister2010.wordpress.com/?p=3</guid>
		<description><![CDATA[During summer intern at progress software, I started working on a project through which I came across various open source platforms like Google app engine , Apache-CXF etc. etc. At the end of the project, I with help of my mentors Prasad Kumbhare and Mahesh Sankaran were able to host CXF-RS app on GAE. Basically <a href="http://sinister2010.wordpress.com/2010/01/22/cxf-rs-on-google-app-engine-exposed/" class="excerpt-more-link">[&#8230;]</a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sinister2010.wordpress.com&amp;blog=11585653&amp;post=3&amp;subd=sinister2010&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>During summer intern at <a href="http://web.progress.com/en-gb/index.html" target="_blank">progress software</a>, I started working on a project through which I came across various open source platforms like Google app engine , Apache-CXF etc. etc.</p>
<p>At the end of the project, I with help of my mentors <a href="http://in.linkedin.com/pub/prasad-kumbhare/6/105/188" target="_blank">Prasad Kumbhare</a> and <a href="http://in.linkedin.com/pub/mahesh-sankaran/5/40a/a62" target="_blank">Mahesh Sankaran</a> were able to host CXF-RS app on GAE.</p>
<p>Basically what  we were interested in doing is to provide <strong>support for CXF Restful applications </strong>on GAE</p>
<p>After browsing through web we made our requirements clear, we understood that</p>
<blockquote><p>With the launch of Google App Engine, web applications are now very easy to build, easy to maintain, and easy to scale as your traffic and data storage needs grow. With App Engine, there are no servers to maintain: You just upload your application, and it&#8217;s ready to serve your users.</p></blockquote>
<p>CXF is one of the most popular web services framework used currently to develop web services. So a lot of people today are asking for CXF support on GAE. At present, GAE does not support CXF and our goal is to fulfil this requirement.</p>
<p><strong>CXF-RS Support on GAE</strong></p>
<p>Following issues were identified with CXF that prevent it to run on GAE:</p>
<p>1.      CXF and JAXB use file IO at some places for logging purpose which is restricted on GAE</p>
<p>2.      CXF spawns threads for one way operations. Threads are not supported on GAE.</p>
<p>3.      CXF uses JAXB for xml processing. Changes in JAXB source should be integrated with CXF</p>
<p>To use CXF services on GAE, follow the steps below:</p>
<p>1.    Create   GAE project using eclipse plug-in provided by Google.</p>
<p>2.    Add following jars to your class path and also copy them to your projects WEB-INF/lib folder.</p>
<ol>
<li>CXF Jars from &lt;CSF_ROOT&gt;\lib folder.</li>
<li>Modified CXf.jar and jaxb.jar</li>
</ol>
<p>3.    Modify web.xml to use CXF-Servlet for handling web requests.</p>
<p>4.    Copy CXF-Servelt.xml from CXF Installation to WEB-INF folder.</p>
<p>So after identifying the issues we first have to make sure that we resolve these issues to get our Apache CXF-RS app running on GAE . In future posts I will tell about the changes I had done to get it running.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sinister2010.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sinister2010.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sinister2010.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sinister2010.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sinister2010.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sinister2010.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sinister2010.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sinister2010.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sinister2010.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sinister2010.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sinister2010.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sinister2010.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sinister2010.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sinister2010.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sinister2010.wordpress.com&amp;blog=11585653&amp;post=3&amp;subd=sinister2010&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sinister2010.wordpress.com/2010/01/22/cxf-rs-on-google-app-engine-exposed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d534521605d4fd362af259ac0934afa9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sinister</media:title>
		</media:content>
	</item>
	</channel>
</rss>
