dev@glassfish.java.net

Re: --contextroot

From: Arun Gupta <Arun.Gupta_at_Sun.COM>
Date: Fri, 06 Mar 2009 15:35:22 -0800

>>> Well yes this is the current behavior but IMO, keeping such logic at
>>> one place is meaningful and avoids code duplication in every new
>>> container that tries to work thru this option. At the prelude time,
>>> "" means '/' was a revelation to me :-) There was no way to find it
>>> out till someone told me about it. It is better to either describe
>>> such behaviors thru some defined abstractions or should be handled at
>>> once place.
>>
>> Right. That one place is the container who understands what should
>> be done with the value of the context root.
>>
>
> Hmm. Well, don't you expect users to have consistent behavior when they
> use --contextroot across all the containers? This is fairly standard
> stuff and comes from HTTP url and application isolation at URL level
> than has anything to do with ruby or python or Java web applications?
This makes sense to me.

Otherwise, it'll be one more thing the containers need to take care of!

-Arun

>
> Anyway, I have it fixed in my container :-)
>
> -vivek.
>> -Kedar
>>
>>>
>>> It is pretty simple fix in jruby container code, I would patch it there.
>>>
>>> -vivek.
>>>>
>>>>
>>>>>
>>>>> For 2 I think uniqueness of deployed app is computed based on the
>>>>> app name and not on the app name + the context. Well, I could be
>>>>> wrong but this is something that is not in the jruby container's
>>>>> control. Error is thrown at a lower level. See
>>>>> http://pastie.org/409066.
>>>>>
>>>>> -vivek.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Arun Gupta wrote:
>>>>>> Thanks Vince for providing the context!
>>>>>>
>>>>>> Yes, this is a Rails app, should've mentioned.
>>>>>>
>>>>>> The blog pointer provided by Vince shows exactly how to create
>>>>>> that app. Let me know if you need more information.
>>>>>>
>>>>>> -Arun
>>>>>>
>>>>>> vince kraemer wrote:
>>>>>>> I think Arun forgot to mention that 'runner' is a Rails app that
>>>>>>> he is trying to directory deploy. I think you tested something
>>>>>>> that is different by two degrees of freedom... dir deploy vs.
>>>>>>> archived and Rails vs Java EE.
>>>>>>>
>>>>>>> See:
>>>>>>> http://blogs.sun.com/arungupta/entry/totd_71_jruby_and_glassfish
>>>>>>> for a bit more context...
>>>>>>>
>>>>>>> vbk
>>>>>>>
>>>>>>> Hong Zhang wrote:
>>>>>>>> Hi, Arun
>>>>>>>> I tried to deploy a simple web application with --contextroot
>>>>>>>> option and it worked as expected for me.
>>>>>>>>
>>>>>>>> hzhang_at_nmr:~/files/sun/glassfish/bin$ ./asadmin deploy
>>>>>>>> --contextroot foo ~/deployment/apps/hello1.war
>>>>>>>> Command deploy executed successfully.
>>>>>>>>
>>>>>>>> I was able to access the application under localhost:8080/foo
>>>>>>>>
>>>>>>>> hzhang_at_nmr:~/files/sun/glassfish/bin$ ./asadmin deploy
>>>>>>>> --force=true --contextroot bar ~/deployment/apps/hello1.war
>>>>>>>> Command deploy executed successfully.
>>>>>>>>
>>>>>>>> I was able to access the application under localhost:8080/bar.
>>>>>>>>
>>>>>>>> You can send me your application for me to try..
>>>>>>>>
>>>>>>>> - Hong
>>>>>>>>
>>>>>>>>
>>>>>>>> Arun Gupta wrote:
>>>>>>>>
>>>>>>>>> Two questions on --contextroot ...
>>>>>>>>>
>>>>>>>>> 1). On a fresh b39, I tried:
>>>>>>>>>
>>>>>>>>> -- cut here --
>>>>>>>>> >~/tools/glassfish/v3/b39/glassfishv3/bin/asadmin deploy
>>>>>>>>> --contextroot runlog --force=true runner
>>>>>>>>>
>>>>>>>>> Command deploy executed successfully.
>>>>>>>>> -- cut here --
>>>>>>>>>
>>>>>>>>> Here http://localhost:8080/runlog gives 404 and
>>>>>>>>> http://localhost:8080/runner shows the expected page.
>>>>>>>>>
>>>>>>>>> Is --contextroot switch expected to work ?
>>>>>>>>>
>>>>>>>>> 2). On another fresh instance I tried:
>>>>>>>>>
>>>>>>>>> -- cut here --
>>>>>>>>> >~/tools/glassfish/v3/b39/glassfishv3/bin/asadmin deploy runner
>>>>>>>>> Command deploy executed successfully.
>>>>>>>>>
>>>>>>>>> >~/tools/glassfish/v3/b39/glassfishv3/bin/asadmin deploy
>>>>>>>>> --contextroot runlog --force=true runner
>>>>>>>>>
>>>>>>>>> Command deploy executed successfully.
>>>>>>>>> -- cut here --
>>>>>>>>>
>>>>>>>>> But accessing http://localhost:8080/runner and
>>>>>>>>> http://localhost:8080/runlog both give 404.
>>>>>>>>>
>>>>>>>>> Why so ?
>>>>>>>>>
>>>>>>>>> -Arun
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>
>>>>>>>> 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
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>

-- 
Application Platform, Sun Microsystems, Inc.
Blog: http://blogs.sun.com/arungupta