You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Udara Liyanage <ud...@wso2.com> on 2014/12/21 07:30:21 UTC

Why application is parsed twice

Hi Imesh, Reka,

Just wanted to know why application is parsed at
    1) application creation time
    2) application deployment time

Currently token is created at application parsing time(ideally should not),
thus token creating occurred twice.

-- 

Udara Liyanage
Software Engineer
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

web: http://udaraliyanage.wordpress.com
phone: +94 71 443 6897

Re: Why application is parsed twice

Posted by Imesh Gunaratne <im...@apache.org>.
Great thanks Udara!

On Mon, Dec 22, 2014 at 10:01 AM, Udara Liyanage <ud...@wso2.com> wrote:

> Hi Imesh,
>
> I changed this to application creating time, but could not push the
> changes.
>
> On Sun, Dec 21, 2014 at 11:48 PM, Imesh Gunaratne <im...@apache.org>
> wrote:
>>
>> Hi Udara,
>>
>> Thanks for the information, I see the below logic
>> in DefaultApplicationParser:
>>
>> private ApplicationClusterContext createApplicationClusterContext ()
>>             throws ApplicationDefinitionException {
>>         ...
>>         String oAuth_token = createToken(appId);
>>         payloadData.add(TOKEN_PAYLOD_PARAM_NAME, oAuth_token);
>>
>>         String textPayload = payloadData.toString();
>>         return new ApplicationClusterContext(cartridgeInfo.getType(),
>> clusterId, hostname, textPayload, deploymentPolicy, isLB);
>>     }
>>
>> Shouldn't this happen once per application? As it looks like now an OAuth
>> token is generated per cluster. Is this necessary?
>>
>> Thanks
>>
>> On Sun, Dec 21, 2014 at 9:55 PM, Udara Liyanage <ud...@wso2.com> wrote:
>>
>>> Hi Imesh,
>>>
>>> Below are the admin services using and operations
>>>
>>> OAuthAdminService - registerOAuthApplicationData
>>> IdentityApplicationManagementService - createApplication,
>>> getApplication, updateApplication
>>>
>>> Since authentication handlers does not set the carbon context, there is
>>> no way of identifying the user at component level. Thus added a JWT based
>>> authenticator, so every admin called is to be authenticated. This is why
>>> you see many logs
>>>
>>> On Sun, Dec 21, 2014 at 8:39 PM, Imesh Gunaratne <im...@apache.org>
>>> wrote:
>>>>
>>>> Can you please explain those admin calls Udara?
>>>> I can see ten user logins for an application having two cartridges for
>>>> one application parse process:
>>>>
>>>> [2014-12-21 04:21:56,892]  INFO
>>>> {org.apache.stratos.autoscaler.api.AutoScalerServiceImpl} -  Starting to
>>>> add application: [application-id] single-group-app
>>>> [2014-12-21 04:21:57,005]  INFO
>>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>>> 04:21:57,005+0530]
>>>> [2014-12-21 04:21:57,041]  INFO
>>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>>> 04:21:57,041+0530]
>>>> [2014-12-21 04:21:57,064]  INFO
>>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>>> 04:21:57,064+0530]
>>>> [2014-12-21 04:21:57,093]  INFO
>>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>>> 04:21:57,093+0530]
>>>> [2014-12-21 04:21:57,134]  INFO
>>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>>> 04:21:57,134+0530]
>>>> [2014-12-21 04:21:57,902]  INFO
>>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>>> 04:21:57,902+0530]
>>>> [2014-12-21 04:21:57,912]  INFO
>>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>>> 04:21:57,911+0530]
>>>> [2014-12-21 04:21:57,922]  INFO
>>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>>> 04:21:57,922+0530]
>>>> [2014-12-21 04:21:57,934]  INFO
>>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>>> 04:21:57,934+0530]
>>>> [2014-12-21 04:21:57,957]  INFO
>>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>>> 04:21:57,957+0530]
>>>> [2014-12-21 04:21:57,976]  INFO
>>>> {org.apache.stratos.autoscaler.applications.parser.DefaultApplicationParser}
>>>> -  Application with id single-group-app parsed successfully
>>>>
>>>> Thanks
>>>>
>>>> On Sun, Dec 21, 2014 at 6:22 PM, Udara Liyanage <ud...@wso2.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Token generation has 2,3 admin calls and since token is generated
>>>>> twice per application (since application is parsed twice). That is why you
>>>>> see many logging logs.
>>>>>
>>>>>
>>>>>
>>>>> Touched, not typed. Erroneous words are a feature, not a typo.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Imesh Gunaratne
>>>>
>>>> Technical Lead, WSO2
>>>> Committer & PMC Member, Apache Stratos
>>>>
>>>
>>>
>>> --
>>>
>>> Udara Liyanage
>>> Software Engineer
>>> WSO2, Inc.: http://wso2.com
>>> lean. enterprise. middleware
>>>
>>> web: http://udaraliyanage.wordpress.com
>>> phone: +94 71 443 6897
>>>
>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PMC Member, Apache Stratos
>>
>
>
> --
>
> Udara Liyanage
> Software Engineer
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> web: http://udaraliyanage.wordpress.com
> phone: +94 71 443 6897
>



-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: Why application is parsed twice

Posted by Udara Liyanage <ud...@wso2.com>.
Hi Imesh,

I changed this to application creating time, but could not push the
changes.

On Sun, Dec 21, 2014 at 11:48 PM, Imesh Gunaratne <im...@apache.org> wrote:
>
> Hi Udara,
>
> Thanks for the information, I see the below logic
> in DefaultApplicationParser:
>
> private ApplicationClusterContext createApplicationClusterContext ()
>             throws ApplicationDefinitionException {
>         ...
>         String oAuth_token = createToken(appId);
>         payloadData.add(TOKEN_PAYLOD_PARAM_NAME, oAuth_token);
>
>         String textPayload = payloadData.toString();
>         return new ApplicationClusterContext(cartridgeInfo.getType(),
> clusterId, hostname, textPayload, deploymentPolicy, isLB);
>     }
>
> Shouldn't this happen once per application? As it looks like now an OAuth
> token is generated per cluster. Is this necessary?
>
> Thanks
>
> On Sun, Dec 21, 2014 at 9:55 PM, Udara Liyanage <ud...@wso2.com> wrote:
>
>> Hi Imesh,
>>
>> Below are the admin services using and operations
>>
>> OAuthAdminService - registerOAuthApplicationData
>> IdentityApplicationManagementService - createApplication, getApplication,
>> updateApplication
>>
>> Since authentication handlers does not set the carbon context, there is
>> no way of identifying the user at component level. Thus added a JWT based
>> authenticator, so every admin called is to be authenticated. This is why
>> you see many logs
>>
>> On Sun, Dec 21, 2014 at 8:39 PM, Imesh Gunaratne <im...@apache.org>
>> wrote:
>>>
>>> Can you please explain those admin calls Udara?
>>> I can see ten user logins for an application having two cartridges for
>>> one application parse process:
>>>
>>> [2014-12-21 04:21:56,892]  INFO
>>> {org.apache.stratos.autoscaler.api.AutoScalerServiceImpl} -  Starting to
>>> add application: [application-id] single-group-app
>>> [2014-12-21 04:21:57,005]  INFO
>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>> 04:21:57,005+0530]
>>> [2014-12-21 04:21:57,041]  INFO
>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>> 04:21:57,041+0530]
>>> [2014-12-21 04:21:57,064]  INFO
>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>> 04:21:57,064+0530]
>>> [2014-12-21 04:21:57,093]  INFO
>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>> 04:21:57,093+0530]
>>> [2014-12-21 04:21:57,134]  INFO
>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>> 04:21:57,134+0530]
>>> [2014-12-21 04:21:57,902]  INFO
>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>> 04:21:57,902+0530]
>>> [2014-12-21 04:21:57,912]  INFO
>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>> 04:21:57,911+0530]
>>> [2014-12-21 04:21:57,922]  INFO
>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>> 04:21:57,922+0530]
>>> [2014-12-21 04:21:57,934]  INFO
>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>> 04:21:57,934+0530]
>>> [2014-12-21 04:21:57,957]  INFO
>>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>>  'admin@carbon.super [-1234]' logged in at [2014-12-21
>>> 04:21:57,957+0530]
>>> [2014-12-21 04:21:57,976]  INFO
>>> {org.apache.stratos.autoscaler.applications.parser.DefaultApplicationParser}
>>> -  Application with id single-group-app parsed successfully
>>>
>>> Thanks
>>>
>>> On Sun, Dec 21, 2014 at 6:22 PM, Udara Liyanage <ud...@wso2.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> Token generation has 2,3 admin calls and since token is generated twice
>>>> per application (since application is parsed twice). That is why you see
>>>> many logging logs.
>>>>
>>>>
>>>>
>>>> Touched, not typed. Erroneous words are a feature, not a typo.
>>>>
>>>
>>>
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Technical Lead, WSO2
>>> Committer & PMC Member, Apache Stratos
>>>
>>
>>
>> --
>>
>> Udara Liyanage
>> Software Engineer
>> WSO2, Inc.: http://wso2.com
>> lean. enterprise. middleware
>>
>> web: http://udaraliyanage.wordpress.com
>> phone: +94 71 443 6897
>>
>
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>


-- 

Udara Liyanage
Software Engineer
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

web: http://udaraliyanage.wordpress.com
phone: +94 71 443 6897

Re: Why application is parsed twice

Posted by Imesh Gunaratne <im...@apache.org>.
Hi Udara,

Thanks for the information, I see the below logic
in DefaultApplicationParser:

private ApplicationClusterContext createApplicationClusterContext ()
            throws ApplicationDefinitionException {
        ...
        String oAuth_token = createToken(appId);
        payloadData.add(TOKEN_PAYLOD_PARAM_NAME, oAuth_token);

        String textPayload = payloadData.toString();
        return new ApplicationClusterContext(cartridgeInfo.getType(),
clusterId, hostname, textPayload, deploymentPolicy, isLB);
    }

Shouldn't this happen once per application? As it looks like now an OAuth
token is generated per cluster. Is this necessary?

Thanks

On Sun, Dec 21, 2014 at 9:55 PM, Udara Liyanage <ud...@wso2.com> wrote:

> Hi Imesh,
>
> Below are the admin services using and operations
>
> OAuthAdminService - registerOAuthApplicationData
> IdentityApplicationManagementService - createApplication, getApplication,
> updateApplication
>
> Since authentication handlers does not set the carbon context, there is no
> way of identifying the user at component level. Thus added a JWT based
> authenticator, so every admin called is to be authenticated. This is why
> you see many logs
>
> On Sun, Dec 21, 2014 at 8:39 PM, Imesh Gunaratne <im...@apache.org> wrote:
>>
>> Can you please explain those admin calls Udara?
>> I can see ten user logins for an application having two cartridges for
>> one application parse process:
>>
>> [2014-12-21 04:21:56,892]  INFO
>> {org.apache.stratos.autoscaler.api.AutoScalerServiceImpl} -  Starting to
>> add application: [application-id] single-group-app
>> [2014-12-21 04:21:57,005]  INFO
>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,005+0530]
>> [2014-12-21 04:21:57,041]  INFO
>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,041+0530]
>> [2014-12-21 04:21:57,064]  INFO
>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,064+0530]
>> [2014-12-21 04:21:57,093]  INFO
>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,093+0530]
>> [2014-12-21 04:21:57,134]  INFO
>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,134+0530]
>> [2014-12-21 04:21:57,902]  INFO
>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,902+0530]
>> [2014-12-21 04:21:57,912]  INFO
>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,911+0530]
>> [2014-12-21 04:21:57,922]  INFO
>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,922+0530]
>> [2014-12-21 04:21:57,934]  INFO
>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,934+0530]
>> [2014-12-21 04:21:57,957]  INFO
>> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,957+0530]
>> [2014-12-21 04:21:57,976]  INFO
>> {org.apache.stratos.autoscaler.applications.parser.DefaultApplicationParser}
>> -  Application with id single-group-app parsed successfully
>>
>> Thanks
>>
>> On Sun, Dec 21, 2014 at 6:22 PM, Udara Liyanage <ud...@wso2.com> wrote:
>>
>>> Hi,
>>>
>>> Token generation has 2,3 admin calls and since token is generated twice
>>> per application (since application is parsed twice). That is why you see
>>> many logging logs.
>>>
>>>
>>>
>>> Touched, not typed. Erroneous words are a feature, not a typo.
>>>
>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Technical Lead, WSO2
>> Committer & PMC Member, Apache Stratos
>>
>
>
> --
>
> Udara Liyanage
> Software Engineer
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> web: http://udaraliyanage.wordpress.com
> phone: +94 71 443 6897
>



-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: Why application is parsed twice

Posted by Udara Liyanage <ud...@wso2.com>.
Hi Imesh,

Below are the admin services using and operations

OAuthAdminService - registerOAuthApplicationData
IdentityApplicationManagementService - createApplication, getApplication,
updateApplication

Since authentication handlers does not set the carbon context, there is no
way of identifying the user at component level. Thus added a JWT based
authenticator, so every admin called is to be authenticated. This is why
you see many logs

On Sun, Dec 21, 2014 at 8:39 PM, Imesh Gunaratne <im...@apache.org> wrote:
>
> Can you please explain those admin calls Udara?
> I can see ten user logins for an application having two cartridges for one
> application parse process:
>
> [2014-12-21 04:21:56,892]  INFO
> {org.apache.stratos.autoscaler.api.AutoScalerServiceImpl} -  Starting to
> add application: [application-id] single-group-app
> [2014-12-21 04:21:57,005]  INFO
> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,005+0530]
> [2014-12-21 04:21:57,041]  INFO
> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,041+0530]
> [2014-12-21 04:21:57,064]  INFO
> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,064+0530]
> [2014-12-21 04:21:57,093]  INFO
> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,093+0530]
> [2014-12-21 04:21:57,134]  INFO
> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,134+0530]
> [2014-12-21 04:21:57,902]  INFO
> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,902+0530]
> [2014-12-21 04:21:57,912]  INFO
> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,911+0530]
> [2014-12-21 04:21:57,922]  INFO
> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,922+0530]
> [2014-12-21 04:21:57,934]  INFO
> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,934+0530]
> [2014-12-21 04:21:57,957]  INFO
> {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
>  'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,957+0530]
> [2014-12-21 04:21:57,976]  INFO
> {org.apache.stratos.autoscaler.applications.parser.DefaultApplicationParser}
> -  Application with id single-group-app parsed successfully
>
> Thanks
>
> On Sun, Dec 21, 2014 at 6:22 PM, Udara Liyanage <ud...@wso2.com> wrote:
>
>> Hi,
>>
>> Token generation has 2,3 admin calls and since token is generated twice
>> per application (since application is parsed twice). That is why you see
>> many logging logs.
>>
>>
>>
>> Touched, not typed. Erroneous words are a feature, not a typo.
>>
>
>
>
> --
> Imesh Gunaratne
>
> Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>


-- 

Udara Liyanage
Software Engineer
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

web: http://udaraliyanage.wordpress.com
phone: +94 71 443 6897

Re: Why application is parsed twice

Posted by Imesh Gunaratne <im...@apache.org>.
Can you please explain those admin calls Udara?
I can see ten user logins for an application having two cartridges for one
application parse process:

[2014-12-21 04:21:56,892]  INFO
{org.apache.stratos.autoscaler.api.AutoScalerServiceImpl} -  Starting to
add application: [application-id] single-group-app
[2014-12-21 04:21:57,005]  INFO
{org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
 'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,005+0530]
[2014-12-21 04:21:57,041]  INFO
{org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
 'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,041+0530]
[2014-12-21 04:21:57,064]  INFO
{org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
 'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,064+0530]
[2014-12-21 04:21:57,093]  INFO
{org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
 'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,093+0530]
[2014-12-21 04:21:57,134]  INFO
{org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
 'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,134+0530]
[2014-12-21 04:21:57,902]  INFO
{org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
 'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,902+0530]
[2014-12-21 04:21:57,912]  INFO
{org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
 'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,911+0530]
[2014-12-21 04:21:57,922]  INFO
{org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
 'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,922+0530]
[2014-12-21 04:21:57,934]  INFO
{org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
 'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,934+0530]
[2014-12-21 04:21:57,957]  INFO
{org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -
 'admin@carbon.super [-1234]' logged in at [2014-12-21 04:21:57,957+0530]
[2014-12-21 04:21:57,976]  INFO
{org.apache.stratos.autoscaler.applications.parser.DefaultApplicationParser}
-  Application with id single-group-app parsed successfully

Thanks

On Sun, Dec 21, 2014 at 6:22 PM, Udara Liyanage <ud...@wso2.com> wrote:

> Hi,
>
> Token generation has 2,3 admin calls and since token is generated twice
> per application (since application is parsed twice). That is why you see
> many logging logs.
>
>
>
> Touched, not typed. Erroneous words are a feature, not a typo.
>



-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: Why application is parsed twice

Posted by Udara Liyanage <ud...@wso2.com>.
Hi,

Token generation has 2,3 admin calls and since token is generated twice per
application (since application is parsed twice). That is why you see many
logging logs.



Touched, not typed. Erroneous words are a feature, not a typo.

Re: Why application is parsed twice

Posted by Imesh Gunaratne <im...@apache.org>.
Yes we could persist the parsed application and re-use it in the deployment
process. We could do this improvement.
BTW why do we see a list of user login statements in the log during the
application parse process?

Thanks

On Sun, Dec 21, 2014 at 12:54 PM, Udara Liyanage <ud...@wso2.com> wrote:

> Hi,
>
> Application is parsed and  handleApplicationCreated is called. We need to
> improve this to use applicationContext which is created at application
> created time
>
>
>    1. ApplicationContext applicationContext = RegistryManager.getInstance().getApplicationContext(applicationId);
>    2.             if (applicationContext == null) {
>    3.                 throw new RuntimeException("Application not found: " + applicationId);
>    4.             }
>    5.
>    6.             ApplicationParser applicationParser = new DefaultApplicationParser();
>    7.             Application application = applicationParser.parse(applicationContext);
>    8.             ApplicationBuilder.handleApplicationCreated(application, applicationParser.getApplicationClusterContexts());
>
>
> On Sun, Dec 21, 2014 at 12:22 PM, Udara Liyanage <ud...@wso2.com> wrote:
>>
>> Hi,
>>
>> Sorry for the buzz, application is parsed if not exists in
>> applicationContext.
>>
>> On Sun, Dec 21, 2014 at 12:00 PM, Udara Liyanage <ud...@wso2.com> wrote:
>>>
>>> Hi Imesh, Reka,
>>>
>>> Just wanted to know why application is parsed at
>>>     1) application creation time
>>>     2) application deployment time
>>>
>>> Currently token is created at application parsing time(ideally should
>>> not), thus token creating occurred twice.
>>>
>>> --
>>>
>>> Udara Liyanage
>>> Software Engineer
>>> WSO2, Inc.: http://wso2.com
>>> lean. enterprise. middleware
>>>
>>> web: http://udaraliyanage.wordpress.com
>>> phone: +94 71 443 6897
>>>
>>
>>
>> --
>>
>> Udara Liyanage
>> Software Engineer
>> WSO2, Inc.: http://wso2.com
>> lean. enterprise. middleware
>>
>> web: http://udaraliyanage.wordpress.com
>> phone: +94 71 443 6897
>>
>
>
> --
>
> Udara Liyanage
> Software Engineer
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> web: http://udaraliyanage.wordpress.com
> phone: +94 71 443 6897
>



-- 
Imesh Gunaratne

Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: Why application is parsed twice

Posted by Udara Liyanage <ud...@wso2.com>.
Hi,

Application is parsed and  handleApplicationCreated is called. We need to
improve this to use applicationContext which is created at application
created time


   1. ApplicationContext applicationContext =
RegistryManager.getInstance().getApplicationContext(applicationId);
   2.             if (applicationContext == null) {
   3.                 throw new RuntimeException("Application not
found: " + applicationId);
   4.             }
   5.
   6.             ApplicationParser applicationParser = new
DefaultApplicationParser();
   7.             Application application =
applicationParser.parse(applicationContext);
   8.
ApplicationBuilder.handleApplicationCreated(application,
applicationParser.getApplicationClusterContexts());


On Sun, Dec 21, 2014 at 12:22 PM, Udara Liyanage <ud...@wso2.com> wrote:
>
> Hi,
>
> Sorry for the buzz, application is parsed if not exists in
> applicationContext.
>
> On Sun, Dec 21, 2014 at 12:00 PM, Udara Liyanage <ud...@wso2.com> wrote:
>>
>> Hi Imesh, Reka,
>>
>> Just wanted to know why application is parsed at
>>     1) application creation time
>>     2) application deployment time
>>
>> Currently token is created at application parsing time(ideally should
>> not), thus token creating occurred twice.
>>
>> --
>>
>> Udara Liyanage
>> Software Engineer
>> WSO2, Inc.: http://wso2.com
>> lean. enterprise. middleware
>>
>> web: http://udaraliyanage.wordpress.com
>> phone: +94 71 443 6897
>>
>
>
> --
>
> Udara Liyanage
> Software Engineer
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> web: http://udaraliyanage.wordpress.com
> phone: +94 71 443 6897
>


-- 

Udara Liyanage
Software Engineer
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

web: http://udaraliyanage.wordpress.com
phone: +94 71 443 6897

Re: Why application is parsed twice

Posted by Udara Liyanage <ud...@wso2.com>.
Hi,

Sorry for the buzz, application is parsed if not exists in
applicationContext.

On Sun, Dec 21, 2014 at 12:00 PM, Udara Liyanage <ud...@wso2.com> wrote:
>
> Hi Imesh, Reka,
>
> Just wanted to know why application is parsed at
>     1) application creation time
>     2) application deployment time
>
> Currently token is created at application parsing time(ideally should
> not), thus token creating occurred twice.
>
> --
>
> Udara Liyanage
> Software Engineer
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> web: http://udaraliyanage.wordpress.com
> phone: +94 71 443 6897
>


-- 

Udara Liyanage
Software Engineer
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

web: http://udaraliyanage.wordpress.com
phone: +94 71 443 6897