Archive

Posts Tagged ‘AppEngine’

AppEngine SDK 1.2.8 released

December 4th, 2009 No comments

As far as I can see there is no mention of startup performance. Doesn’t have to mean they haven’t worked on it. Ill check it out to night to see how the application behaves.

Tags: ,

Prerelease of AppEngine SDK 1.2.8

November 25th, 2009 No comments

I got this on twitter last night. Google is doing a prerelease of the next AppEngine SDK.

Details can be found here:

http://groups.google.com/group/google-appengine-java/browse_thread/thread/fe334c9e461026fa

Only thing that worries me is that there is no mention of application startup times.

Tags: ,

Grails 1.2 Latest build works on AppEngine

November 21st, 2009 3 comments

Regarding the logging issue with Grails and Google AppEngine, I’ve just installed the latest build of Grails1.2 and deployed to AppEngine, and it works.

No change to the loading time of grails however, I’m still getting timeouts on my initial requests.

AppEngine enhancer issue

November 21st, 2009 No comments

The issue with the AppEngine enhancer still exists with Windows 7. Let’s hope for the next version of Windows then…

AppEngine start up cost

October 16th, 2009 No comments

I’m struggling with an issue where Google AppEngine will take over 30 seconds to do the initial loading of my hosted web-application. Now apparently it does take a while to load applications that rely on allot of different jar files. Which mine naturally does.

There are however some rumors on the AppEngine group that they are looking to improve the loading time of the applications. Here is a link to one of the discussions. Now this  is just one, I’ve seen others where similar statements have been made.

Now I’m looking forward to get the speed up on my application. Especially if I don’t have to do much about it. However there are some tips out there, due to my lack of computer at the moment I haven’t tested the recommendations but in the thread called: startup takes forver “stumpy” has a few recommendations to improve the start time for Google AppEngine for Java.

Google Appengine SDK 1.2.6

October 14th, 2009 No comments

Today they released a new version of the SDK for Google AppEngine.

Personally I’m very excited about the ability to recieve email.

Here is a link to the Java release notes. The blog post at Google only links to the python release notes.

http://code.google.com/p/googleappengine/wiki/SdkForJavaReleaseNotes

Google AppEngine and Grails 1.2-M2

September 25th, 2009 4 comments

I upgraded this morning, figuring that the changes related to the .gsp views and their pre-compiling would reduce the cold start issues I’m having with Google AppEngine.

However the 1.2-M2 release of Grails, doesn’t fly on Google AppEngine right now. As far as I can see on the mailing list others have had this issue as well.

The problem I’m experiencing is that the LogManager cannot instantiate.

Context initialization failed
org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: java.util.logging.LogManager is a restricted class. Please see the Google App Engine developer's guide for more details.
	at org.codehaus.groovy.grails.web.context.GrailsContextLoader.createWebApplicationContext(GrailsContextLoader.java:74)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
	at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:530)

And

Context initialization failed
org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: Could not initialize class com.google.apphosting.runtime.security.shared.stub.java.util.logging.LogManager

Update: Chad has created a JIRA for this issue located here:http://jira.codehaus.org/browse/GRAILSPLUGINS-1546

Also here is a link to the discussion on the Grails thread:

http://www.nabble.com/java.util.logging.LogManager-is-a-restricted-class.-Please-see-the–Google-App-Engine-developer%27s-guide-for-more-details.-td25453128.html

Finding entities with GORM-JPA

September 24th, 2009 No comments

I’ve been having this issue for a while. Putting it off, but now I had to get my hands dirty. The findBy… methods weren’t returning any objects even though there were data fitting the specified values.

So tonight I finally took the time to take a look at it. My theory was that I could figure out what was wrong by reading the code in JpaPluginSupport.groovy, located in the GORM-JPA plugin.

Now I didn’t find out why its not working. It even looks like its not supported, but I can’t say for sure. What I did however, was find a workaround.

Instead of doing

User.findByEmail(newSaga.email)

I do

User.findWhere(email: newSaga.email)

Using the findWhere method I get results. This is the workaround I’ll go for for now.

Sending mail on Google appengine with Grails

September 16th, 2009 2 comments

Sending emails with Google AppEngine is quite straight forward once you get a hang of things. I ran into some issues, for example I never got the high level api’s to work. The code executed but the emails were never received. Instead I went for Google AppEngines own “low level” api, it worked much better.

What I did is that I set up a really simple MailService, similar to that which is installed with the Mail plug in. However, I do not handle templates instead I just send strings with the mail message.

package mail

import com.google.appengine.api.mail.MailService
import com.google.appengine.api.mail.MailService.Message
import com.google.appengine.api.mail.MailServiceFactory
import javax.mail.MessagingException
import javax.mail.internet.AddressException

class MailService {

 boolean transactional = true

 def sendMail(subject, msgBody, too) {

 try {
 def service = MailServiceFactory.getMailService();

 def msg = new com.google.appengine.api.mail.MailService.Message();
 msg.setSender("xxx");
 msg.setTo(too);
 msg.setSubject(subject);
 msg.setHtmlBody(msgBody);
 service.send(msg);

 } catch (AddressException e) {
 // ...
 } catch (MessagingException e) {
 // ...
 }

 }
}

As you can see it is quite straight forward. I’d like to mention though that in the above code you see a red xxx. This is where you put your sender address. It needs to either be the email to an admin (registered developer) of the app, or it has to be a user logged in using Google’s own login.

With the low-level api it throws an exception like the one below:

Uncaught exception from servlet
org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.IllegalArgumentException: Unauthorized Sender: Unauthorized sender

Good luck!

Google AppEngine does not like leftshift

August 19th, 2009 No comments

I ran into an issue last night where Google AppEngine wouldn’t persist my entities. If I create an entity using the parameters provided by Grails; then the Save operations would fail with the following error

Uncaught exception from servlet
org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: java.lang.StringBuilder.leftShift() is applicable for argument types: (org.codehaus.groovy.runtime.GStringImpl) values: [(login.email  = ?1 )]
	at com.studentsonly.grails.plugins.uiperformance.CacheFilter.doFilter(CacheFilter.java:71)
	at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
	at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
	at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:237)
	at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
	at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139)
	at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:235)
	at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4823)
	at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:4821)
	at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
	at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:359)
	at com.google.net.rpc.impl.Server$2.run(Server.java:820)
	...

The issue is described here. I tried their solution and it works fine for me.