Problem with Warble, glassfish, default root context and sun-web.xml

I am trying a deploy a ruby on rails web application using
Warble/Jruby1.1.2 on glassfish v2 into the default root context (i.e.
“/” instead of “/myapp”). On glassfish this can apparently be done by
adding a “sun-web.xml” file such as the one below to the WAR file. The
question is how do I make Warble include this file in the generated WAR
file. I tried to put the sun-web.xml file into the rails config
directory like it is possible to do with web.xml but it did not work.
Suggestion? Alternative ways to solve deploy my app as a default root
context ?

Example sun-web.xml:
<?xml version=“1.0” encoding=“UTF-8”?>
<!DOCTYPE sun-web-app PUBLIC ‘-//Sun Microsystems, Inc.//DTD
Application Server 8.1 Servlet 2.4//EN’
Hardware | Oracle’>
<sun-web-app>
  <context-root>/myapp</context-root>
</sun-web-app>

/Thanks
Morten

  ________________________________________________________

Audi, Fiat, Peugeot, Skoda, Porsche, Toyota, Ford - Kelkoo har brugte
biler til en hver smag! Klik her for at sammenligne
priser.(http://dk.yahoo.com/r/pat/mmb)

Hi Morten,

Warbler seems to create ‘war’ directory under [rails_app_root]\tmp that
represents application structure.
You’ll find WEB-INF directory there, place your sun-web.xml there and
do
'jar -cvf [appname] ’ to get renewed WAR file including sun-web.xml.

I know this approach is somehow circuitous, but it worked for me. I
would
also be happy to know if there’re any easier way to do this.

Kana


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

warbler can be configured though the config/warble.rb file.
Create it first with:

cd myapp/
warble config

The file is well commented. You will probably want to edit the line:

Additional files/directories to include, above those in config.dirs

config.includes = FileList[“config/sun-web.xml”]

On Thu, May 29, 2008 at 12:10 AM, Kanae K. [email protected]
wrote:


Fabio K.

Caelum - Ensino e Soluções em Computação

Hi Fabio,

Thanks for follow up. I placed sun-web.xml under [app_root] and did
configuration like below, then warble. That worked.

config.includes = FileList[“./sun-web.xml”]

Thank you again for your advice.

Kana

----- Original Message -----
From: Fabio K.
To: [email protected]
Sent: Thursday, May 29, 2008 12:18 PM
Subject: Re: [jruby-user] Problem with Warble, glassfish, default root
context and sun-web.xml

warbler can be configured though the config/warble.rb file.

Create it first with:

cd myapp/
warble config

The file is well commented. You will probably want to edit the line:

Additional files/directories to include, above those in config.dirs

config.includes = FileList[“config/sun-web.xml”]

On Thu, May 29, 2008 at 12:10 AM, Kanae K. [email protected]
wrote:

Hi Morten,

Warbler seems to create ‘war’ directory under [rails_app_root]\tmp that
represents application structure.
You’ll find WEB-INF directory there, place your sun-web.xml there and
do
'jar -cvf [appname] ’ to get renewed WAR file including sun-web.xml.

I know this approach is somehow circuitous, but it worked for me. I
would
also be happy to know if there’re any easier way to do this.

Kana


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Fabio K.

Caelum - Ensino e Soluções em Computação


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Kana,

Thanks for the replies with suggestions:

The config change copies the sun-web.xml file correctly, but Warble ends
up reporting the new error "I get a strange error “rake aborted! Don’t
know how to build task ‘./sun-web.xml’”.

Not sure why rake would get confused by this ?

Nb. I am using latest JRuby 1.1.2 + Warable 0.9.9

— Den tors 29/5/08 skrev Kanae K. <[email protected]>:
Fra: Kanae K. <[email protected]>
Emne: Re: [jruby-user] Problem with Warble, glassfish, default root
context and sun-web.xml
Til: [email protected]
Dato: torsdag 29. maj 2008 06.27

Hi Fabio,

Thanks for follow up. I placed sun-web.xml under [app_root] and did
configuration like below, then warble. That worked.

config.includes = FileList[“./sun-web.xml”]

Thank you again for your advice.

Kana

----- Original Message -----
From: Fabio K.
To: [email protected]
Sent: Thursday, May 29, 2008 12:18 PM
Subject: Re: [jruby-user] Problem with Warble, glassfish, default root
context and sun-web.xml

warbler can be configured though the config/warble.rb file.

Create it first with:

cd myapp/
warble config

The file is well commented. You will probably want to edit the line:

Additional files/directories to include, above those in config.dirs

config.includes = FileList[“config/sun-web.xml”]

On Thu, May 29, 2008 at 12:10 AM, Kanae K.
<[email protected]>
wrote:

Hi Morten,

Warbler seems to create ‘war’ directory under [rails_app_root]\tmp
that
represents application structure.
You’ll find WEB-INF directory there, place your sun-web.xml there and
do
'jar -cvf [appname] ’ to get renewed WAR file including sun-web.xml.

I know this approach is somehow circuitous, but it worked for me. I
would
also be happy to know if there’re any easier way to do this.

Kana


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Fabio K.

Caelum - Ensino e Soluções em Computação


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


  Find din nye laptop på kelkoo.dk. Se de gode tilbud her - 

http://dk.yahoo.com/r/pat/mm

Hi Morten,

The config change copies the sun-web.xml file correctly, but Warble ends up reporting the new error "I get a strange error “rake aborted! Don’t know how to build task ‘./sun-web.xml’”.

Have you placed sun-web.xml in rails app’s top-dir ? If your sun-web.xml
is still in rails/config, just move it to directly below ‘rails’ and try
warble again.

Kana


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

you should have the sun-web.xml file inside your RAILS_ROOT dir

On Thu, May 29, 2008 at 10:07 AM, M C [email protected] wrote:

Nb. I am using latest JRuby 1.1.2 + Warable 0.9.9

Hi Morten,

http://www.caelum.com.br

Skal du købe ny bil? Sammenlign priser på brugte biler med Kelkoo og find
et godt tilbud! http://dk.yahoo.com/r/pat/mmb


Fabio K.

Caelum - Ensino e Soluções em Computação

Thanks placing the file in the top-dir works!

— Den tors 29/5/08 skrev [email protected]
<[email protected]>:
>The config change copies the sun-web.xml file correctly, but Warble
ends up
reporting the new error "I get a strange error “rake aborted!
Don’t know how to build task ‘./sun-web.xml’”.

Have you placed sun-web.xml in rails app’s top-dir ? If your sun-web.xml
is
still in rails/config, just move it to directly below ‘rails’ and try
warble again.

  Find din nye laptop på kelkoo.dk. Se de gode tilbud her - 

http://dk.yahoo.com/r/pat/mm

M C wrote:

I am trying a deploy a ruby on rails web application using
Warble/Jruby1.1.2 on glassfish v2 into the default root context (i.e.
“/” instead of “/myapp”). On glassfish this can apparently be done by
adding a “sun-web.xml” file such as the one below to the WAR file. The
question is how do I make Warble include this file in the generated
WAR file. I tried to put the sun-web.xml file into the rails config
directory like it is possible to do with web.xml but it did not work.
Suggestion? Alternative ways to solve deploy my app as a default root
context ?

Looks like you’ve managed to get sun-web.xml into your WAR file, but you
should also know that glassfish supports a command-line parameter for
doing the same:

asadmin --contextroot="/" mywar.war

// Gregory


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email