dev@glassfish.java.net

Re: [v3] application information registered in domain.xml now

From: Jerome Dochez <Jerome.Dochez_at_Sun.COM>
Date: Tue, 26 Feb 2008 09:58:24 -0800

I fixed some of that yesterday, we use an URL to store the path. Now I
think this was not enough...

For anything but directory deployed applications, we should store a
relative path to the domains root so that we can move
around installations without breaking deployed applications.

we should only store absolute path when dealing with directory
deployed applications.

does that seem right ?

jerome


On Feb 25, 2008, at 5:56 PM, Kedar Mhaswade wrote:

> Hong,
>
> In V2, the entry wouldn't have the leading "file:/", e.g.
>
> location="/Users/kedar/NetBeansProjects/RememberMe/web", so
> it was just the absolute path.
>
> In V3, if it is something like: "file:/Users/kedar/NetBeansProjects/
> RememberMe/web", then it's
> neither URI nor an absolute path, right?
>
>
> Regards,
> Kedar
>
> Hong Zhang wrote:
>> Hi, Kedar
>> The value of the location is the same as in v2, the file path to
>> the application bits directory (user directory in case of a
>> directory deployment, and the applications repository directory for
>> archive deployment).
>> - Hong
>> Kedar Mhaswade wrote:
>>> Hong,
>>>
>>> Another observation: Is the value of "location" a URL? If that's the
>>> case, shouldn't it start with "file://" on Unix-like systems?
>>>
>>> - Kedar
>>>
>>> Hong Zhang wrote:
>>>
>>>> Hi, Pramod
>>>> Can you please send your application to me so I can reproduce
>>>> the problem? Thanks.
>>>>
>>>> - Hong
>>>>
>>>> Pramod Gopinath wrote:
>>>>
>>>>> Hi Hong
>>>>> I checked out and rebuilt the server with the new file that U
>>>>> pointed me to. But the issue is still not solved. In fact now
>>>>> since there is no context-root entry in the domain.xml, the
>>>>> server would restart and deploy the application at /hello which
>>>>> is wrong.
>>>>>
>>>>> Deploy command:
>>>>> ~/work_related/gf_v3_install/02222008/glassfish/bin/asadmin
>>>>> deploy --contextroot / hello
>>>>> SUCCESS : hello deployed successfully
>>>>> properties=(name=hello)
>>>>>
>>>>> Server messages related to application being deployed at root
>>>>> context :
>>>>> INFO: Glassfish v3 started in 2750 ms
>>>>> Feb 22, 2008 12:20:40 PM
>>>>> com.sun.grizzly.standalone.StaticResourcesAdapter <init>
>>>>> INFO: New Servicing page from: /Users/pramodgopinath/
>>>>> work_related/jruby_samples/rails1.x/hello/public
>>>>> Feb 22, 2008 12:20:40 PM com.sun.enterprise.rails.RailsDeployer
>>>>> registerAdapter
>>>>> INFO: Loading application hello at /
>>>>> Starting Rails instances
>>>>> Feb 22, 2008 12:21:20 PM com.sun.grizzly.jruby.RubyObjectPool$1
>>>>> run
>>>>> INFO: Rails instance instantiation took : 39671ms
>>>>> Feb 22, 2008 12:21:20 PM
>>>>> com.sun.enterprise.v3.deployment.DeployCommand execute
>>>>> INFO: Deployment of hello done is 40182 ms
>>>>>
>>>>>
>>>>> Section of the domain.xml after the application deployment :
>>>>> <web-module location="/Users/pramodgopinath/work_related/
>>>>> jruby_samples/rails1.x/hello/" name="hello"></web-module>
>>>>> <application directory-deployed="true" object-type="user"
>>>>> enabled="true" location="file:/Users/pramodgopinath/work_related/
>>>>> jruby_samples/rails1.x/hello/" name="hello">
>>>>> <engine sniffer="jruby"></engine>
>>>>> </application>
>>>>>
>>>>> Console log after server restart :
>>>>> INFO: Listening on port 4848
>>>>> Feb 22, 2008 12:25:31 PM
>>>>> com.sun.grizzly.standalone.StaticResourcesAdapter <init>
>>>>> INFO: New Servicing page from: /Users/pramodgopinath/
>>>>> work_related/jruby_samples/rails1.x/hello/public
>>>>> Feb 22, 2008 12:25:31 PM com.sun.enterprise.rails.RailsDeployer
>>>>> registerAdapter
>>>>> INFO: Loading application hello at /hello
>>>>> Starting Rails instances
>>>>> Feb 22, 2008 12:26:08 PM com.sun.grizzly.jruby.RubyObjectPool$1
>>>>> run
>>>>> INFO: Rails instance instantiation took : 36655ms
>>>>> Feb 22, 2008 12:26:08 PM
>>>>> com.sun.enterprise.v3.services.impl.ApplicationLoaderService
>>>>> processApplication
>>>>> INFO: Loading hello Application done is 36883 ms
>>>>> Feb 22, 2008 12:26:08 PM
>>>>> com.sun.enterprise.v3.server.AppServerStartup run
>>>>> INFO: Glassfish v3 started in 39667 ms
>>>>>
>>>>> Thanks
>>>>> Pramod
>>>>>
>>>>> Hong Zhang wrote:
>>>>>
>>>>>> Hi, Pramod
>>>>>> I think I know why now. While the context root attribute is
>>>>>> always present for a standalone web module, it is not present
>>>>>> for a rails app (and other module types). The context root
>>>>>> attribute in the "application" element is optional. I have
>>>>>> updated the ApplicationLoaderService to only set context root
>>>>>> information in deployment params when it's present in the
>>>>>> "application" element in domain.xml. Please bring over the
>>>>>> latest version of ApplicationLoaderService and let me know if
>>>>>> you still see any problem.
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> - Hong
>>>>>>
>>>>>> Pramod Gopinath wrote:
>>>>>>
>>>>>>> Hi Hong
>>>>>>> I saw Ur checkin related to the deployment information for an
>>>>>>> application being registered to the domain.xml. I am using the
>>>>>>> code bits that have been checked out today morning.
>>>>>>>
>>>>>>> Not sure if U mentioned this but wanted to point one issue
>>>>>>> that I am running into w.r.t contextroot specified on the
>>>>>>> asadmin deploy command. This is not being saved into the
>>>>>>> domain.xml and hence the server is brought down and up, get
>>>>>>> this exception stack trace :
>>>>>>>
>>>>>>> java.lang.NullPointerException
>>>>>>> at java.util.Hashtable.put(Hashtable.java:396)
>>>>>>> at java.util.Properties.setProperty(Properties.java:128)
>>>>>>> at
>>>>>>> com
>>>>>>> .sun
>>>>>>> .enterprise
>>>>>>> .v3
>>>>>>> .services
>>>>>>> .impl
>>>>>>> .ApplicationLoaderService
>>>>>>> .populateDeployParamsFromDomainXML
>>>>>>> (ApplicationLoaderService.java:377)
>>>>>>> at
>>>>>>> com
>>>>>>> .sun
>>>>>>> .enterprise
>>>>>>> .v3
>>>>>>> .services
>>>>>>> .impl
>>>>>>> .ApplicationLoaderService
>>>>>>> .processApplication(ApplicationLoaderService.java:214)
>>>>>>> at
>>>>>>> com
>>>>>>> .sun
>>>>>>> .enterprise
>>>>>>> .v3
>>>>>>> .services
>>>>>>> .impl
>>>>>>> .ApplicationLoaderService
>>>>>>> .postConstruct(ApplicationLoaderService.java:114)
>>>>>>> at
>>>>>>> com
>>>>>>> .sun
>>>>>>> .hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:
>>>>>>> 114)
>>>>>>> at
>>>>>>> com
>>>>>>> .sun
>>>>>>> .hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:
>>>>>>> 50)
>>>>>>> at
>>>>>>> com
>>>>>>> .sun.hk2.component.AbstractWombImpl.get(AbstractWombImpl.java:
>>>>>>> 39)
>>>>>>> at
>>>>>>> com
>>>>>>> .sun
>>>>>>> .hk2
>>>>>>> .component.SingletonInhabitant.get(SingletonInhabitant.java:22)
>>>>>>> at
>>>>>>> com.sun.hk2.component.LazyInhabitant.get(LazyInhabitant.java:71)
>>>>>>> at
>>>>>>> com
>>>>>>> .sun
>>>>>>> .hk2
>>>>>>> .component
>>>>>>> .AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:19)
>>>>>>> at
>>>>>>> com
>>>>>>> .sun
>>>>>>> .enterprise
>>>>>>> .v3.server.AppServerStartup.run(AppServerStartup.java:125)
>>>>>>> at
>>>>>>> com.sun.enterprise.module.bootstrap.Main.launch(Main.java:388)
>>>>>>> at
>>>>>>> com.sun.enterprise.module.bootstrap.Main.launch(Main.java:351)
>>>>>>> at
>>>>>>> com.sun.enterprise.module.bootstrap.Main.start(Main.java:154)
>>>>>>> at com.sun.enterprise.module.bootstrap.Main
>>>>>>> $1.run(Main.java:70)
>>>>>>>
>>>>>>>
>>>>>>> For now I am able to work around it, by adding this entry "--
>>>>>>> context-root = "/xxxx" to the entry :
>>>>>>> <application directory-deployed="true" object-type="user"
>>>>>>> enabled="true" location="file:/Users/pramodgopinath/
>>>>>>> work_related/jruby_samples/rails1.x/hello/" name="hello">
>>>>>>> in the domain.xml,
>>>>>>>
>>>>>>> Thanks
>>>>>>> Pramod
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>>>> <mailto:dev-unsubscribe_at_glassfish.dev.java.net>
>>>>>>> For additional commands, e-mail: dev-
>>>>>>> help_at_glassfish.dev.java.net <mailto:dev-help_at_glassfish.dev.java.net
>>>>>>> >
>>>>>>>
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net <mailto:dev-unsubscribe_at_glassfish.dev.java.net
>>>>>> >
>>>>>> For additional commands, e-mail: dev-
>>>>>> help_at_glassfish.dev.java.net <mailto: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
>