Vote for google app engine Maven plugin

Yes, Just like you, I am also looking for maven support in GAE.

There is an unofficial GAE maven plugin here. But  It would be great if google release an official maven plugin and publish artifacts to central maven repository.

Vote here if you are looking for maven support in GAE

http://code.google.com/p/googleappengine/issues/detail?id=1296

Update: Finally My trick did the work. I posted link to this issue on mailing lists and blogs related to Java/app engine on January 7.  Since then more than 100 people have voted for the issue.  And the issue is now accepted by google.

Now we can hope for a official appengine maven plugin in near future.

Update 27-DEC-2010

Congratulations !
I just noticed that the issue has been fixed. App Engine 1.3.7 is now in Maven central and future versions will be pushed to central after each release.

See the link for How to use Maven with google plugin for eclipse.

Advertisements

Freemarker sucks, dependency on javax.swing, Wouldn’t run on GAE

I would say freemarker sucks.
Yes it does. A template engine has dependency on javax.swing !!
Isnt that surprising?

Today, I was trying to deploy a Stripe/Freemarker hello world app on GAE and I got following.


java.lang.NoClassDefFoundError: javax.swing.tree.TreeNode is a restricted class. Please see the Google App Engine developer's guide for more details.
at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:51)
at freemarker.core.TextBlock.isIgnorable(TextBlock.java:375)
at freemarker.core.TemplateElement.postParseCleanup(TemplateElement.java:240)
at freemarker.core.MixedContent.postParseCleanup(MixedContent.java:76)
at freemarker.core.FMParser.Root(FMParser.java:2961)
at freemarker.template.Template.(Template.java:149)
at freemarker.cache.TemplateCache.loadTemplate(TemplateCache.java:448)
at freemarker.cache.TemplateCache.getTemplate(TemplateCache.java:361)
at freemarker.cache.TemplateCache.getTemplate(TemplateCache.java:235)
at freemarker.template.Configuration.getTemplate(Configuration.java:487)
at freemarker.core.Environment.getTemplateForInclusion(Environment.java:1465)
at freemarker.core.Include.accept(Include.java:157)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.Environment.process(Environment.java:190)
at freemarker.template.Template.process(Template.java:237)
at freemarker.ext.servlet.FreemarkerServlet.process(FreemarkerServlet.java:452)
at freemarker.ext.servlet.FreemarkerServlet.doGet(FreemarkerServlet.java:391)
.........
........

Yes, you can not use freemarker on GAE, at least not without hacking it.

I found a patch here, seems that it would solve above exception.

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

Who knows that it wouldn’t have dependency on more classes. we can just hope for good.

updates
Nope, above solution isn’t going to work all the time.
I had a quick look at the code, I think that the culprit is here.


abstract public class TemplateElement extends TemplateObject implements TreeNode

From the code, it seems that TemplateElement implements TreeNode
Just because it needs contract similar to TreeNode but it does not have any thing to do with swing API. (You already knew that)
Instead of implementing TreeNode, author could have created a new interface which exposes similar contract.

Do we implement any interface which exposes similar contract that we need? Context matters. EJB spec has some interface with methods that a servlet want doesn’t mean it can be implemented by a servlet.

Hope, devs would fix it in next release.
The issue is discussed in mailing list here http://n4.nabble.com/Dependeny-on-javax-swing-td978818.html

At the end, I would like to say, I like freemarker and that’s why I wrote even a hello world stripe application in freemarker.

Update 26/03/2010

Friends at freemarker has released a Freemarker GAE prerelease which can be downloaded here. It should work on GAE.  Any one interested in running freemarker on GAE should try it and report issues if any.

see  freemarker on GAE too.

update 28/04/2010

No, still freemarker-gae-pre2 will not work on GAE, I have tested it on GAE 1.3.2.  You will get one or both of the following exceptions

java.lang.VerifyError: (class: freemarker/ext/jsp/FreeMarkerJspApplicationContext, method: signature: ()V) Incompatible argument to function

OR

java.lang.NoClassDefFoundError: Could not initialize class freemarker.ext.jsp.PageContextFactory

See this thread and this thread . The issue has been reported to GAE team here vote for it.

Waiting for the freemarker or GAE team to come up with explanation/solution.