Deploy Play on Stax Hosting

53 views
Skip to first unread message

Roch Delsalle

unread,
Jan 7, 2010, 8:25:17 AM1/7/10
to play-fr...@googlegroups.com
Hi,

I was looking for an alternative to GAE and I recently discovered Stax.
It's a new cloud hosting for Java running on Amazon Web Service.
Have anyone used it yet? 

I tried to upload a WAR into it but it needs to be in a JAR, So I just did  jar cvf war_folder.jar war_folder
But I don't know if its the right way to do it.

user@host:~/Private$ stax run ./war.jar 
running: /home/user/Private/stax-sdk-0.3.6/scripts/run.groovy
ERROR: This is not a valid project dir

If you have any advices thanks;)

--
Roch Delsalle

Roch Delsalle

unread,
Jan 7, 2010, 10:00:53 AM1/7/10
to play-fr...@googlegroups.com
Ok, the problem Is solved, I went inside my WAR folder and typed:
jar cvf war.war *
then:
stax app:deploy -a username/appname -u username -p sekrething ./war.jar

It's running fine, I just need to sort the db connection now.

Guillaume Bort

unread,
Jan 7, 2010, 10:23:43 AM1/7/10
to play-fr...@googlegroups.com
By the way a war or jar file is just a zip. You can generate a war
with the --zip option and rename the war extension to jar. It should
work.

> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.
>
>

Guillaume Bort

unread,
Jan 7, 2010, 10:25:33 AM1/7/10
to play-fr...@googlegroups.com
Btw that's very cool. Could you describe the different steps to
install a play application to stax ?

Roch Delsalle

unread,
Jan 7, 2010, 10:34:43 AM1/7/10
to play-fr...@googlegroups.com
1- Get a beta account, it's free and instant.

2- Add some files to your project:
yourproject/war/WEB-INF/stax-web.xml
<resource name="jdbc/project" auth="Container" type="javax.sql.DataSource">
 <param name="username" value="login" />
 <param name="password" value="password" />
 <param name="url" value="jdbc:stax://project" />
</resource>
yourproject/war/WEB-INF/web.xml

<resource-ref>
 <res-ref-name>jdbc/stockflow</res-ref-name>
 <res-type>javax.sql.DataSource</res-type>
 <res-auth>Container</res-auth>
</resource-ref>

This is the bash script I'm using to deploy my Application to the Stax cloud:

./play/play war ./project/ -o war
jar cvf war.war ./war/*
stax app:deploy -a user/project -u user -p password ./war.war

I don't know exactly how to access the database yet.

--
Roch Delsalle
+33 6 99 11 14 22
55, rue de Bellechasse.
75007 Paris
FRANCE
rdel...@gmail.com
Sent from Paris, France

Guillaume Bort

unread,
Jan 7, 2010, 10:41:06 AM1/7/10
to play-fr...@googlegroups.com
Ok,

For the database access, I guess it should be something like:

db=java:/comp/env/jdbc/stockflow

In your application.conf

But perhaps you can access directly the Mysql server ?

Roch Delsalle

unread,
Jan 7, 2010, 10:42:38 AM1/7/10
to play-fr...@googlegroups.com
Actually you need the following xml in staxt-web.xml.

<?xml version="1.0"?>
<stax-web-app xmlns="http://www.stax.net/xml/webapp/1">
</stax-web-app>

Have a look at the how to deploy video

Roch Delsalle

unread,
Jan 7, 2010, 10:45:28 AM1/7/10
to play-fr...@googlegroups.com
Ok thanks I'm going to re-deploy with this
Maybe I should remove the line ?:
db=mysql

Guillaume Bort

unread,
Jan 7, 2010, 10:51:27 AM1/7/10
to play-fr...@googlegroups.com
yes just let the db=java:/comp/env/jdbc/stockflow line

Perhaps you should configure the jpa dialect as well:

jpa.dialect=play.db.jpa.MySQLDialect

Roch Delsalle

unread,
Jan 7, 2010, 7:56:04 PM1/7/10
to play-fr...@googlegroups.com
I finally managed to get it working you will find attached to this mail a little how-to.
To be honest it's very easy, and it seems to be the best way to host play projects on the cloud I have found so far.
stax.pdf

Johan

unread,
Jan 8, 2010, 4:08:10 PM1/8/10
to play-framework
Quite keen to get your how to, but , the PDF seems broken. I can open
it - but it doesn't contain much.

On Jan 8, 12:56 am, Roch Delsalle <rdelsa...@gmail.com> wrote:
> I finally managed to get it working you will find attached to this mail a
> little how-to.
> To be honest it's very easy, and it seems to be the best way to host play
> projects on the cloud I have found so far.
>

> On Thu, Jan 7, 2010 at 4:51 PM, Guillaume Bort <guillaume.b...@gmail.com>wrote:
>
>
>
> > yes just let the db=java:/comp/env/jdbc/stockflow line
>
> > Perhaps you should configure the jpa dialect as well:
>
> > jpa.dialect=play.db.jpa.MySQLDialect
>

> > On Thu, Jan 7, 2010 at 4:45 PM, Roch Delsalle <rdelsa...@gmail.com> wrote:
> > > Ok thanks I'm going to re-deploy with this
> > > Maybe I should remove the line ?:
> > > db=mysql

> > > On Thu, Jan 7, 2010 at 4:41 PM, Guillaume Bort <guillaume.b...@gmail.com


>
> > > wrote:
>
> > >> Ok,
>
> > >> For the database access, I guess it should be something like:
>
> > >> db=java:/comp/env/jdbc/stockflow
>
> > >> In your application.conf
>
> > >> But perhaps you can access directly the Mysql server ?
>

> > >> On Thu, Jan 7, 2010 at 4:34 PM, Roch Delsalle <rdelsa...@gmail.com>


> > wrote:
> > >> > 1- Get a beta account, it's free and instant.
> > >> > 2- Add some files to your project:
> > >> > yourproject/war/WEB-INF/stax-web.xml
>
> > >> > <resource name="jdbc/project" auth="Container"
> > >> > type="javax.sql.DataSource">
> > >> >  <param name="username" value="login" />
> > >> >  <param name="password" value="password" />
> > >> >  <param name="url" value="jdbc:stax://project" />
> > >> > </resource>
>
> > >> > yourproject/war/WEB-INF/web.xml
> > >> > <resource-ref>
> > >> >  <res-ref-name>jdbc/stockflow</res-ref-name>
> > >> >  <res-type>javax.sql.DataSource</res-type>
> > >> >  <res-auth>Container</res-auth>
> > >> > </resource-ref>
> > >> > This is the bash script I'm using to deploy my Application to the Stax
> > >> > cloud:
> > >> > ./play/play war ./project/ -o war
> > >> > jar cvf war.war ./war/*
> > >> > stax app:deploy -a user/project -u user -p password ./war.war
> > >> > I don't know exactly how to access the database yet.
> > >> > On Thu, Jan 7, 2010 at 4:25 PM, Guillaume Bort

> > >> > <guillaume.b...@gmail.com>


> > >> > wrote:
>
> > >> >> Btw that's very cool. Could you describe the different steps to
> > >> >> install a play application to stax ?
>
> > >> >> On Thu, Jan 7, 2010 at 4:23 PM, Guillaume Bort

> > >> >> <guillaume.b...@gmail.com>


> > >> >> wrote:
> > >> >> > By the way a war or jar file is just a zip. You can generate a war
> > >> >> > with the --zip option and rename the war extension to jar. It
> > should
> > >> >> > work.
>

> > >> >> > On Thu, Jan 7, 2010 at 4:00 PM, Roch Delsalle <rdelsa...@gmail.com


>
> > >> >> > wrote:
> > >> >> >> Ok, the problem Is solved, I went inside my WAR folder and typed:
> > >> >> >> jar cvf war.war *
> > >> >> >> then:
> > >> >> >> stax app:deploy -a username/appname -u username -p sekrething
> > >> >> >> ./war.jar
> > >> >> >> It's running fine, I just need to sort the db connection now.
> > >> >> >> On Thu, Jan 7, 2010 at 2:25 PM, Roch Delsalle <

> > rdelsa...@gmail.com>


> > >> >> >> wrote:
>
> > >> >> >>> Hi,
> > >> >> >>> I was looking for an alternative to GAE and I recently discovered
> > >> >> >>> Stax.
> > >> >> >>> It's a new cloud hosting for Java running on Amazon Web Service.
> > >> >> >>> Have anyone used it yet?
> > >> >> >>> I tried to upload a WAR into it but it needs to be in a JAR, So I
> > >> >> >>> just
> > >> >> >>> did
> > >> >> >>>  jar cvf war_folder.jar war_folder
> > >> >> >>> But I don't know if its the right way to do it.
> > >> >> >>> user@host:~/Private$ stax run ./war.jar
> > >> >> >>> running: /home/user/Private/stax-sdk-0.3.6/scripts/run.groovy
> > >> >> >>> ERROR: This is not a valid project dir
> > >> >> >>> If you have any advices thanks;)
> > >> >> >>> --
> > >> >> >>> Roch Delsalle
>
> > >> >> >> --
> > >> >> >> You received this message because you are subscribed to the Google
> > >> >> >> Groups
> > >> >> >> "play-framework" group.
> > >> >> >> To post to this group, send email to
> > >> >> >> play-fr...@googlegroups.com.
> > >> >> >> To unsubscribe from this group, send email to

> > >> >> >> play-framewor...@googlegroups.com<play-framework%2Bunsubscribe@go oglegroups.com>


> > .
> > >> >> >> For more options, visit this group at
> > >> >> >>http://groups.google.com/group/play-framework?hl=en.
>
> > >> >> --
> > >> >> You received this message because you are subscribed to the Google
> > >> >> Groups
> > >> >> "play-framework" group.
> > >> >> To post to this group, send email to play-fr...@googlegroups.com
> > .
> > >> >> To unsubscribe from this group, send email to

> > >> >> play-framewor...@googlegroups.com<play-framework%2Bunsubscribe@go oglegroups.com>


> > .
> > >> >> For more options, visit this group at
> > >> >>http://groups.google.com/group/play-framework?hl=en.
>
> > >> > --
> > >> > Roch Delsalle
> > >> > ✆ +33 6 99 11 14 22
> > >> > 55, rue de Bellechasse.
> > >> > 75007 Paris
> > >> > FRANCE

> > >> > rdelsa...@gmail.com


> > >> > Sent from Paris, France
> > >> > --
> > >> > You received this message because you are subscribed to the Google
> > >> > Groups
> > >> > "play-framework" group.
> > >> > To post to this group, send email to play-fr...@googlegroups.com.
> > >> > To unsubscribe from this group, send email to

> > >> > play-framewor...@googlegroups.com<play-framework%2Bunsubscribe@go oglegroups.com>


> > .
> > >> > For more options, visit this group at
> > >> >http://groups.google.com/group/play-framework?hl=en.
>
> > >> --
> > >> You received this message because you are subscribed to the Google
> > Groups
> > >> "play-framework" group.
> > >> To post to this group, send email to play-fr...@googlegroups.com.
> > >> To unsubscribe from this group, send email to

> > >> play-framewor...@googlegroups.com<play-framework%2Bunsubscribe@go oglegroups.com>


> > .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/play-framework?hl=en.
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "play-framework" group.
> > > To post to this group, send email to play-fr...@googlegroups.com.
> > > To unsubscribe from this group, send email to

> > > play-framewor...@googlegroups.com<play-framework%2Bunsubscribe@go oglegroups.com>


> > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/play-framework?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "play-framework" group.
> > To post to this group, send email to play-fr...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > play-framewor...@googlegroups.com<play-framework%2Bunsubscribe@go oglegroups.com>


> > .
> > For more options, visit this group at
> >http://groups.google.com/group/play-framework?hl=en.
>
>
>

>  stax.pdf
> 126KViewDownload

Roch Delsalle

unread,
Jan 9, 2010, 10:31:36 AM1/9/10
to play-fr...@googlegroups.com
I have added the details to stax's wiki:

To unsubscribe from this group, send email to play-framewor...@googlegroups.com.

Guillaume Bort

unread,
Jan 9, 2010, 10:40:24 AM1/9/10
to play-fr...@googlegroups.com
About database configuration:

db=java:/comp/env/jdbc/yourProject

db.url=jdbc:stax://yourDataBaseName
db.driver=com.staxnet.jdbc.Driver
db.user=login
db.pass=password

You don't need to define db.* properties if you define the
db=java:/comp/env/jdbc/yourProject.

db=java:/comp/env/jdbc/yourProject means that you connect to an
existing datasource provided by the application server.

Johan

unread,
Jan 9, 2010, 2:06:04 PM1/9/10
to play-framework
Excellent - thanks Roch. I'll give it a go soon.

> > <play-framework%2Bunsubscribe@go oglegroups.com>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/play-framework?hl=en.
>
> > >  stax.pdf
> > > 126KViewDownload
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "play-framework" group.
> > To post to this group, send email to play-fr...@googlegroups.com.
> > To unsubscribe from this group, send email to

Reply all
Reply to author
Forward
0 new messages