This Question is Possibly Answered

1 "correct" answer available (4 pts) 1 "helpful" answer available (2 pts)
7 Replies Last post: Apr 12, 2012 9:01 PM by Andrey Breslav  
Ian Clarke Newbie 44 posts since
Apr 7, 2012
Currently Being Moderated

Apr 7, 2012 9:48 PM

How do I use Kotlin with Google App Engine?

I've been trying to set up a Google App Engine with IDEA (I'm an IDEA newbie, but I've got a decade of experience with Eclipse).

 

With signfiicant help from Jetbrains support, I've now got a test GAE project set up, and I can run it and see the output of a simple servlet in my web browser.

 

So I deleted this simple servlet and created a Kotlin file containing a class with the same name in the same package, also subclassing HttpServlet, with a doGet() method.  I added the kotlin-runtime.jar to the WEB-INF/lib folder, which is where libraries are supposed to go in Google App Engine.

 

Unfortunately, when I try to run this now I get a ClassNotFoundException - it can't find the Kotlin class with the servlet.

 

What am I doing wrong?

 

Ian.

Stepan Koltsov Newbie 5 posts since
Feb 22, 2012
Currently Being Moderated
Apr 7, 2012 10:08 PM in response to: Ian Clarke
Re: How do I use Kotlin with Google App Engine?

I have no experience with GAE, but I'd do following:

 

1. Use java

 

2. Get any external java library (like commons-lang)

 

3. Place library in WEB-INF/lib

 

4. Write simple servlet that calls any method of that library in doGet()


If all this does not work, then problem is not in Kotlin. If it works, then probably something's wrong with Kotlin, we need to think.

Stepan Koltsov Newbie 5 posts since
Feb 22, 2012
Currently Being Moderated
Apr 7, 2012 10:36 PM in response to: Ian Clarke
Re: How do I use Kotlin with Google App Engine?

Please share the project somewhere: all sources, all binaries (including you've compiled) and show full stack trace of error. Maybe I could help you find, what's wrong.

Stepan Koltsov Newbie 5 posts since
Feb 22, 2012
Currently Being Moderated
Apr 8, 2012 9:32 PM in response to: Ian Clarke
Re: How do I use Kotlin with Google App Engine?

According to stack trace problem is not with kotlin runtime, app engine cannot find testpack.TestServlet.

 

How do you start your application?

 

If you just execute something like

 

.../appengine-java-sdk-1.6.4.1/bin/dev_appserver.sh web

 

it should not work, because app engine looks for classes in web/WEB-INF/lib and web/WEB-INF/classes and testpack.TestServlet is not in these folders.

 

I did

 

cp -r out/production/gaetest1 web/WEB-INF/classes

 

After that servlet works fine.

Andrey Breslav Apprentice 548 posts since
Jun 11, 2007
Currently Being Moderated
Apr 12, 2012 9:01 PM in response to: Ian Clarke
Re: How do I use Kotlin with Google App Engine?

It seems to be a bug somewhere between IDEA's build/deploy infrastructure and Kotlin. Please, feel free to file an issue in our bug tracker. Thanks

More Like This

  • Retrieving data ...