You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Oliver Jelinski (JIRA)" <ji...@apache.org> on 2011/09/23 13:58:26 UTC

[jira] [Created] (CAMEL-4480) RuntimeCamelException "Ambiguous Parameter Mapping" must not be thrown, if there are parameters of the same type but with different QNames in ServiceInterfaceStrategy

RuntimeCamelException "Ambiguous Parameter Mapping" must not be thrown, if there are parameters of the same type but with different QNames in ServiceInterfaceStrategy
----------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: CAMEL-4480
                 URL: https://issues.apache.org/jira/browse/CAMEL-4480
             Project: Camel
          Issue Type: Bug
          Components: camel-soap
    Affects Versions: 2.8.1
            Reporter: Oliver Jelinski


In different WebMethods I have parameters of the same type, but with different QNames. The following if-clause (in ServiceInterfaceStrategy.analyzeServiceInterface(..)) throws an exeption in these cases (thrown if NOT QNameOfMethod1 equals QNameOfMethod2), but it should on the contrary throw an exception if the QNames ARE equal:

                if (inTypeNameToQName.containsKey(ti.getTypeName())
                    && (!(ti.getTypeName().equals("javax.xml.ws.Holder")))
                    && (!(inTypeNameToQName.get(ti.getTypeName()).equals(ti.getElName())))) {
                    throw new RuntimeCamelException("Ambiguous parameter mapping. The type [ "
                                                    + ti.getTypeName()
                                                    + " ] is already mapped to a QName in this context.");
                }

The "NOT" must be deleted:

...
&& (inTypeNameToQName.get(ti.getTypeName()).equals(ti.getElName())))
...


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CAMEL-4480) RuntimeCamelException "Ambiguous Parameter Mapping" must not be thrown, if there are parameters of the same type but with different QNames in ServiceInterfaceStrategy

Posted by "Willem Jiang (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang resolved CAMEL-4480.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 2.9.0
                   2.8.2
    
> RuntimeCamelException "Ambiguous Parameter Mapping" must not be thrown, if there are parameters of the same type but with different QNames in ServiceInterfaceStrategy
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4480
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4480
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-soap
>    Affects Versions: 2.8.1
>            Reporter: Oliver Jelinski
>            Assignee: Willem Jiang
>             Fix For: 2.8.2, 2.9.0
>
>         Attachments: camel-4480-trunk.patch
>
>
> In different WebMethods I have parameters of the same type, but with different QNames. The following if-clause (in ServiceInterfaceStrategy.analyzeServiceInterface(..)) throws an exeption in these cases (thrown if NOT QNameOfMethod1 equals QNameOfMethod2), but it should on the contrary throw an exception if the QNames ARE equal:
>                 if (inTypeNameToQName.containsKey(ti.getTypeName())
>                     && (!(ti.getTypeName().equals("javax.xml.ws.Holder")))
>                     && (!(inTypeNameToQName.get(ti.getTypeName()).equals(ti.getElName())))) {
>                     throw new RuntimeCamelException("Ambiguous parameter mapping. The type [ "
>                                                     + ti.getTypeName()
>                                                     + " ] is already mapped to a QName in this context.");
>                 }
> The "NOT" must be deleted:
> ...
> && (inTypeNameToQName.get(ti.getTypeName()).equals(ti.getElName())))
> ...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (CAMEL-4480) RuntimeCamelException "Ambiguous Parameter Mapping" must not be thrown, if there are parameters of the same type but with different QNames in ServiceInterfaceStrategy

Posted by "Oliver Jelinski (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Jelinski closed CAMEL-4480.
----------------------------------


works for me. Thank you very much.
                
> RuntimeCamelException "Ambiguous Parameter Mapping" must not be thrown, if there are parameters of the same type but with different QNames in ServiceInterfaceStrategy
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4480
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4480
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-soap
>    Affects Versions: 2.8.1
>            Reporter: Oliver Jelinski
>            Assignee: Willem Jiang
>             Fix For: 2.8.2, 2.9.0
>
>         Attachments: camel-4480-trunk.patch
>
>
> In different WebMethods I have parameters of the same type, but with different QNames. The following if-clause (in ServiceInterfaceStrategy.analyzeServiceInterface(..)) throws an exeption in these cases (thrown if NOT QNameOfMethod1 equals QNameOfMethod2), but it should on the contrary throw an exception if the QNames ARE equal:
>                 if (inTypeNameToQName.containsKey(ti.getTypeName())
>                     && (!(ti.getTypeName().equals("javax.xml.ws.Holder")))
>                     && (!(inTypeNameToQName.get(ti.getTypeName()).equals(ti.getElName())))) {
>                     throw new RuntimeCamelException("Ambiguous parameter mapping. The type [ "
>                                                     + ti.getTypeName()
>                                                     + " ] is already mapped to a QName in this context.");
>                 }
> The "NOT" must be deleted:
> ...
> && (inTypeNameToQName.get(ti.getTypeName()).equals(ti.getElName())))
> ...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CAMEL-4480) RuntimeCamelException "Ambiguous Parameter Mapping" must not be thrown, if there are parameters of the same type but with different QNames in ServiceInterfaceStrategy

Posted by "Rich Newcomb (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Newcomb updated CAMEL-4480:
--------------------------------

    Attachment: camel-4480-trunk.patch

The attached patch expands the multi-part unit test suite to demonstrates the behavior described in this issue.  

The patch also provides a potential fix for the issue. 

Note that the solution recommended in the original issue description will not work. That solution would cause parameters that are reused across multiple web methods to be rejected with an error.   

An alternative solution (as implemented in the patch) is as follows:

1. Change the behavior of the ServiceInterfaceStrategy to log a WARN message in the case where a new QName mapping would override an existing  mapping.  The new mapping will be ignored after the warning. 

2. Move the QName + dataType uniqueness enforcement to the @WebMethod level

The warning is an appropriate alternative to the current error. The ServiceInterfaceStrategy.findQNameForSoapActionOrType(…) operation _could_ return an unexpected value when a dataType is reused within the interface with a different QName; however, this risk is fully mitigated when calling findQNameForSoapActionOrType(…) with a valid soapAction that uniquely identifies the target @WebMethod on the service. At that point the MethodInfo class is queried for the type-to-QName mapping for the method, and the results will be as expected.
                
> RuntimeCamelException "Ambiguous Parameter Mapping" must not be thrown, if there are parameters of the same type but with different QNames in ServiceInterfaceStrategy
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4480
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4480
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-soap
>    Affects Versions: 2.8.1
>            Reporter: Oliver Jelinski
>            Assignee: Rich Newcomb
>         Attachments: camel-4480-trunk.patch
>
>
> In different WebMethods I have parameters of the same type, but with different QNames. The following if-clause (in ServiceInterfaceStrategy.analyzeServiceInterface(..)) throws an exeption in these cases (thrown if NOT QNameOfMethod1 equals QNameOfMethod2), but it should on the contrary throw an exception if the QNames ARE equal:
>                 if (inTypeNameToQName.containsKey(ti.getTypeName())
>                     && (!(ti.getTypeName().equals("javax.xml.ws.Holder")))
>                     && (!(inTypeNameToQName.get(ti.getTypeName()).equals(ti.getElName())))) {
>                     throw new RuntimeCamelException("Ambiguous parameter mapping. The type [ "
>                                                     + ti.getTypeName()
>                                                     + " ] is already mapped to a QName in this context.");
>                 }
> The "NOT" must be deleted:
> ...
> && (inTypeNameToQName.get(ti.getTypeName()).equals(ti.getElName())))
> ...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] [Commented] (CAMEL-4480) RuntimeCamelException "Ambiguous Parameter Mapping" must not be thrown, if there are parameters of the same type but with different QNames in ServiceInterfaceStrategy

Posted by "Willem Jiang (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13123440#comment-13123440 ] 

Willem Jiang commented on CAMEL-4480:
-------------------------------------

Applied patch with thanks to Rich.
I also merged the patch into camel 2.8.x branch.
                
> RuntimeCamelException "Ambiguous Parameter Mapping" must not be thrown, if there are parameters of the same type but with different QNames in ServiceInterfaceStrategy
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4480
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4480
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-soap
>    Affects Versions: 2.8.1
>            Reporter: Oliver Jelinski
>            Assignee: Willem Jiang
>         Attachments: camel-4480-trunk.patch
>
>
> In different WebMethods I have parameters of the same type, but with different QNames. The following if-clause (in ServiceInterfaceStrategy.analyzeServiceInterface(..)) throws an exeption in these cases (thrown if NOT QNameOfMethod1 equals QNameOfMethod2), but it should on the contrary throw an exception if the QNames ARE equal:
>                 if (inTypeNameToQName.containsKey(ti.getTypeName())
>                     && (!(ti.getTypeName().equals("javax.xml.ws.Holder")))
>                     && (!(inTypeNameToQName.get(ti.getTypeName()).equals(ti.getElName())))) {
>                     throw new RuntimeCamelException("Ambiguous parameter mapping. The type [ "
>                                                     + ti.getTypeName()
>                                                     + " ] is already mapped to a QName in this context.");
>                 }
> The "NOT" must be deleted:
> ...
> && (inTypeNameToQName.get(ti.getTypeName()).equals(ti.getElName())))
> ...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (CAMEL-4480) RuntimeCamelException "Ambiguous Parameter Mapping" must not be thrown, if there are parameters of the same type but with different QNames in ServiceInterfaceStrategy

Posted by "Rich Newcomb (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Newcomb reassigned CAMEL-4480:
-----------------------------------

    Assignee: Rich Newcomb
    
> RuntimeCamelException "Ambiguous Parameter Mapping" must not be thrown, if there are parameters of the same type but with different QNames in ServiceInterfaceStrategy
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4480
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4480
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-soap
>    Affects Versions: 2.8.1
>            Reporter: Oliver Jelinski
>            Assignee: Rich Newcomb
>
> In different WebMethods I have parameters of the same type, but with different QNames. The following if-clause (in ServiceInterfaceStrategy.analyzeServiceInterface(..)) throws an exeption in these cases (thrown if NOT QNameOfMethod1 equals QNameOfMethod2), but it should on the contrary throw an exception if the QNames ARE equal:
>                 if (inTypeNameToQName.containsKey(ti.getTypeName())
>                     && (!(ti.getTypeName().equals("javax.xml.ws.Holder")))
>                     && (!(inTypeNameToQName.get(ti.getTypeName()).equals(ti.getElName())))) {
>                     throw new RuntimeCamelException("Ambiguous parameter mapping. The type [ "
>                                                     + ti.getTypeName()
>                                                     + " ] is already mapped to a QName in this context.");
>                 }
> The "NOT" must be deleted:
> ...
> && (inTypeNameToQName.get(ti.getTypeName()).equals(ti.getElName())))
> ...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CAMEL-4480) RuntimeCamelException "Ambiguous Parameter Mapping" must not be thrown, if there are parameters of the same type but with different QNames in ServiceInterfaceStrategy

Posted by "Claus Ibsen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13118706#comment-13118706 ] 

Claus Ibsen commented on CAMEL-4480:
------------------------------------

Can you attach an unit test that reproduces the issue?
                
> RuntimeCamelException "Ambiguous Parameter Mapping" must not be thrown, if there are parameters of the same type but with different QNames in ServiceInterfaceStrategy
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4480
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4480
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-soap
>    Affects Versions: 2.8.1
>            Reporter: Oliver Jelinski
>
> In different WebMethods I have parameters of the same type, but with different QNames. The following if-clause (in ServiceInterfaceStrategy.analyzeServiceInterface(..)) throws an exeption in these cases (thrown if NOT QNameOfMethod1 equals QNameOfMethod2), but it should on the contrary throw an exception if the QNames ARE equal:
>                 if (inTypeNameToQName.containsKey(ti.getTypeName())
>                     && (!(ti.getTypeName().equals("javax.xml.ws.Holder")))
>                     && (!(inTypeNameToQName.get(ti.getTypeName()).equals(ti.getElName())))) {
>                     throw new RuntimeCamelException("Ambiguous parameter mapping. The type [ "
>                                                     + ti.getTypeName()
>                                                     + " ] is already mapped to a QName in this context.");
>                 }
> The "NOT" must be deleted:
> ...
> && (inTypeNameToQName.get(ti.getTypeName()).equals(ti.getElName())))
> ...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (CAMEL-4480) RuntimeCamelException "Ambiguous Parameter Mapping" must not be thrown, if there are parameters of the same type but with different QNames in ServiceInterfaceStrategy

Posted by "Rich Newcomb (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4480?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Newcomb reassigned CAMEL-4480:
-----------------------------------

    Assignee: Willem Jiang  (was: Rich Newcomb)

Willem: would you mind having a look at this patch, since you committed the original multi-part enhancement?
                
> RuntimeCamelException "Ambiguous Parameter Mapping" must not be thrown, if there are parameters of the same type but with different QNames in ServiceInterfaceStrategy
> ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4480
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4480
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-soap
>    Affects Versions: 2.8.1
>            Reporter: Oliver Jelinski
>            Assignee: Willem Jiang
>         Attachments: camel-4480-trunk.patch
>
>
> In different WebMethods I have parameters of the same type, but with different QNames. The following if-clause (in ServiceInterfaceStrategy.analyzeServiceInterface(..)) throws an exeption in these cases (thrown if NOT QNameOfMethod1 equals QNameOfMethod2), but it should on the contrary throw an exception if the QNames ARE equal:
>                 if (inTypeNameToQName.containsKey(ti.getTypeName())
>                     && (!(ti.getTypeName().equals("javax.xml.ws.Holder")))
>                     && (!(inTypeNameToQName.get(ti.getTypeName()).equals(ti.getElName())))) {
>                     throw new RuntimeCamelException("Ambiguous parameter mapping. The type [ "
>                                                     + ti.getTypeName()
>                                                     + " ] is already mapped to a QName in this context.");
>                 }
> The "NOT" must be deleted:
> ...
> && (inTypeNameToQName.get(ti.getTypeName()).equals(ti.getElName())))
> ...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira