Hi,

I am using DataHolder inside org.wso2.carbon.webapp.mgt to get both
ConfigurationContextService and CarbonTomcatService. I am using these
variables to get the following,


   1. get deployment engine from ConfigurationContextService   with   -
   
(DeploymentEngine)(DataHolder.getServerConfigContext().getAxisConfiguration()).getConfigurator();
   2. get virtual hosts with  -
   carbonTomcatService.getTomcat().getEngine().findChildren()

These two variables inside DataHolder get initialized via,

   1.  setCarbonTomcatService(...) method of
   WebappDeploymentServiceComponent and
   2.  setConfigurationContextService(...) method of
   WebappManagementServiceComponent classes.

>From the above two methods,  setCarbonTomcatService(...) sets its value
first. setConfigurationContextService(...) set its value after Management
console is started. Therefore webapps inside the virtual hosts appBases
gets deployed accordingly.

Thanks,
Nipuni


On Mon, Jun 2, 2014 at 2:43 PM, Kasun Gajasinghe <[email protected]> wrote:

>
>
>
> On Mon, Jun 2, 2014 at 2:05 PM, Nipuni Perera <[email protected]> wrote:
>
>> I didn't change the default deployer. I only read appBase values of
>> virtual hosts and added them to the deployment engine. But the webapp
>> deployment take place just after management console is started.
>>
>>
> This happens if the deployers got added after axis2 has started IIRC. So,
> we need to make sure of the order. But unfortunately, we do not have a
> proper way to force this order currently.
>
> @Sameera, any ideas?
>
>
>> Thanks,
>> Nipuni
>>
>>
>> On Mon, Jun 2, 2014 at 12:28 PM, Kasun Gajasinghe <[email protected]>
>> wrote:
>>
>>>
>>> I do not think that you should remove the default webapp deployer from
>>> component.xml. Your should be in effect only for the additional virtual
>>> hosts.
>>>
>>>
>>> On Mon, Jun 2, 2014 at 9:25 AM, Nipuni Perera <[email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> This is working. This was due to an ip address conflict.
>>>>
>>>> Thanks,
>>>> Nipuni
>>>>
>>>>
>>>> On Sun, Jun 1, 2014 at 3:41 PM, Nipuni Perera <[email protected]> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am working on the $subject. According to the current implementation
>>>>> users has to put webapps inside repositro/depolment/server/webapss and
>>>>> access them via host name "localhost" only. I have modified
>>>>> carbontomcat.java to deploy webapps in a location defined inside appBase 
>>>>> of
>>>>> virtualhosts. But this needs to add an entry to component.xml to direct 
>>>>> the
>>>>> name of webapps directory to the relevent WebAppDeployer class. (Adding an
>>>>> entry to component.xml each time a new appBase is created is not 
>>>>> preferred)
>>>>>
>>>>> I have tried following steps when adding deployers to deployment
>>>>> engine without reading component.xml file. When reading component.xml 
>>>>> file,
>>>>> the Axis2DeployerRegistry class adds the deployers and relevant directory
>>>>> names to a deploymentEngine. In order to skip reading component.xml,
>>>>> deployment engine should be updated using the virtual host appBase values
>>>>> and deployer names.
>>>>>
>>>>> *Scenario 1*
>>>>>
>>>>>
>>>>>    1.     I created a new service component class inside
>>>>>    /org/wso2/carbon/webapp/deployer/internal/ and added following,
>>>>>
>>>>>                                  CarbonTomcatService
>>>>> carbonTomcatService = DataHolder.getCarbonTomcatService();
>>>>>                                  DeploymentEngine deploymentEngine =
>>>>> (DeploymentEngine)(DataHolder.getServerConfigContext().getAxisConfiguration()).getConfigurator();
>>>>>
>>>>>              This gave null values to both variables.
>>>>> ("serverConfigContext" and "carbonTomcatService" variables initialize
>>>>> inside service components in /org/wso2/carbon/webapp/mgt/internal. So it
>>>>> seems the newly created service component classes executes first)
>>>>>
>>>>> *Scenario 2*
>>>>>
>>>>>    1.  I have created a new OSGI bundle which tries to read above two
>>>>>    variables inside its Activator class and service component class. I 
>>>>> could
>>>>>    read proper values inside the service component class and update 
>>>>> deployment
>>>>>    engine. But according to logs, this executes after starting the wso2
>>>>>    carbon.  But, the following statement does deploy the webapps inside 
>>>>> the
>>>>>    appBase.
>>>>>
>>>>>                                 deploymentEngine.addDeployer(deployer,
>>>>> directory, extension);
>>>>>
>>>>> But I am able to access webapps using host name "localhost" only,
>>>>> What could be the issue here?
>>>>>
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Nipuni
>>>>>
>>>>>
>>>>> --
>>>>> Nipuni Perera
>>>>> Software Engineer; WSO2 Inc.; http://wso2.com
>>>>> Email: [email protected]
>>>>> Git hub profile: https://github.com/nipuni
>>>>> Mobile: +94 (71) 5626680
>>>>> <http://wso2.com>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Nipuni Perera
>>>> Software Engineer; WSO2 Inc.; http://wso2.com
>>>> Email: [email protected]
>>>> Git hub profile: https://github.com/nipuni
>>>> Mobile: +94 (71) 5626680
>>>> <http://wso2.com>
>>>>
>>>>
>>>
>>>
>>> --
>>>
>>> *Kasun Gajasinghe*Senior Software Engineer, WSO2 Inc.
>>> email: kasung AT spamfree wso2.com
>>> linked-in: http://lk.linkedin.com/in/gajasinghe
>>> blog: http://kasunbg.org
>>>
>>>
>>>
>>
>>
>>
>> --
>> Nipuni Perera
>> Software Engineer; WSO2 Inc.; http://wso2.com
>> Email: [email protected]
>> Git hub profile: https://github.com/nipuni
>> Mobile: +94 (71) 5626680
>> <http://wso2.com>
>>
>>
>
>
> --
>
> *Kasun Gajasinghe*Senior Software Engineer, WSO2 Inc.
> email: kasung AT spamfree wso2.com
> linked-in: http://lk.linkedin.com/in/gajasinghe
> blog: http://kasunbg.org
>
>
>



-- 
Nipuni Perera
Software Engineer; WSO2 Inc.; http://wso2.com
Email: [email protected]
Git hub profile: https://github.com/nipuni
Mobile: +94 (71) 5626680
<http://wso2.com>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to