dev@glassfish.java.net

Re: GlassFish Gem for Rails [WAS Re: GlassFish gem feature requests/bugs]

From: Changshin Lee <iasandcb_at_gmail.com>
Date: Sun, 16 Sep 2007 11:56:28 +0900

On 2007. 09. 16, at 오전 6:05, Jerome Dochez wrote:

>
> On Sep 14, 2007, at 11:55 PM, Changshin Lee wrote:
>
>> Hi Charlie,
>>
>> Thanks for your tip. Now SpringBook works fine, but I need one more
>> feature: support loading jar files from a Rails project. Actually
>> Goldspike supports lib/java directory for the purpose, but Grizzly
>> JRuby connector and GF V3 doesn't.
>>
>> In summary:
>>
>> 1. Configure context path (including multiple separators such as "/
>> projects/springbook")
>
> this should be easy to do, we already support --context-path in the
> asadmin deploy, should be easy to do so on the glassfish_rails
> command as well.

Do you mean that it's already possible to use the option or it's going
to be supported? I tried asadmin in $JRUBY_HOME/bin and

/Users/ias/java/tool/jruby-1.1/bin/asadmin:16: ./asadmin:1: syntax
error, expecting kDO tLPAREN2 tLCURLY but found tXSTRING_BEG instead
(SyntaxError)

        from /Users/ias/java/tool/jruby-1.1/bin/asadmin:16:in `load'
        from /Users/ias/java/tool/jruby-1.1/bin/asadmin:16

comes up with whichever argument I give to asadmin.

In addition, I tried asadmin in GF V3 tip (mercurial term for "trunk")
and found that it also didn't make --context-path option work.


>
>
>> 2. Configure port (this can be achieved by modifying domains/
>> domain1/config/domain.xml manually though)
> what more do you need immediately ?

-p option for glassfish_rails would do.

For example,

glassfish_rails springbook -p 20001

This allows you to boot up multiple glassfish_rails instance without
conflict of ports.


>
>
>> 3. Support loading lib/java/*.jar files in a project
> is there a formal way to describe such a dependency in rails ? I
> suppose the Require could be a way

require 'xxx.jar' works fine now. Thanks :-) (I guess GF v3 improved
class loading mechanism for JRoR.)

To sum them up, two possibilities are:

1. Run glassfish_rails with -p and -cp (context path) options.

e.g.
glassfish_rails springbook -p 20001 -cp /projects/springbook

2. Start up glassfish_rails first and use asadmin.

e.g.
glassfish_rails -p 20001
asadmin deploy --path springbook --context-path /projects/springbook

Cheers,

ias

>
>
>>
>> As SpringBook (http://labs.openmaru.com/projects/springbook) is
>> unveiled next week, I'll post more details behind feature requests
>> above.
>>
>> Cheers,
>>
>> ias
>>
>> 2007. 09. 15, 오전 4:53, Charles Oliver Nutter 작성:
>>
>>> Changshin Lee wrote:
>>>> Hi Arun,
>>>>
>>>> First of all, thanks for the nice work. I'd like to give quick
>>>> feedback
>>>> from using it for my project.
>>>>
>>>> I ran "springbook" project with glassfish_rails and
>>>>
>>>> http://localhost:8080/springbook/pages/3
>>>>
>>>> works fine. However, all the generated links to pages_controller
>>>> are
>>>> "/pages/xxx", not "/springbook/pages/xxx". I tried to use
>>>>
>>>> ActionController::AbstractRequest.relative_url_root = '/springbook'
>>>>
>>>> but it didn't work at all. Probably Grizzly JRuby connector may
>>>> leave
>>>> out the context path to Rails.
>>>
>>> I ran into this too. You need to set two properties:
>>>
>>> ActionController::AbstractRequest.relative_url_root = "/testapp/"
>>> ActionController::CgiRequest.relative_url_root = "/testapp/"
>>>
>>> - Charlie
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>