Hi Lahiru,

On 15 November 2014 14:04, Udara Liyanage <ud...@wso2.com> wrote:

> Hi,
>
> I don't think manually touching the artifacts is a wise solution.
> As mentioned by Lasantha artifacts are not deployed until tenant is
> loaded. Imagine a production setup with a large number of tenants and each
> tenant has artifacts, then it will takes a long time to deploy all
> artifacts. Delaying artifact deployment is called ghost deployment [1].
> Try sending a request to the not deployed artifacts and check if deploy()
> is get called.
>
> [1]
> http://blog.afkham.org/2011/11/lazy-loading-deployment-artifacts-in.html?m=1
>
>
>
> Touched, not typed. Erroneous words are a feature, not a typo.
> On Nov 15, 2014 1:49 PM, "Firzhan Naqash" <firz...@wso2.com> wrote:
>
>> Hi Lahiru,
>>
>> You can get the carbon tenant repository by
>> using CarbonUtils.getCarbonTenantsDirPath().
>>
>> With in the the tenant repository you can get the array of folder names (
>> tenant ID ).
>>
>> There after you can iterate the tenant id array and access the
>> event-sinks folder for each tenant.
>>
>>
>> Regards,
>> Firzhan
>>
>> On Sat, Nov 15, 2014 at 1:32 PM, Lahiru Chandima <lahi...@wso2.com>
>> wrote:
>>
>>> Thanks Frizhan for the nice solution :)
>>>
>>> Do you know a way to programmatically get deployment directory path of a
>>> tenant?
>>>
>>> Thanks
>>>
>>> On Sat, Nov 15, 2014 at 1:12 PM, Firzhan Naqash <firz...@wso2.com>
>>> wrote:
>>>
>>>> Hi Lahiru,
>>>>
>>>> On that case, you can touch(update) the artifacts of tenanat's once the
>>>> bundle get activated :) . This is not an elegant solution.
>>>>
>>>> There might be other better proper ways to achieve this.
>>>>
>>>> Regards,
>>>> Firzhan
>>>>
>>>> On Sat, Nov 15, 2014 at 12:35 PM, Lahiru Chandima <lahi...@wso2.com>
>>>> wrote:
>>>>
>>>>> Hi Frizhan,
>>>>>
>>>>> Thanks for the information.
>>>>>
>>>>> Is there any way I can automatically re-deploy artifacts for tenants
>>>>> on startup? If I log in using a tenant user to ESB, I can see the proxy
>>>>> service artifacts that were added earlier, showing that they were somehow
>>>>> re-deployed. So I think there should be a way.
>>>>>
>>>>> Thanks
>>>>>
>>>>> On Sat, Nov 15, 2014 at 10:31 AM, Firzhan Naqash <firz...@wso2.com>
>>>>> wrote:
>>>>>
>>>>>> Hi Lahiru,
>>>>>>
>>>>>> Deployer's deploy() method will get trigger only when artifacts are
>>>>>> being deployed.
>>>>>>
>>>>>> For super-tenant during the server start-up axis2 re-deploys the
>>>>>> artifacts, thus triggering deploy(). But for tenants nothing happens like
>>>>>> that unless you do it manually.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>> Firzhan
>>>>>>
>>>>>> On Sat, Nov 15, 2014 at 7:33 AM, Lahiru Chandima <lahi...@wso2.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi Lasantha,
>>>>>>>
>>>>>>> Thanks for the solution.
>>>>>>>
>>>>>>> logging in as a tenant user solved the problem. Now new artifacts
>>>>>>> that I add after tenant is loaded get deployed.
>>>>>>>
>>>>>>> But, the artifacts that were already there in my tenant artifact
>>>>>>> directory neither gets deployed at server startup nor when a tenant 
>>>>>>> user is
>>>>>>> logged in. But these artifacts get deployed if I do some change to them
>>>>>>> after a tenant user logs in.
>>>>>>>
>>>>>>> What may be the reason for this?
>>>>>>>
>>>>>>
This is actually strange. When ghost deployment is not enabled (which is
the  default AFAIK), when the tenant is loaded all the related artifacts
should get deployed (as explained in the blog post by Azeez which was
suggested by Udara above). I assume you are testing this on a Carbon-4.3.0
based server (ESB-4.9.0?). I tested this scenario for CEP 4.0.0-SNAPSHOT
build which is also based on Carbon 4.3.0 and tenant artifacts that were
previously there in the directory get deployed fine after the tenant is
loaded.

Can you share the configs (axis2.xml, carbon.xml) related to your test
setup? Also, do you have any source location where your deployer code is
committed? Maybe we can go through that and see if there is any config
issue or similar.

>
>>>>>>> Thanks
>>>>>>>
>>>>>>>
>>>>>>> On Sat, Nov 15, 2014 at 12:08 AM, Lasantha Fernando <
>>>>>>> lasan...@wso2.com> wrote:
>>>>>>>
>>>>>>>> Hi Lahiru,
>>>>>>>>
>>>>>>>> Can you verify whether your tenant is loaded in the server? (If you
>>>>>>>> simply login as a tenant user, the tenant should be loaded)
>>>>>>>>
>>>>>>>> If your tenant is not loaded, the deployment of artifacts for that
>>>>>>>> particular tenant will not happen. AFAIK, this is the expected 
>>>>>>>> behaviour
>>>>>>>> for a carbon server since we load tenants lazily.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Lasantha
>>>>>>>>
>>>>>>>> On 14 November 2014 22:58, Lahiru Chandima <lahi...@wso2.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Hi Firzhan,
>>>>>>>>>
>>>>>>>>> Thanks for the reply.
>>>>>>>>>
>>>>>>>>> Tried your method and its working for files deployed in
>>>>>>>>> repository/deployment/server/event-sinks. But still no luck with 
>>>>>>>>> deploying
>>>>>>>>> for a tenant (in repository/tenants/1/event-sinks)
>>>>>>>>>
>>>>>>>>> Any idea why?
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>>
>>>>>>>>> On Fri, Nov 14, 2014 at 8:10 PM, Firzhan Naqash <firz...@wso2.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> Hi Lahiru,
>>>>>>>>>>
>>>>>>>>>> Rathern than defining them in axis2.xml, you can define them in
>>>>>>>>>> compnent.xml and pom.xml file which worked for me [1]
>>>>>>>>>>
>>>>>>>>>> [1]
>>>>>>>>>> http://architects.dzone.com/articles/writing-axis2-custom-deployers
>>>>>>>>>>
>>>>>>>>>> Regards,
>>>>>>>>>> Firzhan
>>>>>>>>>>
>>>>>>>>>> On Fri, Nov 14, 2014 at 7:14 PM, Lahiru Chandima <
>>>>>>>>>> lahi...@wso2.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi All,
>>>>>>>>>>>
>>>>>>>>>>> I have created an Axis2 deployer to deploy an xml artifact. I
>>>>>>>>>>> have added following to repository/conf/axis2/axis2.xml
>>>>>>>>>>>
>>>>>>>>>>> <deployer extension=".xml"
>>>>>>>>>>> class="org.wso2.carbon.event.sink.EventSinkDeployer"
>>>>>>>>>>> directory="event-sinks"/>
>>>>>>>>>>>
>>>>>>>>>>> And I have created a directory named event-sinks for my new
>>>>>>>>>>> artifact type in repository/deployment/server
>>>>>>>>>>>
>>>>>>>>>>> When I add a new xml artifact to the event-sinks directory,
>>>>>>>>>>> deploy(DeploymentFileData deploymentFileData) in my deployer gets 
>>>>>>>>>>> called
>>>>>>>>>>> without a problem.
>>>>>>>>>>>
>>>>>>>>>>> But, if I deploy an artifact for a tenant (eg: in directory
>>>>>>>>>>> repository/tenants/1/event-sinks for tenant 1), deploy() method of 
>>>>>>>>>>> my
>>>>>>>>>>> deployer doesn't get called.
>>>>>>>>>>>
>>>>>>>>>>> What have I done wrong? Have I created event-sinks directory in
>>>>>>>>>>> the wrong location for tenant 1?
>>>>>>>>>>>
>>>>>>>>>>> Thanks
>>>>>>>>>>>
>>>>>>>>>>>
Thanks,
Lasantha


> --
>>>>>>>>>>> Lahiru Chandima
>>>>>>>>>>> *Senior Software Engineer*
>>>>>>>>>>> Mobile : +94 (0) 772 253283
>>>>>>>>>>> lahi...@wso2.com
>>>>>>>>>>>
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Dev mailing list
>>>>>>>>>>> Dev@wso2.org
>>>>>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Lahiru Chandima
>>>>>>>>> *Senior Software Engineer*
>>>>>>>>> Mobile : +94 (0) 772 253283
>>>>>>>>> lahi...@wso2.com
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> Dev mailing list
>>>>>>>>> Dev@wso2.org
>>>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> *Lasantha Fernando*
>>>>>>>> Software Engineer - Data Technologies Team
>>>>>>>> WSO2 Inc. http://wso2.com
>>>>>>>>
>>>>>>>> email: lasan...@wso2.com
>>>>>>>> mobile: (+94) 71 5247551
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Lahiru Chandima
>>>>>>> *Senior Software Engineer*
>>>>>>> Mobile : +94 (0) 772 253283
>>>>>>> lahi...@wso2.com
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Lahiru Chandima
>>>>> *Senior Software Engineer*
>>>>> Mobile : +94 (0) 772 253283
>>>>> lahi...@wso2.com
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Lahiru Chandima
>>> *Senior Software Engineer*
>>> Mobile : +94 (0) 772 253283
>>> lahi...@wso2.com
>>>
>>
>>
>> _______________________________________________
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Lasantha Fernando*
Software Engineer - Data Technologies Team
WSO2 Inc. http://wso2.com

email: lasan...@wso2.com
mobile: (+94) 71 5247551
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to