Let me introduce you the brief tutorial to deploy simple lift application to
Google App Engine for Java(GAE/J) . Now, Lift 1.1-SNAPSHOT code base
has included the support for GAE/J and it has become very easy to do it.
First of all, suppose that you have already signed up GAE/J account
and registered your application name as, for example, lift, at your
admin page[1]
So, at the end of this tutorial, your application will be available at
http://lift.appspot.com/
Ok, let's start it.
1. Create the project.
As an example, we will create the project with the groupId as
'test.test.test' and
artifactId as 'test'. So it should be done as follows,
mvn archetype:create -U \
-DarchetypeGroupId=net.liftweb \
-DarchetypeArtifactId=lift-archetype-blank \
-DarchetypeVersion=1.1-SNAPSHOT \
-DremoteRepositories=http://scala-tools.org/repo-snapshots \
-DgroupId=test.test.test -DartifactId=test
Please note that artchetypeVersion is '1.1-SNAPSHOT' and
remoteRepositories is
'http://scala-tools.org/repo-snapshots'.
It seems it will fail If it is 'http://scala-tools.org/repo-releases'
2 Add appengine-web.xml
Create a file named as 'appengine-web.xml' under 'src/main/webapp/WEB-INF'
with your faivorite editor.
$ cd test
$ emacs -nw src/main/web/app/WEB-INF/appengine-web.xml
Its content should be as follows,
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>lift</application>
<version>1</version>
<system-properties>
<property name="in.gae.j" value="true" />
</system-properties>
<sessions-enabled>true</sessions-enabled>
<static-files>
<exclude path="/**" />
</static-files>
</appengine-web-app>
Please note that the content of application tag must be the application name
you have registered. In this tutorial, we have used 'lift' as
described previous.
And then, one more note. Without 'static-files' tag setting, you
will get weired result at
http://lift.appspot.com/index.html ; I mean that the content of
/index.html will be displayed
without snippet processing.
3. Compile
As you have done every day, you will be able to compile it.
$ mvn package
4. Testing
Google App Engine for Java SDK[2] has included the local development server.
$ appengine-java-sdk-1.2.0/bin/dev_appserver.sh target/test-1.0-SNAPSHOT
After some messages, it will wait for your access at
http://localhost:8080/ .
Try it with your web browser.
5. Deployment
It is really easy to deploy it to GAE/J.
$ appengine-java-sdk-1.2.0/bin/appcfg.sh update target/test-1.0-SNAPSHOT
You will be asked for your email address on GMAIL and password for it.
If everything works well, your first lift application must be available at
http://lift.appspot.com/
That's all.
The comet and RDB accesses are not available on GAE/J, but Lift's
nice functionalities
like snippet, ajax, etc. are available and it is worth of trying it, IMHO.
If it is allowed, I'll post other tutorials, for example, for Lift/JPA
and some tips to
run Lift on GAE/J and to work around some GAE/J's bugs.
Frankly to say, in Lift code base, there must be many problems and
bugs to run it there.
I hope that this tutorial becomes the first step for Lift users to try GAE/J
and contribution for finding, sharing and fixing bugs and problems.
[1] http://appengine.google.com/
[2] http://code.google.com/intl/en/appengine/downloads.html#Google_App_Engine_SDK_for_Java
Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/
Thank you for your feedback.
On Sat, May 16, 2009 at 10:33 AM, Eric Daugherty <edaug...@gmail.com> wrote:
>
> I think I executed all the steps correctly, but when I deploy it to
> GAE I get a Security Access Control Exception because the Actor class
> is trying to create a thread I think.
It seems the recent commit[1] has caused that exception.
I have pushed the fix to the github repository.
May I ask you to try it again?
[1] http://github.com/dpp/liftweb/commit/9e39859be9b8f6f4fd7c17cf503b5bcfcd5e861a#diff-2
Hi,
Thank you for your feedback.
It seems the recent commit[1] has caused that exception.
On Sat, May 16, 2009 at 10:33 AM, Eric Daugherty <edaug...@gmail.com> wrote:
>
> I think I executed all the steps correctly, but when I deploy it to
> GAE I get a Security Access Control Exception because the Actor class
> is trying to create a thread I think.
I have pushed the fix to the github repository.
May I ask you to try it again?
[1] http://github.com/dpp/liftweb/commit/9e39859be9b8f6f4fd7c17cf503b5bcfcd5e861a#diff-2
Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Fax +81-22-224-8773
Skype callto://jcraft/
On Mon, Jun 8, 2009 at 11:38 PM, Amit Kumar Verma<cdac...@gmail.com> wrote:
> $ mvn package
...
> -------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> Running test.test.test.AppTest
> [Fatal Error] :3:4: The markup in the document following the root
> element must be well-formed.
I guess that the problem has happened in parsing your
src/main/web/app/WEB-INF/appengine-web.xml
That message says that the problem has occurred at line 3rd and column 4th.
Please check it again.
> And what is the meaning of STEP 4 and STEP 5
>
> $ appengine-java-sdk-1.2.0/bin/dev_appserver.sh target/test-1.0-
> SNAPSHOT
>
> $ appengine-java-sdk-1.2.0/bin/appcfg.sh update target/test-1.0-
> SNAPSHOT
>
> where is this appengine-java-sdk-1.2.0 is located ???
You can grab it at
http://code.google.com/intl/en/appengine/downloads.html#Google_App_Engine_SDK_for_Java
, and the latest version is 1.2.1 at the present time.
Sincerely,
--
Atsuhiko Yamanaka
JCraft,Inc.
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Tel +81-22-723-2150
+1-415-578-3454
Skype callto://jcraft/