<?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/"
	>

<channel>
	<title>Pakzilla &#187; Google App Engine</title>
	<atom:link href="http://www.pakzilla.com/tag/google-app-engine/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pakzilla.com</link>
	<description>A blog on Programming, Web and Technology</description>
	<lastBuildDate>Sat, 04 Feb 2012 22:25:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>New Google App Engine SDK 1.4.0 released with major improvements</title>
		<link>http://www.pakzilla.com/2010/12/03/new-google-app-engine-sdk-1-4-0-released-with-major-improvements/</link>
		<comments>http://www.pakzilla.com/2010/12/03/new-google-app-engine-sdk-1-4-0-released-with-major-improvements/#comments</comments>
		<pubDate>Thu, 02 Dec 2010 21:38:46 +0000</pubDate>
		<dc:creator>Tahir Akram</dc:creator>
				<category><![CDATA[Google App Engine]]></category>

		<guid isPermaLink="false">http://www.pakzilla.com/?p=1308</guid>
		<description><![CDATA[Google App Engine team has rolled out a major release for this year. In release of 1.4.0 they have done a lot of improvements and increased limits. I am very happy that they have increased the time limit of executing cron job (background task) from 30 seconds to 10 minute. For high demanding apps, its [...]
Related posts:<ol>
<li><a href='http://www.pakzilla.com/2009/10/03/how-to-avoid-deadlineexceededexception-in-google-app-engine/' rel='bookmark' title='How to avoid DeadlineExceededException in Google App Engine'>How to avoid DeadlineExceededException in Google App Engine</a></li>
<li><a href='http://www.pakzilla.com/2009/04/09/java-in-google-app-engine-whats-new-for-developers/' rel='bookmark' title='Java in Google App Engine, what&#8217;s new for developers'>Java in Google App Engine, what&#8217;s new for developers</a></li>
<li><a href='http://www.pakzilla.com/2009/12/13/tutorial-jpa-on-google-app-engine/' rel='bookmark' title='Tutorial: JPA on Google App Engine'>Tutorial: JPA on Google App Engine</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Google App Engine team has rolled out a major release for this year. In release of 1.4.0 they have done a lot of improvements and increased limits. I am very happy that they have increased the time limit of executing cron job (background task) from 30 seconds to 10 minute.</p>
<p>For high demanding apps, its also very to good to keep their site ready to server quickly. Not a bad deal of paying $9 a month about it.</p>
<p>The enhancements and according to the announcement on their <a href="http://groups.google.com/group/google-appengine/browse_thread/thread/0f90ef8dda3b8400" target="_blank">group</a>:</p>
<ul>
<li>The Always On feature allows applications to pay and keep 3 instances of their application always running, which can significantly reduce application latency.</li>
<li>Developers can now enable Warmup Requests. By specifying  a handler in an app&#8217;s appengine-web.xml, App Engine will attempt to to send a Warmup Request to initialize new instances before a user interacts with it. This can reduce the latency an end-user sees for initializing your application.</li>
<li>The Channel API is now available for all users.</li>
<li>Task Queue has been officially released, and is no longer an experimental feature. The API import paths that use &#8216;labs&#8217; have been deprecated. Task queue storage will count towards an application&#8217;s overall storage quota, and will thus be charged for.</li>
<li>The deadline for Task Queue and Cron requests has been raised to 10 minutes. Datastore and API deadlines within those requests remain unchanged.</li>
<li>For the Task Queue, developers can specify task retry-parameters in their queue.xml.</li>
<li>Metadata Queries on the datastore for datastore kinds, namespaces, and entity properties are available.</li>
<li>URL Fetch allowed response size has been increased, up to 32 MB. Request size is still limited to 1 MB.</li>
<li>The Admin Console Blacklist page lists the top blacklist rejected visitors.</li>
<li>The automatic image thumbnailing service supports arbitrary crop sizes up to 1600px.</li>
<li>Overall average instance latency in the Admin Console is now a weighted average over QPS per instance.</li>
<li>Added a low-level AysncDatastoreService for making calls to the datastore asynchronously.</li>
<li>Added a getBodyAsBytes() method to QueueStateInfo.TaskStateInfo, this returns the body of the task state as a pure byte-string.</li>
<li>The whitelist has been updated to include all classes from javax.xml.soap.</li>
<li>Fixed an <a href="http://code.google.com/p/googleappengine/issues/detail?id=1623" target="_blank">issue</a> sending email to multiple recipients.</li>
</ul>
<p style="text-align: center;"><a href="../wp-content/upload/google_appengine_140.jpg"><a href="http://www.pakzilla.com/wp-content/upload/google_appengine_1401.jpg"><img class="alignnone size-full wp-image-1316" title="google_appengine_140" src="http://www.pakzilla.com/wp-content/upload/google_appengine_1401.jpg" alt="" width="592" height="388" /></a><br />
</a></p>
<p>You can download GAE 1.4.0 from <a href="http://code.google.com/p/googleappengine/downloads/list" target="_blank">Google Code</a>.</p>
<p>Related posts:<ol>
<li><a href='http://www.pakzilla.com/2009/10/03/how-to-avoid-deadlineexceededexception-in-google-app-engine/' rel='bookmark' title='How to avoid DeadlineExceededException in Google App Engine'>How to avoid DeadlineExceededException in Google App Engine</a></li>
<li><a href='http://www.pakzilla.com/2009/04/09/java-in-google-app-engine-whats-new-for-developers/' rel='bookmark' title='Java in Google App Engine, what&#8217;s new for developers'>Java in Google App Engine, what&#8217;s new for developers</a></li>
<li><a href='http://www.pakzilla.com/2009/12/13/tutorial-jpa-on-google-app-engine/' rel='bookmark' title='Tutorial: JPA on Google App Engine'>Tutorial: JPA on Google App Engine</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pakzilla.com/2010/12/03/new-google-app-engine-sdk-1-4-0-released-with-major-improvements/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to use and retain Twitter4J OAuth access token</title>
		<link>http://www.pakzilla.com/2010/03/01/how-to-use-and-retain-twitter4j-oauth-access-token/</link>
		<comments>http://www.pakzilla.com/2010/03/01/how-to-use-and-retain-twitter4j-oauth-access-token/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 20:41:34 +0000</pubDate>
		<dc:creator>Tahir Akram</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Twitter API]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Twitter4J]]></category>

		<guid isPermaLink="false">http://www.pakzilla.com/?p=831</guid>
		<description><![CDATA[I  was stuck in a problem that how to re use access token, once user has authenticated by Twitter (on call back URL). I got it working. There was problem in my understanding about request token vs access token. When user first time comes on call backed URL. I take request token and token secret [...]
Related posts:<ol>
<li><a href='http://www.pakzilla.com/2009/10/03/tutorial-java-based-twitter-app-on-google-app-engine/' rel='bookmark' title='Tutorial: Java based Twitter App on Google App Engine'>Tutorial: Java based Twitter App on Google App Engine</a></li>
<li><a href='http://www.pakzilla.com/2009/11/23/how-to-register-an-app-with-twitter/' rel='bookmark' title='How to register an app with Twitter'>How to register an app with Twitter</a></li>
<li><a href='http://www.pakzilla.com/2009/10/03/how-to-avoid-deadlineexceededexception-in-google-app-engine/' rel='bookmark' title='How to avoid DeadlineExceededException in Google App Engine'>How to avoid DeadlineExceededException in Google App Engine</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I  was stuck in a problem that how to re use access token, once user has authenticated by Twitter (on call back URL). I got it working. There was problem in my understanding about request token vs access token. When user first time comes on call backed URL. I take request token and token secret from session and prepare the access token. Here the place where I was confused.</p>
<p>Now if user presses the refresh button or you want to get user information again from twitter any where in your application. You need to use the access token and this method<strong> twitter.setOAuthAccessToken(String1, String2)</strong>. Because user has already been authenticated by Twitter. You can save this information in session.</p>
<pre class="brush: java; title: ; notranslate">
HttpSession session = request.getSession();

twitter.setOAuthConsumer(Constants.CONSUMER_KEY,Constants.CONSUMER_SECRET);

if (session.getAttribute(&quot;aToken&quot;) == null){
	// request token
	String token = (String) session.getAttribute(&quot;token&quot;);
	String tokenSecret = (String)session.getAttribute(&quot;tokenSecret&quot;);
	AccessToken accessToken =
		twitter.getOAuthAccessToken(token, tokenSecret);
	twitter.setOAuthAccessToken(accessToken);

	// save the access token, that are different from request token
	session.setAttribute(&quot;aToken&quot;, accessToken.getToken());
	session.setAttribute(&quot;aTokenSecret&quot;, accessToken.getTokenSecret());

}else{
	// use the access token to authenticate user whenever you want
	twitter.setOAuthAccessToken((String)session.getAttribute(&quot;aToken&quot;),
		(String)session.getAttribute(&quot;aTokenSecret&quot;));
}
User user = twitter.verifyCredentials();
</pre>
<p>If you are also developing some app by using Twitter4J API on Google App Engine. Please give feedback on it.</p>
<p><strong>Twitter4J Quick Tutorial:</strong> <a href="http://www.pakzilla.com/2009/10/03/tutorial-java-based-twitter-app-on-google-app-engine/">A quick tutorial on how to develop Twitter app by using Twitter4J on Google App Engine</a>.</p>
<p>Related posts:<ol>
<li><a href='http://www.pakzilla.com/2009/10/03/tutorial-java-based-twitter-app-on-google-app-engine/' rel='bookmark' title='Tutorial: Java based Twitter App on Google App Engine'>Tutorial: Java based Twitter App on Google App Engine</a></li>
<li><a href='http://www.pakzilla.com/2009/11/23/how-to-register-an-app-with-twitter/' rel='bookmark' title='How to register an app with Twitter'>How to register an app with Twitter</a></li>
<li><a href='http://www.pakzilla.com/2009/10/03/how-to-avoid-deadlineexceededexception-in-google-app-engine/' rel='bookmark' title='How to avoid DeadlineExceededException in Google App Engine'>How to avoid DeadlineExceededException in Google App Engine</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pakzilla.com/2010/03/01/how-to-use-and-retain-twitter4j-oauth-access-token/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Useful cheat sheets on Cloud Computing and Google App Engine for Java</title>
		<link>http://www.pakzilla.com/2010/01/12/useful-cheat-sheets-on-cloud-computing-and-google-app-engine-for-java/</link>
		<comments>http://www.pakzilla.com/2010/01/12/useful-cheat-sheets-on-cloud-computing-and-google-app-engine-for-java/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 09:49:13 +0000</pubDate>
		<dc:creator>Tahir Akram</dc:creator>
				<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Cloud Computing]]></category>

		<guid isPermaLink="false">http://www.pakzilla.com/?p=755</guid>
		<description><![CDATA[Just read cheat sheets (Refcard) by Dzone on Cloud Computing and Google App Engine for Java. They contain a very jumped to the point and quick reference on these things. You can read to have a quick overview. Read them here: Cloud Computing Google App Engine for Java [ad#co-2] Related posts: Java in Google App Engine, [...]
Related posts:<ol>
<li><a href='http://www.pakzilla.com/2009/04/09/java-in-google-app-engine-whats-new-for-developers/' rel='bookmark' title='Java in Google App Engine, what&#8217;s new for developers'>Java in Google App Engine, what&#8217;s new for developers</a></li>
<li><a href='http://www.pakzilla.com/2009/12/28/got-two-books-on-google-app-engine-for-java/' rel='bookmark' title='Got two books on Google App Engine for Java'>Got two books on Google App Engine for Java</a></li>
<li><a href='http://www.pakzilla.com/2009/12/07/upgrading-to-google-app-engine-java-sdk-1-2-8/' rel='bookmark' title='Upgrading to Google App Engine Java SDK 1.2.8'>Upgrading to Google App Engine Java SDK 1.2.8</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-705 alignright" title="google_app_engine_java" src="http://www.pakzilla.com/wp-content/upload/google_app_engine_java.png" alt="google_app_engine_java" width="117" height="106" />Just read cheat sheets (<a href="http://refcardz.dzone.com/">Refcard</a>) by Dzone on Cloud Computing and <a href="http://www.pakzilla.com/tag/google-app-engine/">Google App Engine</a> for <a href="http://www.pakzilla.com/tag/java/">Java</a>. They contain a very jumped to the point and quick reference on these things. You can read to have a quick overview.</p>
<p>Read them here:</p>
<ul>
<li><a href="http://library.dzone.com/sites/all/files/refcardz/rc082-010d-cloud-computing.pdf">Cloud Computing</a></li>
<li><a href="http://library.dzone.com/sites/all/files/refcardz/rc079-010d-google-app-engine-4.pdf">Google App Engine for Java</a></li>
</ul>
<p>[ad#co-2]</p>
<p>Related posts:<ol>
<li><a href='http://www.pakzilla.com/2009/04/09/java-in-google-app-engine-whats-new-for-developers/' rel='bookmark' title='Java in Google App Engine, what&#8217;s new for developers'>Java in Google App Engine, what&#8217;s new for developers</a></li>
<li><a href='http://www.pakzilla.com/2009/12/28/got-two-books-on-google-app-engine-for-java/' rel='bookmark' title='Got two books on Google App Engine for Java'>Got two books on Google App Engine for Java</a></li>
<li><a href='http://www.pakzilla.com/2009/12/07/upgrading-to-google-app-engine-java-sdk-1-2-8/' rel='bookmark' title='Upgrading to Google App Engine Java SDK 1.2.8'>Upgrading to Google App Engine Java SDK 1.2.8</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pakzilla.com/2010/01/12/useful-cheat-sheets-on-cloud-computing-and-google-app-engine-for-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Got two books on Google App Engine for Java</title>
		<link>http://www.pakzilla.com/2009/12/28/got-two-books-on-google-app-engine-for-java/</link>
		<comments>http://www.pakzilla.com/2009/12/28/got-two-books-on-google-app-engine-for-java/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 18:52:40 +0000</pubDate>
		<dc:creator>Tahir Akram</dc:creator>
				<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.pakzilla.com/?p=733</guid>
		<description><![CDATA[Recently I got two books on Google App Engine for Java. Programming Google App Engine by Oreilly and Beginning Google App Engine by Apress. There is less material and comprehensive online tutorials available on this. So its better that you read book on it. I started reading Oreilly&#8217;s book. I completed some of the basic [...]
Related posts:<ol>
<li><a href='http://www.pakzilla.com/2010/01/12/useful-cheat-sheets-on-cloud-computing-and-google-app-engine-for-java/' rel='bookmark' title='Useful cheat sheets on Cloud Computing and Google App Engine for Java'>Useful cheat sheets on Cloud Computing and Google App Engine for Java</a></li>
<li><a href='http://www.pakzilla.com/2009/04/09/java-in-google-app-engine-whats-new-for-developers/' rel='bookmark' title='Java in Google App Engine, what&#8217;s new for developers'>Java in Google App Engine, what&#8217;s new for developers</a></li>
<li><a href='http://www.pakzilla.com/2009/12/07/upgrading-to-google-app-engine-java-sdk-1-2-8/' rel='bookmark' title='Upgrading to Google App Engine Java SDK 1.2.8'>Upgrading to Google App Engine Java SDK 1.2.8</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Recently I got two books on Google App Engine for Java. <a href="http://oreilly.com/catalog/9780596522735/">Programming Google App Engine by Oreilly</a> and <a href="http://www.apress.com/book/view/9781430225539">Beginning Google App Engine by Apress</a>. There is less material and comprehensive online tutorials available on this. So its better that you read book on it. I started reading Oreilly&#8217;s book. I completed some of the basic components so quickly by given code examples in the book. Its always a good start on some new technology, if you have books in your pocket.</p>
<p>You guys can share your feedback if you read any book or any material on it.</p>
<table border = '0'>
<tr>
<td>
<img title="Apress_Beginning_Google_App_Engine" src="http://www.pakzilla.com/wp-content/upload/Apress_Beginning_Google_App_Engine.gif" alt="Apress_Beginning_Google_App_Engine" width="125" height="165" /></p>
<td>
<td>
<img title="Oreilly_GoogleAppEngin" src="http://www.pakzilla.com/wp-content/upload/Oreilly_GoogleAppEngin.gif" alt="Oreilly_GoogleAppEngin" width="128" height="166" /></p>
<td>
</tr>
</table>
<p>Related posts:<ol>
<li><a href='http://www.pakzilla.com/2010/01/12/useful-cheat-sheets-on-cloud-computing-and-google-app-engine-for-java/' rel='bookmark' title='Useful cheat sheets on Cloud Computing and Google App Engine for Java'>Useful cheat sheets on Cloud Computing and Google App Engine for Java</a></li>
<li><a href='http://www.pakzilla.com/2009/04/09/java-in-google-app-engine-whats-new-for-developers/' rel='bookmark' title='Java in Google App Engine, what&#8217;s new for developers'>Java in Google App Engine, what&#8217;s new for developers</a></li>
<li><a href='http://www.pakzilla.com/2009/12/07/upgrading-to-google-app-engine-java-sdk-1-2-8/' rel='bookmark' title='Upgrading to Google App Engine Java SDK 1.2.8'>Upgrading to Google App Engine Java SDK 1.2.8</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pakzilla.com/2009/12/28/got-two-books-on-google-app-engine-for-java/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Spoken on Google App Engine at a conference in UET</title>
		<link>http://www.pakzilla.com/2009/12/19/spoken-on-google-app-engine-at-a-conference-in-uet/</link>
		<comments>http://www.pakzilla.com/2009/12/19/spoken-on-google-app-engine-at-a-conference-in-uet/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 13:31:34 +0000</pubDate>
		<dc:creator>Tahir Akram</dc:creator>
				<category><![CDATA[Pakistan]]></category>
		<category><![CDATA[Porgramming]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JPA]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[UET]]></category>

		<guid isPermaLink="false">http://www.pakzilla.com/?p=728</guid>
		<description><![CDATA[Today I had delivered a workshop on Developing Java Web Applications In Google App Engine. This workshop was the part of events of 3rd International Conference on Open Source Systems and Technologies. It was organized by Al-Khawarizmi Institute of Computer Science , University of Engineering and Technology, Lahore. I have presented following slides there. Also [...]
Related posts:<ol>
<li><a href='http://www.pakzilla.com/2009/04/09/java-in-google-app-engine-whats-new-for-developers/' rel='bookmark' title='Java in Google App Engine, what&#8217;s new for developers'>Java in Google App Engine, what&#8217;s new for developers</a></li>
<li><a href='http://www.pakzilla.com/2009/10/03/how-to-avoid-deadlineexceededexception-in-google-app-engine/' rel='bookmark' title='How to avoid DeadlineExceededException in Google App Engine'>How to avoid DeadlineExceededException in Google App Engine</a></li>
<li><a href='http://www.pakzilla.com/2010/01/12/useful-cheat-sheets-on-cloud-computing-and-google-app-engine-for-java/' rel='bookmark' title='Useful cheat sheets on Cloud Computing and Google App Engine for Java'>Useful cheat sheets on Cloud Computing and Google App Engine for Java</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Today I had delivered a workshop on <a title="Developing Java Web Applications In Google App Engine" href="http://www.slideshare.net/tahirakram/developing-java-web-applications-in-google-app-engine-2749092">Developing Java Web Applications In Google App Engine</a>. This workshop was the part of events of <a href="http://www.uet.edu.pk/Conferences/icosst2009/_workshop.html">3rd International Conference on Open Source Systems and Technologies</a>. It was organized by <a href="http://www.kics.edu.pk/">Al-Khawarizmi Institute of Computer Science</a> , <a href="http://www.uet.edu.pk">University of Engineering and Technology</a>, Lahore.</p>
<p>I have presented following slides there. Also coded a basic sample application to show how to create and deploy new Java project on GAE. Which can send emails, how to use authentication by Google, and how to do database interaction. It was a very interesting topic for me to present. Participants also liked it.</p>
<div style="width:425px" id="__ss_2749092"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/tahirakram/developing-java-web-applications-in-google-app-engine-2749092" title="Developing Java Web Applications In Google App Engine">Developing Java Web Applications In Google App Engine</a></strong><object id="__sse2749092" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=developingjavabasedwebapplicationsingoogleapp-091219065103-phpapp01&#038;stripped_title=developing-java-web-applications-in-google-app-engine-2749092" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse2749092" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=developingjavabasedwebapplicationsingoogleapp-091219065103-phpapp01&#038;stripped_title=developing-java-web-applications-in-google-app-engine-2749092" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/tahirakram">Tahir Akram</a>.</div>
</div>
<p>Comments and feedback is welcomed on the presentation material from you guys.</p>
<p>Related posts:<ol>
<li><a href='http://www.pakzilla.com/2009/04/09/java-in-google-app-engine-whats-new-for-developers/' rel='bookmark' title='Java in Google App Engine, what&#8217;s new for developers'>Java in Google App Engine, what&#8217;s new for developers</a></li>
<li><a href='http://www.pakzilla.com/2009/10/03/how-to-avoid-deadlineexceededexception-in-google-app-engine/' rel='bookmark' title='How to avoid DeadlineExceededException in Google App Engine'>How to avoid DeadlineExceededException in Google App Engine</a></li>
<li><a href='http://www.pakzilla.com/2010/01/12/useful-cheat-sheets-on-cloud-computing-and-google-app-engine-for-java/' rel='bookmark' title='Useful cheat sheets on Cloud Computing and Google App Engine for Java'>Useful cheat sheets on Cloud Computing and Google App Engine for Java</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pakzilla.com/2009/12/19/spoken-on-google-app-engine-at-a-conference-in-uet/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Tutorial: JPA on Google App Engine</title>
		<link>http://www.pakzilla.com/2009/12/13/tutorial-jpa-on-google-app-engine/</link>
		<comments>http://www.pakzilla.com/2009/12/13/tutorial-jpa-on-google-app-engine/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 15:05:58 +0000</pubDate>
		<dc:creator>Tahir Akram</dc:creator>
				<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JPA]]></category>

		<guid isPermaLink="false">http://www.pakzilla.com/?p=723</guid>
		<description><![CDATA[This project will create and delete an entity record. I have chosen JPA for datastore in app engine. You can also look JDO for this purpose. But my choice to go for JPA is due to Sun standardization on it. I am using App Engine SDK version 1.2.18 Project name: engineplay URL: http://engineplay.appspot.com [ad#co-2] Project [...]
Related posts:<ol>
<li><a href='http://www.pakzilla.com/2009/12/07/upgrading-to-google-app-engine-java-sdk-1-2-8/' rel='bookmark' title='Upgrading to Google App Engine Java SDK 1.2.8'>Upgrading to Google App Engine Java SDK 1.2.8</a></li>
<li><a href='http://www.pakzilla.com/2009/12/01/determine-whether-application-is-running-on-local-server-or-app-engine/' rel='bookmark' title='Determine whether application is running on local server or App Engine'>Determine whether application is running on local server or App Engine</a></li>
<li><a href='http://www.pakzilla.com/2009/10/03/tutorial-java-based-twitter-app-on-google-app-engine/' rel='bookmark' title='Tutorial: Java based Twitter App on Google App Engine'>Tutorial: Java based Twitter App on Google App Engine</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This project will create and delete an entity record. I have chosen JPA for datastore in app engine. You can also look JDO for this purpose. But my choice to go for JPA is due to Sun standardization on it.</p>
<p>I am using App Engine SDK version 1.2.18</p>
<p>Project name: engineplay<br />
URL: <a href="http://engineplay.appspot.com">http://engineplay.appspot.com</a><br />
[ad#co-2]</p>
<p><strong>Project structure:</strong></p>
<p><img class="aligncenter size-full wp-image-717" title="jpa_gae_project_structure" src="http://www.pakzilla.com/wp-content/upload/jpa_gae_project_structure.png" alt="jpa_gae_project_structure" width="279" height="530" /><strong>UserPrefs.java:</strong> The entity class</p>
<pre class="brush: java; title: ; notranslate">
package com.engineplay.datastore.pojos;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.persistence.Id;
import com.engineplay.datastore.EMFService;
import com.google.appengine.api.users.User;

@Entity(name = &quot;UserPrefs&quot;)
public class UserPrefs {
 @Id
 private String userId;
 private int donuts;
 @Basic
 private User user;

 public UserPrefs(String userId) {
 this.userId = userId;
 }

 /* TODO create getter and setters for above properties yourself */

 public static UserPrefs getPrefsForUser(User user) {
 UserPrefs userPrefs = null;
 EntityManager em = EMFService.get().createEntityManager();
 try {
 if (em.find(UserPrefs.class, user.getEmail()) == null) {

 userPrefs = new UserPrefs(user.getEmail());
 userPrefs.setUser(user);

 } else {
 userPrefs = em.find(UserPrefs.class, user.getEmail());
 }
 } finally {
 em.close();
 }
 return userPrefs;
 }

 public void save() {
 EntityManager em = EMFService.get().createEntityManager();
 try {
 em.persist(this);
 } finally {
 em.close();
 }
 }

 public void remove() {
 EntityManager em = EMFService.get().createEntityManager();
 try {
 UserPrefs userPrefs = em.find(UserPrefs.class, user.getEmail());
 em.remove(userPrefs);
 } finally {
 em.close();
 }
 }
}
</pre>
<p><strong>EMFService.java: </strong>The class to create EntityManagerFactory instance.</p>
<pre class="brush: java; title: ; notranslate">
package com.engineplay.datastore;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class EMFService {
 private static final EntityManagerFactory emfInstance = Persistence
 .createEntityManagerFactory(&quot;transactions-optional&quot;);

 private EMFService() {
 }

 public static EntityManagerFactory get() {
 return emfInstance;
 }
}
</pre>
<p><strong>LoginServlet.java</strong></p>
<pre class="brush: java; title: ; notranslate">
package com.engineplay.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.engineplay.datastore.pojos.UserPrefs;
import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;

public class LoginServlet extends HttpServlet {

 public void doGet(HttpServletRequest req, HttpServletResponse resp)
 throws IOException {

 UserService userService = UserServiceFactory.getUserService();
 User user = userService.getCurrentUser();
 String navBar, form = null;
 int donuts = 0;
 if (user == null) {
 navBar = &quot;&lt;p&gt;Welcome! &lt;a href=\&quot;&quot; + userService.createLoginURL(&quot;/&quot;) +
 &quot;\&quot;&gt;Sign in or register&lt;/a&gt; to customize.&lt;/p&gt;&quot;;
 form = &quot;&quot;;
 } else {
 UserPrefs userPrefs = UserPrefs.getPrefsForUser(user);

 if (userPrefs != null) {
 donuts = userPrefs.getDonuts();
 }
 navBar = &quot;&lt;p&gt;Welcome, &quot; + user.getEmail() + &quot;! You can &lt;a href=\&quot;&quot; +
 userService.createLogoutURL(&quot;/&quot;) +
 &quot;\&quot;&gt;sign out&lt;/a&gt;.&lt;/p&gt;&quot;;
 form = &quot;&lt;form action=\&quot;/donuts\&quot; method=\&quot;post\&quot;&gt;&quot; +
 &quot;&lt;label for=\&quot;donuts\&quot;&gt;&quot; +
 &quot;Need more donuts?:&quot; +
 &quot;&lt;/label&gt;&quot; +
 &quot;&lt;input name=\&quot;donuts\&quot; id=\&quot;donuts\&quot; type=\&quot;text\&quot; size=\&quot;4\&quot; /&gt;&quot; +
 &quot; &lt;input name=\&quot;olddonuts\&quot;  type=\&quot;hidden\&quot; value=\&quot;&quot; + donuts + &quot;\&quot; /&gt; &quot; +
 &quot; &lt;input name=\&quot;userId\&quot;  type=\&quot;hidden\&quot; value=\&quot;&quot; +user.getEmail()+ &quot;\&quot; /&gt; &quot; +
 &quot;   &lt;input type=\&quot;submit\&quot; value=\&quot;  ADD  \&quot; /&gt;&lt;br&gt;&lt;input type=\&quot;submit\&quot;  name =\&quot;deleteBtn\&quot; value=\&quot;  DELETE ME!  \&quot; /&gt;&quot; +
 &quot;&lt;/form&gt;&quot;;

 }
 resp.setContentType(&quot;text/html&quot;);
 PrintWriter out = resp.getWriter();
 out.print(&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;Engine Play - Donuts&lt;/title&lt;/head&gt;&lt;body&gt;&quot;);
 out.println(navBar);
 if (donuts != 0)
 out.println(&quot;&lt;p&gt;Donuts you have: &quot; + donuts + &quot;&lt;/p&gt;&quot;);
 else
 out.println(&quot;&lt;p&gt; No donuts you have <img src='http://www.pakzilla.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  &lt;/p&gt;&quot;);
 out.println(form);
 out.print(&quot;&lt;/body&gt;&lt;/html&gt;&quot;);
 }
}
</pre>
<p><strong>DonutsServlet.java</strong></p>
<pre class="brush: java; title: ; notranslate">
package com.engineplay.servlet;

import java.io.IOException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.engineplay.datastore.pojos.UserPrefs;
import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;

public class DonutsServlet extends HttpServlet {

 public void doPost(HttpServletRequest req, HttpServletResponse resp)
 throws IOException {
 UserService userService = UserServiceFactory.getUserService();
 User user = userService.getCurrentUser();
 UserPrefs userPrefs = UserPrefs.getPrefsForUser(user);
 try {

 String deleteOpt = req.getParameter(&quot;deleteBtn&quot;);
 if (deleteOpt == null){
 int donuts = new Integer(req.getParameter(&quot;donuts&quot;)).intValue();
 int oldDonuts = new Integer(req.getParameter(&quot;olddonuts&quot;)).intValue();

 userPrefs.setDonuts(donuts + oldDonuts);
 userPrefs.save();
 }else{
 String userId = req.getParameter(&quot;userId&quot;);
 userPrefs.setUserId(userId);
 userPrefs.remove();
 }
 } catch (Exception e) {
 e.printStackTrace();
 }
 resp.sendRedirect(&quot;/Login&quot;);
 }
}
</pre>
<p><strong>persistence.xml:</strong> Configuration file required for JPA</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;
&lt;persistence xmlns=&quot;http://java.sun.com/xml/ns/persistence&quot;
 xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
 xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/persistence

http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd&quot;

 version=&quot;1.0&quot;&gt;
 &lt;persistence-unit name=&quot;transactions-optional&quot;&gt;
 &lt;provider&gt;
 org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider
 &lt;/provider&gt;
 &lt;properties&gt;
 &lt;property name=&quot;datanucleus.NontransactionalRead&quot;
 value=&quot;true&quot; /&gt;
 &lt;property name=&quot;datanucleus.NontransactionalWrite&quot;
 value=&quot;true&quot; /&gt;
 &lt;property name=&quot;datanucleus.ConnectionURL&quot;
 value=&quot;appengine&quot; /&gt;
 &lt;/properties&gt;
 &lt;/persistence-unit&gt;
&lt;/persistence&gt;
</pre>
<p><strong>web.xml</strong></p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;!DOCTYPE web-app PUBLIC
 &quot;-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN&quot;
 &quot;http://java.sun.com/dtd/web-app_2_3.dtd&quot;&gt;

&lt;web-app xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot; version=&quot;2.5&quot;&gt;

 &lt;servlet&gt;
 &lt;servlet-name&gt;LoginServlet&lt;/servlet-name&gt;
 &lt;servlet-class&gt;com.engineplay.servlet.LoginServlet&lt;/servlet-class&gt;
 &lt;/servlet&gt;
 &lt;servlet&gt;
 &lt;servlet-name&gt;DonutsServlet&lt;/servlet-name&gt;
 &lt;servlet-class&gt;com.engineplay.servlet.DonutsServlet&lt;/servlet-class&gt;
 &lt;/servlet&gt;

 &lt;servlet-mapping&gt;
 &lt;servlet-name&gt;LoginServlet&lt;/servlet-name&gt;
 &lt;url-pattern&gt;/Login&lt;/url-pattern&gt;
 &lt;/servlet-mapping&gt;
 &lt;servlet-mapping&gt;
 &lt;servlet-name&gt;DonutsServlet&lt;/servlet-name&gt;
 &lt;url-pattern&gt;/donuts&lt;/url-pattern&gt;
 &lt;/servlet-mapping&gt;

 &lt;welcome-file-list&gt;
 &lt;welcome-file&gt;Login&lt;/welcome-file&gt;
 &lt;/welcome-file-list&gt;
&lt;/web-app&gt;
</pre>
<p>Access the project here: <a href="http://engineplay.appspot.com">http://engineplay.appspot.com</a></p>
<p><a href="http://engineplay.appspot.com"><img class="aligncenter size-full wp-image-718" title="run_gae_project" src="http://www.pakzilla.com/wp-content/upload/run_gae_project.png" alt="run_gae_project" width="562" height="281" /></a></p>
<p>Related posts:<ol>
<li><a href='http://www.pakzilla.com/2009/12/07/upgrading-to-google-app-engine-java-sdk-1-2-8/' rel='bookmark' title='Upgrading to Google App Engine Java SDK 1.2.8'>Upgrading to Google App Engine Java SDK 1.2.8</a></li>
<li><a href='http://www.pakzilla.com/2009/12/01/determine-whether-application-is-running-on-local-server-or-app-engine/' rel='bookmark' title='Determine whether application is running on local server or App Engine'>Determine whether application is running on local server or App Engine</a></li>
<li><a href='http://www.pakzilla.com/2009/10/03/tutorial-java-based-twitter-app-on-google-app-engine/' rel='bookmark' title='Tutorial: Java based Twitter App on Google App Engine'>Tutorial: Java based Twitter App on Google App Engine</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pakzilla.com/2009/12/13/tutorial-jpa-on-google-app-engine/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Upgrading to Google App Engine Java SDK 1.2.8</title>
		<link>http://www.pakzilla.com/2009/12/07/upgrading-to-google-app-engine-java-sdk-1-2-8/</link>
		<comments>http://www.pakzilla.com/2009/12/07/upgrading-to-google-app-engine-java-sdk-1-2-8/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 23:40:56 +0000</pubDate>
		<dc:creator>Tahir Akram</dc:creator>
				<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.pakzilla.com/?p=693</guid>
		<description><![CDATA[I was getting following exception while trying to code my first interaction with JPA in Google App Engine. After some searching I came to know that I should upgrade my App Engine SDK. To get datanucleus-enhancer-1.1.4.jar. But when I upgraded my SDK from 1.2.0 to 1.2.8. I got following exception. I got two problems to [...]
Related posts:<ol>
<li><a href='http://www.pakzilla.com/2009/04/09/java-in-google-app-engine-whats-new-for-developers/' rel='bookmark' title='Java in Google App Engine, what&#8217;s new for developers'>Java in Google App Engine, what&#8217;s new for developers</a></li>
<li><a href='http://www.pakzilla.com/2009/10/03/how-to-avoid-deadlineexceededexception-in-google-app-engine/' rel='bookmark' title='How to avoid DeadlineExceededException in Google App Engine'>How to avoid DeadlineExceededException in Google App Engine</a></li>
<li><a href='http://www.pakzilla.com/2010/01/12/useful-cheat-sheets-on-cloud-computing-and-google-app-engine-for-java/' rel='bookmark' title='Useful cheat sheets on Cloud Computing and Google App Engine for Java'>Useful cheat sheets on Cloud Computing and Google App Engine for Java</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I was getting following exception while trying to code my first interaction with JPA in Google App Engine.</p>
<pre class="brush: java; title: ; notranslate">org.datanucleus.metadata.InvalidMetaDataException:
Error in MetaData for field &quot;user&quot; in class &quot;com.engineplay.datastore.pojos.UserPrefs&quot; : this is declared as com.google.appengine.api.users.User with &quot;persistence-modifier=none&quot; yet has either &quot;default-fetch-group=true&quot; or &quot;primary-key=true&quot; specified! These should be false.</pre>
<p>After some searching I came to know that I should upgrade my App Engine SDK. To get datanucleus-enhancer-1.1.4.jar. But when I upgraded my SDK from 1.2.0 to 1.2.8. I got following exception.</p>
<pre class="brush: java; title: ; notranslate">java.lang.RuntimeException: Unable to locate the App Engine agent. Please use dev_appserver, KickStart,  or set the jvm flag: &quot;-javaagent:&lt;sdk_root&gt;/lib/agent/appengine-agent.jar&quot;
at com.google.appengine.tools.development.DevAppServerFactory.testAgentIsInstalled(DevAppServerFactory.java:102)
at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:77)
at com.google.appengine.tools.development.DevAppServerFactory.createDevAppServer(DevAppServerFactory.java:38)
Caused by: java.lang.NoClassDefFoundError: com/google/appengine/tools/development/agent/AppEngineDevAgent
at com.google.appengine.tools.development.DevAppServerFactory.testAgentIsInstalled(DevAppServerFactory.java:98)
... 6 more
Caused by: java.lang.ClassNotFoundException: com.google.appengine.tools.development.agent.AppEngineDevAgent
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
... 7 more
</pre>
<p>I got two problems to fix. First the JPA enhancer was not working and second I was unable to start my server through Eclipse.</p>
<p>Running the server was looking straight forward from the exception that I need to add extra VM arguments for all of my applications. Remember this, your previous application will not work unless you add these VM arguments seprately in their launcher configurations.</p>
<p>Following are the steps to do that.</p>
<p>1. Right click the project and select Run As –&gt; Open Run Dialog.</p>
<p><img class="aligncenter size-full wp-image-696" title="gae-add-vm-arguments" src="http://www.pakzilla.com/wp-content/upload/gae-add-vm-arguments.png" alt="gae-add-vm-arguments" width="577" height="533" /></p>
<p>2. Copy the message which you are getting in exception. This is exactly the same that we need to add in VM arguments section. The only addition we need to do is to add our SDK path.</p>
<p><img class="aligncenter size-full wp-image-697" title="gae-added-vm-arguments" src="http://www.pakzilla.com/wp-content/upload/gae-added-vm-arguments.png" alt="gae-added-vm-arguments" width="704" height="563" /></p>
<p>3. Now if you run or debug your project. You server will run perfectly.</p>
<p><img class="aligncenter size-full wp-image-698" title="gae-server-run-success" src="http://www.pakzilla.com/wp-content/upload/gae-server-run-success.png" alt="gae-server-run-success" width="600" height="73" /></p>
<p>Related posts:<ol>
<li><a href='http://www.pakzilla.com/2009/04/09/java-in-google-app-engine-whats-new-for-developers/' rel='bookmark' title='Java in Google App Engine, what&#8217;s new for developers'>Java in Google App Engine, what&#8217;s new for developers</a></li>
<li><a href='http://www.pakzilla.com/2009/10/03/how-to-avoid-deadlineexceededexception-in-google-app-engine/' rel='bookmark' title='How to avoid DeadlineExceededException in Google App Engine'>How to avoid DeadlineExceededException in Google App Engine</a></li>
<li><a href='http://www.pakzilla.com/2010/01/12/useful-cheat-sheets-on-cloud-computing-and-google-app-engine-for-java/' rel='bookmark' title='Useful cheat sheets on Cloud Computing and Google App Engine for Java'>Useful cheat sheets on Cloud Computing and Google App Engine for Java</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pakzilla.com/2009/12/07/upgrading-to-google-app-engine-java-sdk-1-2-8/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Determine whether application is running on local server or App Engine</title>
		<link>http://www.pakzilla.com/2009/12/01/determine-whether-application-is-running-on-local-server-or-app-engine/</link>
		<comments>http://www.pakzilla.com/2009/12/01/determine-whether-application-is-running-on-local-server-or-app-engine/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 21:27:45 +0000</pubDate>
		<dc:creator>Tahir Akram</dc:creator>
				<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.pakzilla.com/?p=687</guid>
		<description><![CDATA[If you are working on developing some application on Google App Engine. You may come up with such situation to switch your production code with your local dev code. Following is my solution for this problem. I have initialized a servlet from web.xml. That set appropriate value in a static boolean. I will use this [...]
Related posts:<ol>
<li><a href='http://www.pakzilla.com/2009/12/13/tutorial-jpa-on-google-app-engine/' rel='bookmark' title='Tutorial: JPA on Google App Engine'>Tutorial: JPA on Google App Engine</a></li>
<li><a href='http://www.pakzilla.com/2009/04/09/java-in-google-app-engine-whats-new-for-developers/' rel='bookmark' title='Java in Google App Engine, what&#8217;s new for developers'>Java in Google App Engine, what&#8217;s new for developers</a></li>
<li><a href='http://www.pakzilla.com/2010/01/12/useful-cheat-sheets-on-cloud-computing-and-google-app-engine-for-java/' rel='bookmark' title='Useful cheat sheets on Cloud Computing and Google App Engine for Java'>Useful cheat sheets on Cloud Computing and Google App Engine for Java</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you are working on developing some application on Google App Engine. You may come up with such situation to switch your production code with your local dev code. Following is my solution for this problem. I have initialized a servlet from web.xml. That set appropriate value in a static boolean. I will use this boolean in whole of my application. I used <strong>getServletContext().getServerInfo()</strong>.</p>
<p>Note: You must read <a href="http://code.google.com/appengine/docs/java/config/webxml.html#web_xml_Features_Not_Supported">App Engine docs</a> about how they take load-on-startup.</p>
<blockquote><p>App Engine supports the &lt;load-on-startup&gt; element for servlet declarations. However, the load actually occurs during the first request handled by the web server instance, not prior to it.</p></blockquote>
<p>Following is my code snippet.</p>
<p><strong>StartupServlet.java</strong>: A generic servlet. Which will be initialized when server starts.</p>
<pre class="brush: java; title: ; notranslate">
public class StartupServlet extends GenericServlet {

public void init() {
String serverInfo = getServletContext().getServerInfo();
/* ServletContext.getServerInfo() will return &quot;Google App Engine Development/x.x.x&quot;
* if will run locally, and &quot;Google App Engine/x.x.x&quot; if run on production envoirnment */
if (serverInfo.contains(&quot;Development&quot;)) {
Constants.DEV_MODE = true;
}else {
Constants.DEV_MODE = false;
}
}

@Override
public void service(ServletRequest arg0, ServletResponse arg1)
throws ServletException, IOException {
// TODO Auto-generated method stub

}
}
</pre>
<p><strong>web.xml</strong>: Add following contents in it</p>
<pre class="brush: xml; title: ; notranslate">
  &lt;servlet&gt;
    &lt;servlet-name&gt;StartupServlet&lt;/servlet-name&gt;
    &lt;servlet-class&gt;com.servlet.StartupServlet&lt;/servlet-class&gt;
    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;

    &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;StartupServlet&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/Startup&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
</pre>
<p>Now you can use<strong> Constants.DEV_MODE</strong> anywhere in your application. It will be true if you are on local server. And false if you are on GAE. For this constant you can make a class with name Constant and declare a static boolean with name DEV_MODE.</p>
<p>If you have anyother idea to implement this solution or you can help me to improve my one. Please drop your comments.</p>
<p>Related posts:<ol>
<li><a href='http://www.pakzilla.com/2009/12/13/tutorial-jpa-on-google-app-engine/' rel='bookmark' title='Tutorial: JPA on Google App Engine'>Tutorial: JPA on Google App Engine</a></li>
<li><a href='http://www.pakzilla.com/2009/04/09/java-in-google-app-engine-whats-new-for-developers/' rel='bookmark' title='Java in Google App Engine, what&#8217;s new for developers'>Java in Google App Engine, what&#8217;s new for developers</a></li>
<li><a href='http://www.pakzilla.com/2010/01/12/useful-cheat-sheets-on-cloud-computing-and-google-app-engine-for-java/' rel='bookmark' title='Useful cheat sheets on Cloud Computing and Google App Engine for Java'>Useful cheat sheets on Cloud Computing and Google App Engine for Java</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pakzilla.com/2009/12/01/determine-whether-application-is-running-on-local-server-or-app-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Domain is not working without www prefix in GAE</title>
		<link>http://www.pakzilla.com/2009/10/06/domain-is-not-working-without-www-prefix-in-gae/</link>
		<comments>http://www.pakzilla.com/2009/10/06/domain-is-not-working-without-www-prefix-in-gae/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 21:05:57 +0000</pubDate>
		<dc:creator>Tahir Akram</dc:creator>
				<category><![CDATA[Google App Engine]]></category>

		<guid isPermaLink="false">http://www.pakzilla.com/?p=648</guid>
		<description><![CDATA[The current issue I am working on is to make my naked domain http://mydomain.com to redirect to http://www.mydomain.com in Google App Engine. With www prefix I have configured my domain. But my naked domain is not working. I just found on Google support site that they are no more supporting naked URLs for their app [...]
Related posts:<ol>
<li><a href='http://www.pakzilla.com/2010/01/12/useful-cheat-sheets-on-cloud-computing-and-google-app-engine-for-java/' rel='bookmark' title='Useful cheat sheets on Cloud Computing and Google App Engine for Java'>Useful cheat sheets on Cloud Computing and Google App Engine for Java</a></li>
<li><a href='http://www.pakzilla.com/2009/04/09/java-in-google-app-engine-whats-new-for-developers/' rel='bookmark' title='Java in Google App Engine, what&#8217;s new for developers'>Java in Google App Engine, what&#8217;s new for developers</a></li>
<li><a href='http://www.pakzilla.com/2009/12/28/got-two-books-on-google-app-engine-for-java/' rel='bookmark' title='Got two books on Google App Engine for Java'>Got two books on Google App Engine for Java</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The current issue I am working on is to make my naked domain http://mydomain.com to redirect to http://www.mydomain.com in Google App Engine. With www prefix I have configured my domain. But my naked domain is not working. I just found on Google support site that they are no more supporting naked URLs for their app engine.</p>
<p>According to <a href="http://www.google.com/support/a/bin/answer.py?answer=91080">Google support</a>:</p>
<blockquote><p><strong>I&#8217;d like to map my app to http://myurl.com (also known as a naked domain).</strong></p>
<p>Due to recent changes, Google App Engine no longer supports mapping your app to a naked domain. If your domain registrar supports URL redirects, you can redirect from http://yourdomain.com to your app, which can be served from domains like http://www.yourdomain.com or http://appid.yourdomain.com.</p>
<p>For instructions on how to configure a redirect for your Google Apps domain, please see the article on <a href="http://www.google.com/support/a/bin/answer.py?hl=en-in&amp;answer=61057">URL forwarding</a>.</p></blockquote>
<p>Issue can be resolved if Google provides us IP address and we set a A record pointing to that IP address. But they dont. <img src='http://www.pakzilla.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>If you guys have idea how naked domain can be configured with this URL Forwarding thing please feel free to share. I will also update if I got this problem resolved.</p>
<p>Helpful resources:</p>
<ul>
<li><a href="http://knol.google.com/k/larry-h/forwarding-to-a-website/2ywrfjibsoohc/4#view">Forwarding to a website while using GApps</a></li>
<li><a href="http://stackoverflow.com/questions/817809/how-to-use-google-app-engine-with-my-own-domain-not-subdomain">How to use Google app engine with my own domain (not subdomain)?</a></li>
</ul>
<p>Related posts:<ol>
<li><a href='http://www.pakzilla.com/2010/01/12/useful-cheat-sheets-on-cloud-computing-and-google-app-engine-for-java/' rel='bookmark' title='Useful cheat sheets on Cloud Computing and Google App Engine for Java'>Useful cheat sheets on Cloud Computing and Google App Engine for Java</a></li>
<li><a href='http://www.pakzilla.com/2009/04/09/java-in-google-app-engine-whats-new-for-developers/' rel='bookmark' title='Java in Google App Engine, what&#8217;s new for developers'>Java in Google App Engine, what&#8217;s new for developers</a></li>
<li><a href='http://www.pakzilla.com/2009/12/28/got-two-books-on-google-app-engine-for-java/' rel='bookmark' title='Got two books on Google App Engine for Java'>Got two books on Google App Engine for Java</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pakzilla.com/2009/10/06/domain-is-not-working-without-www-prefix-in-gae/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to avoid DeadlineExceededException in Google App Engine</title>
		<link>http://www.pakzilla.com/2009/10/03/how-to-avoid-deadlineexceededexception-in-google-app-engine/</link>
		<comments>http://www.pakzilla.com/2009/10/03/how-to-avoid-deadlineexceededexception-in-google-app-engine/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 23:00:30 +0000</pubDate>
		<dc:creator>Tahir Akram</dc:creator>
				<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Twitter4J]]></category>

		<guid isPermaLink="false">http://www.pakzilla.com/?p=641</guid>
		<description><![CDATA[If you are developing web application on Google App Engine for Java. And you dont know what this exception is. You can be in trouble. The container throws this exception for those requests which take time more than 30 seconds. In other words GAE wants every requests to be fullfilled within 30 seconds. Case I [...]
Related posts:<ol>
<li><a href='http://www.pakzilla.com/2009/12/07/upgrading-to-google-app-engine-java-sdk-1-2-8/' rel='bookmark' title='Upgrading to Google App Engine Java SDK 1.2.8'>Upgrading to Google App Engine Java SDK 1.2.8</a></li>
<li><a href='http://www.pakzilla.com/2009/12/13/tutorial-jpa-on-google-app-engine/' rel='bookmark' title='Tutorial: JPA on Google App Engine'>Tutorial: JPA on Google App Engine</a></li>
<li><a href='http://www.pakzilla.com/2010/12/03/new-google-app-engine-sdk-1-4-0-released-with-major-improvements/' rel='bookmark' title='New Google App Engine SDK 1.4.0 released with major improvements'>New Google App Engine SDK 1.4.0 released with major improvements</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you are developing web application on Google App Engine for Java. And you dont know what this <a href="http://code.google.com/appengine/docs/java/runtime.html#The%5FRequest%5FTimer">exception</a> is. You can be in trouble. The container throws this exception for those requests which take time more than 30 seconds. In other words GAE wants every requests to be fullfilled within 30 seconds.</p>
<h2><strong>Case</strong></h2>
<p>I am developing a Twitter application and I got this exception when I login my Twitter user name. I have some 120 friends and 170 followers. So I need to fill two lists of Twitter users with their name and image URL. It was a bad practice from my side that I started populating lists in a loop which contain external service lookup overhead (Twitter) and also big in iteration. So I got following exception.<br />
<code>This request (670f658c2bf64b44) started at 2009/10/02 23:18:23.902 UTC and was still executing at 2009/10/02 23:18:52.605 UTC.</code></p>
<h2><strong>Possible solution</strong></h2>
<p>As for those users who have friends and followers in thousands, this problem will persist. So what I am thinking is to put lists in session. Populate the page with first 30 users. And give a link to next 30 (paginate). I will keep updating two variables in session which will tell start and end to pick the users from the list. I will use <a href="http://directwebremoting.org/dwr/index.html">DWR</a> for this. By this my every request will be responded by container with in 30 seconds.</p>
<p>If you guys have some more optimum solution for it, please share me. Another solution has been discussed <a href="http://groups.google.com/group/google-appengine/browse_thread/thread/10c231dcd9d43a73">here</a> too.</p>
<p>Related posts:<ol>
<li><a href='http://www.pakzilla.com/2009/12/07/upgrading-to-google-app-engine-java-sdk-1-2-8/' rel='bookmark' title='Upgrading to Google App Engine Java SDK 1.2.8'>Upgrading to Google App Engine Java SDK 1.2.8</a></li>
<li><a href='http://www.pakzilla.com/2009/12/13/tutorial-jpa-on-google-app-engine/' rel='bookmark' title='Tutorial: JPA on Google App Engine'>Tutorial: JPA on Google App Engine</a></li>
<li><a href='http://www.pakzilla.com/2010/12/03/new-google-app-engine-sdk-1-4-0-released-with-major-improvements/' rel='bookmark' title='New Google App Engine SDK 1.4.0 released with major improvements'>New Google App Engine SDK 1.4.0 released with major improvements</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pakzilla.com/2009/10/03/how-to-avoid-deadlineexceededexception-in-google-app-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

