You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Calvin R Smith (JIRA)" <ji...@apache.org> on 2008/11/19 22:54:44 UTC

[jira] Created: (AXIS2-4137) getAxisConfiguration cannot be called twice

getAxisConfiguration cannot be called twice
-------------------------------------------

                 Key: AXIS2-4137
                 URL: https://issues.apache.org/jira/browse/AXIS2-4137
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: deployment
    Affects Versions: 1.4.1
            Reporter: Calvin R Smith
         Attachments: patch-01.txt

It is not possible to call getAxisConfiguration twice as the second time since each time the method is called it creates a new AxisConfiguration from scratch instead of just returnign the one created last time


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-4137) getAxisConfiguration cannot be called twice

Posted by "Calvin R Smith (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Calvin R Smith updated AXIS2-4137:
----------------------------------

    Attachment: patch-01.txt

> getAxisConfiguration cannot be called twice
> -------------------------------------------
>
>                 Key: AXIS2-4137
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4137
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: deployment
>    Affects Versions: 1.4.1
>            Reporter: Calvin R Smith
>         Attachments: patch-01.txt
>
>
> It is not possible to call getAxisConfiguration twice as the second time since each time the method is called it creates a new AxisConfiguration from scratch instead of just returnign the one created last time

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-4137) getAxisConfiguration cannot be called twice

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652170#action_12652170 ] 

Andreas Veithen commented on AXIS2-4137:
----------------------------------------

I think that by design, AxisConfigurator#getAxisConfiguration is supposed to be called only once. This is confirmed by looking at the existing implementations of AxisConfigurator. The fact that the result of getAxisConfiguration is undefined when called more than once on the same AxisConfigurator instance should be better documented, but why would you like to call it twice?

> getAxisConfiguration cannot be called twice
> -------------------------------------------
>
>                 Key: AXIS2-4137
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4137
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: deployment
>    Affects Versions: 1.4.1
>            Reporter: Calvin R Smith
>         Attachments: patch-01.txt
>
>
> It is not possible to call getAxisConfiguration twice since each time after the first time the method is called it creates a new AxisConfiguration from scratch instead of just returnign the one created last time

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-4137) getAxisConfiguration cannot be called twice

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652574#action_12652574 ] 

Andreas Veithen commented on AXIS2-4137:
----------------------------------------

The solution in this case would be to create your own subclass of URLBasedAxisConfigurator and to override the getAxisConfiguration method.

> getAxisConfiguration cannot be called twice
> -------------------------------------------
>
>                 Key: AXIS2-4137
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4137
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: deployment
>    Affects Versions: 1.4.1
>            Reporter: Calvin R Smith
>         Attachments: patch-01.txt
>
>
> It is not possible to call getAxisConfiguration twice since each time after the first time the method is called it creates a new AxisConfiguration from scratch instead of just returnign the one created last time

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-4137) getAxisConfiguration cannot be called twice

Posted by "Calvin R Smith (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-4137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Calvin R Smith updated AXIS2-4137:
----------------------------------

    Description: 
It is not possible to call getAxisConfiguration twice since each time after the first time the method is called it creates a new AxisConfiguration from scratch instead of just returnign the one created last time


  was:
It is not possible to call getAxisConfiguration twice as the second time since each time the method is called it creates a new AxisConfiguration from scratch instead of just returnign the one created last time



> getAxisConfiguration cannot be called twice
> -------------------------------------------
>
>                 Key: AXIS2-4137
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4137
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: deployment
>    Affects Versions: 1.4.1
>            Reporter: Calvin R Smith
>         Attachments: patch-01.txt
>
>
> It is not possible to call getAxisConfiguration twice since each time after the first time the method is called it creates a new AxisConfiguration from scratch instead of just returnign the one created last time

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Issue Comment Edited: (AXIS2-4137) getAxisConfiguration cannot be called twice

Posted by "Calvin R Smith (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652197#action_12652197 ] 

crsscl edited comment on AXIS2-4137 at 12/1/08 4:48 PM:
----------------------------------------------------------------

What I would like to do is set some parameter's upon creation:

AxisConfigurator axisConfigurator = new URLBasedAxisConfigurator(axis2XmlUrl, null);
AxisConfiguration axisConfig = axisConfigurator.getAxisConfiguration();
axisConfig.addParameter("param1", param1);
configurationContext = ConfigurationContextFactory.createConfigurationContext(axisConfigurator);

However, ConfigurationContextFactory.createConfigurationContext calls getAxisConfiguration which recreates the AxisConfiguration thus killing my added parameter.

Now of course you could do:
configurationContext = ConfigurationContextFactory.createConfigurationContextFromURIs(axis2XmlUrl,null);
AxisConfiguration axisConfig = configurationContext.getAxisConfiguration();
axisConfig.addParameter("param1", param1);

However, this adds the parameter after the ConfigurationContext is created.  Now let's say you have a TransportSender that wants to use the added parameter in it's init method.  TransportSender.init is called from ConfigurationContextFactory so the parameter will not be available yet.



      was (Author: crsscl):
    What I would like to do is set some parameter's upon creation:

AxisConfigurator axisConfigurator = new MyAxisConfigurator(axis2XmlUrl, null);
AxisConfiguration axisConfig = axisConfigurator.getAxisConfiguration();
axisConfig.addParameter("param1", param1);
configurationContext = ConfigurationContextFactory.createConfigurationContext(axisConfigurator);

However, ConfigurationContextFactory.createConfigurationContext calls getAxisConfiguration which recreates the AxisConfiguration thus killing my added parameter.

Now of course you could do:
configurationContext = ConfigurationContextFactory.createConfigurationContextFromURIs(axis2XmlUrl,null);
AxisConfiguration axisConfig = configurationContext.getAxisConfiguration();
axisConfig.addParameter("param1", param1);

However, this adds the parameter after the ConfigurationContext is created.  Now let's say you have a TransportSender that wants to use the added parameter in it's init method.  TransportSender.init is called from ConfigurationContextFactory so the parameter will not be available yet.


  
> getAxisConfiguration cannot be called twice
> -------------------------------------------
>
>                 Key: AXIS2-4137
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4137
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: deployment
>    Affects Versions: 1.4.1
>            Reporter: Calvin R Smith
>         Attachments: patch-01.txt
>
>
> It is not possible to call getAxisConfiguration twice since each time after the first time the method is called it creates a new AxisConfiguration from scratch instead of just returnign the one created last time

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-4137) getAxisConfiguration cannot be called twice

Posted by "Calvin R Smith (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652197#action_12652197 ] 

Calvin R Smith commented on AXIS2-4137:
---------------------------------------

What I would like to do is set some parameter's upon creation:

AxisConfigurator axisConfigurator = new MyAxisConfigurator(axis2XmlUrl, null);
AxisConfiguration axisConfig = axisConfigurator.getAxisConfiguration();
axisConfig.addParameter("param1", param1);
configurationContext = ConfigurationContextFactory.createConfigurationContext(axisConfigurator);

However, ConfigurationContextFactory.createConfigurationContext calls getAxisConfiguration which recreates the AxisConfiguration thus killing my added parameter.

Now of course you could do:
configurationContext = ConfigurationContextFactory.createConfigurationContextFromURIs(axis2XmlUrl,null);
AxisConfiguration axisConfig = configurationContext.getAxisConfiguration();
axisConfig.addParameter("param1", param1);

However, this adds the parameter after the ConfigurationContext is created.  Now let's say you have a TransportSender that wants to use the added parameter in it's init method.  TransportSender.init is called from ConfigurationContextFactory so the parameter will not be available yet.



> getAxisConfiguration cannot be called twice
> -------------------------------------------
>
>                 Key: AXIS2-4137
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4137
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: deployment
>    Affects Versions: 1.4.1
>            Reporter: Calvin R Smith
>         Attachments: patch-01.txt
>
>
> It is not possible to call getAxisConfiguration twice since each time after the first time the method is called it creates a new AxisConfiguration from scratch instead of just returnign the one created last time

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-4137) getAxisConfiguration cannot be called twice

Posted by "Calvin R Smith (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652654#action_12652654 ] 

Calvin R Smith commented on AXIS2-4137:
---------------------------------------

That is what I ended up doing, however, it feels like a hack to me since it's only needed due to some implementation details of AxisConfiguration and the implementation could change to return the already created object, as proposed in my patch, without changing the current contract and clarifing this point.


> getAxisConfiguration cannot be called twice
> -------------------------------------------
>
>                 Key: AXIS2-4137
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4137
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: deployment
>    Affects Versions: 1.4.1
>            Reporter: Calvin R Smith
>         Attachments: patch-01.txt
>
>
> It is not possible to call getAxisConfiguration twice since each time after the first time the method is called it creates a new AxisConfiguration from scratch instead of just returnign the one created last time

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org