You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Aukjan van Belkum (JIRA)" <ji...@apache.org> on 2011/04/29 09:54:03 UTC

[jira] [Created] (CXF-3478) Endpoint address not resolved correctly when message exchange destination is not instance of AbstractHTTPDestination

Endpoint address not resolved correctly when message exchange destination is not instance of AbstractHTTPDestination
--------------------------------------------------------------------------------------------------------------------

                 Key: CXF-3478
                 URL: https://issues.apache.org/jira/browse/CXF-3478
             Project: CXF
          Issue Type: Bug
          Components: JAX-RS
    Affects Versions: 2.3.4, 2.4, 2.3.3, 2.3.2, 2.4.1, 2.3.5
            Reporter: Aukjan van Belkum
            Priority: Minor


Issue occurs (for example) if CXF jaxrs server is called as a consumer in a Camel Route. The jaxrs server is then setup with an direct camel address: 'camel://direct:jaxrsEndpoint', and is fed requests from a camel-jetty component. 

At this point Calls to HttpUtils.getEndpointAddress returns the 'camel://direct:jaxrsEndpoint' address, instead of the actual 'http://' address. This seems to be correct behavior, but is not what the user might expect. 

I am not completely sure where to change this (since I just stared using CXF), but I think it is either: org.apache.cxf.jaxrs.utils.HttpUtils.getEndpointAddress(), where the endpoint is fetched from the destination of the message, or: org.apache.cxf.jaxrs.impl.UriInfoImpl.getBaseUri(), where an extra check can be Build in looking for the existence of:  org.apache.cxf.message.Message.BASE_PATH (which can be set to indicate the base path (I think)), indicating the 'real' HTTP Base Uri, instead of the destination Endpoint.

I am going to make a patch for the second option, but if anyone has a better suggestion, please let me know.


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

[jira] [Resolved] (CXF-3478) Endpoint address not resolved correctly when message exchange destination is not instance of AbstractHTTPDestination

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin resolved CXF-3478.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.3.5
                   2.4.1
         Assignee: Sergey Beryozkin

> Endpoint address not resolved correctly when message exchange destination is not instance of AbstractHTTPDestination
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-3478
>                 URL: https://issues.apache.org/jira/browse/CXF-3478
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2, 2.3.3, 2.4, 2.3.4, 2.4.1, 2.3.5
>            Reporter: Aukjan van Belkum
>            Assignee: Sergey Beryozkin
>            Priority: Minor
>             Fix For: 2.4.1, 2.3.5
>
>         Attachments: patch.txt
>
>
> Issue occurs (for example) if CXF jaxrs server is called as a consumer in a Camel Route. The jaxrs server is then setup with an direct camel address: 'camel://direct:jaxrsEndpoint', and is fed requests from a camel-jetty component. 
> At this point Calls to HttpUtils.getEndpointAddress returns the 'camel://direct:jaxrsEndpoint' address, instead of the actual 'http://' address. This seems to be correct behavior, but is not what the user might expect. 
> I am not completely sure where to change this (since I just stared using CXF), but I think it is either: org.apache.cxf.jaxrs.utils.HttpUtils.getEndpointAddress(), where the endpoint is fetched from the destination of the message, or: org.apache.cxf.jaxrs.impl.UriInfoImpl.getBaseUri(), where an extra check can be Build in looking for the existence of:  org.apache.cxf.message.Message.BASE_PATH (which can be set to indicate the base path (I think)), indicating the 'real' HTTP Base Uri, instead of the destination Endpoint.
> I am going to make a patch for the second option, but if anyone has a better suggestion, please let me know.

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

[jira] [Commented] (CXF-3478) Endpoint address not resolved correctly when message exchange destination is not instance of AbstractHTTPDestination

Posted by "Aukjan van Belkum (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13029810#comment-13029810 ] 

Aukjan van Belkum commented on CXF-3478:
----------------------------------------

Thanks for the quick turnaround on this issue.. I forgive you for not giving credit on this, because of your speed ;) 




> Endpoint address not resolved correctly when message exchange destination is not instance of AbstractHTTPDestination
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-3478
>                 URL: https://issues.apache.org/jira/browse/CXF-3478
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2, 2.3.3, 2.4, 2.3.4, 2.4.1, 2.3.5
>            Reporter: Aukjan van Belkum
>            Assignee: Sergey Beryozkin
>            Priority: Minor
>             Fix For: 2.4.1, 2.3.5
>
>         Attachments: patch.txt
>
>
> Issue occurs (for example) if CXF jaxrs server is called as a consumer in a Camel Route. The jaxrs server is then setup with an direct camel address: 'camel://direct:jaxrsEndpoint', and is fed requests from a camel-jetty component. 
> At this point Calls to HttpUtils.getEndpointAddress returns the 'camel://direct:jaxrsEndpoint' address, instead of the actual 'http://' address. This seems to be correct behavior, but is not what the user might expect. 
> I am not completely sure where to change this (since I just stared using CXF), but I think it is either: org.apache.cxf.jaxrs.utils.HttpUtils.getEndpointAddress(), where the endpoint is fetched from the destination of the message, or: org.apache.cxf.jaxrs.impl.UriInfoImpl.getBaseUri(), where an extra check can be Build in looking for the existence of:  org.apache.cxf.message.Message.BASE_PATH (which can be set to indicate the base path (I think)), indicating the 'real' HTTP Base Uri, instead of the destination Endpoint.
> I am going to make a patch for the second option, but if anyone has a better suggestion, please let me know.

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

[jira] [Commented] (CXF-3478) Endpoint address not resolved correctly when message exchange destination is not instance of AbstractHTTPDestination

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13026922#comment-13026922 ] 

Sergey Beryozkin commented on CXF-3478:
---------------------------------------

Hi, as discussed on IRC, checking for Message.BASE_PATH in 'else' branch, in case it is not AbstractHttpDestination, can provide a fix.
If that works then may be I can also remove

"org.apache.cxf.transport.endpoint.address" altogether

Workaround (till this issue is closed) is also available - please check http://www.talend.com/resources/documentation.php#SF (talend-if-2.7.1.0-examples), spring-security or jaxrs-http-jms demos

> Endpoint address not resolved correctly when message exchange destination is not instance of AbstractHTTPDestination
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-3478
>                 URL: https://issues.apache.org/jira/browse/CXF-3478
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2, 2.3.3, 2.4, 2.3.4, 2.4.1, 2.3.5
>            Reporter: Aukjan van Belkum
>            Priority: Minor
>
> Issue occurs (for example) if CXF jaxrs server is called as a consumer in a Camel Route. The jaxrs server is then setup with an direct camel address: 'camel://direct:jaxrsEndpoint', and is fed requests from a camel-jetty component. 
> At this point Calls to HttpUtils.getEndpointAddress returns the 'camel://direct:jaxrsEndpoint' address, instead of the actual 'http://' address. This seems to be correct behavior, but is not what the user might expect. 
> I am not completely sure where to change this (since I just stared using CXF), but I think it is either: org.apache.cxf.jaxrs.utils.HttpUtils.getEndpointAddress(), where the endpoint is fetched from the destination of the message, or: org.apache.cxf.jaxrs.impl.UriInfoImpl.getBaseUri(), where an extra check can be Build in looking for the existence of:  org.apache.cxf.message.Message.BASE_PATH (which can be set to indicate the base path (I think)), indicating the 'real' HTTP Base Uri, instead of the destination Endpoint.
> I am going to make a patch for the second option, but if anyone has a better suggestion, please let me know.

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

[jira] [Commented] (CXF-3478) Endpoint address not resolved correctly when message exchange destination is not instance of AbstractHTTPDestination

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028731#comment-13028731 ] 

Sergey Beryozkin commented on CXF-3478:
---------------------------------------

Hi, I applied your patch with a minor update:
http://svn.apache.org/viewvc?rev=1099428&view=rev

I just realized I did not acknowledge that it was you patch in the commit message, sorry :-)

My tests with existing Talend Integration Factory Camel demos show that this patch is sufficient, I only needed one minor update to make sure
Message.BASE_PATH such as jms://topic, etc, are handled properly. 

thanks

> Endpoint address not resolved correctly when message exchange destination is not instance of AbstractHTTPDestination
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-3478
>                 URL: https://issues.apache.org/jira/browse/CXF-3478
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2, 2.3.3, 2.4, 2.3.4, 2.4.1, 2.3.5
>            Reporter: Aukjan van Belkum
>            Priority: Minor
>             Fix For: 2.4.1, 2.3.5
>
>         Attachments: patch.txt
>
>
> Issue occurs (for example) if CXF jaxrs server is called as a consumer in a Camel Route. The jaxrs server is then setup with an direct camel address: 'camel://direct:jaxrsEndpoint', and is fed requests from a camel-jetty component. 
> At this point Calls to HttpUtils.getEndpointAddress returns the 'camel://direct:jaxrsEndpoint' address, instead of the actual 'http://' address. This seems to be correct behavior, but is not what the user might expect. 
> I am not completely sure where to change this (since I just stared using CXF), but I think it is either: org.apache.cxf.jaxrs.utils.HttpUtils.getEndpointAddress(), where the endpoint is fetched from the destination of the message, or: org.apache.cxf.jaxrs.impl.UriInfoImpl.getBaseUri(), where an extra check can be Build in looking for the existence of:  org.apache.cxf.message.Message.BASE_PATH (which can be set to indicate the base path (I think)), indicating the 'real' HTTP Base Uri, instead of the destination Endpoint.
> I am going to make a patch for the second option, but if anyone has a better suggestion, please let me know.

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

[jira] [Updated] (CXF-3478) Endpoint address not resolved correctly when message exchange destination is not instance of AbstractHTTPDestination

Posted by "Aukjan van Belkum (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3478?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aukjan van Belkum updated CXF-3478:
-----------------------------------

    Attachment: patch.txt

As discussed in IRC: Patch includes changes made to HttpUtils.getEndpointAddress, to also check the Message.BASE_PATH (if it exists).

> Endpoint address not resolved correctly when message exchange destination is not instance of AbstractHTTPDestination
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-3478
>                 URL: https://issues.apache.org/jira/browse/CXF-3478
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2, 2.3.3, 2.4, 2.3.4, 2.4.1, 2.3.5
>            Reporter: Aukjan van Belkum
>            Priority: Minor
>         Attachments: patch.txt
>
>
> Issue occurs (for example) if CXF jaxrs server is called as a consumer in a Camel Route. The jaxrs server is then setup with an direct camel address: 'camel://direct:jaxrsEndpoint', and is fed requests from a camel-jetty component. 
> At this point Calls to HttpUtils.getEndpointAddress returns the 'camel://direct:jaxrsEndpoint' address, instead of the actual 'http://' address. This seems to be correct behavior, but is not what the user might expect. 
> I am not completely sure where to change this (since I just stared using CXF), but I think it is either: org.apache.cxf.jaxrs.utils.HttpUtils.getEndpointAddress(), where the endpoint is fetched from the destination of the message, or: org.apache.cxf.jaxrs.impl.UriInfoImpl.getBaseUri(), where an extra check can be Build in looking for the existence of:  org.apache.cxf.message.Message.BASE_PATH (which can be set to indicate the base path (I think)), indicating the 'real' HTTP Base Uri, instead of the destination Endpoint.
> I am going to make a patch for the second option, but if anyone has a better suggestion, please let me know.

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

[jira] [Commented] (CXF-3478) Endpoint address not resolved correctly when message exchange destination is not instance of AbstractHTTPDestination

Posted by "Christian Schneider (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13026910#comment-13026910 ] 

Christian Schneider commented on CXF-3478:
------------------------------------------

The code in org.apache.cxf.jaxrs.utils.HttpUtils.getEndpointAddress(Message) looks wrong to me. It first checks if the destination is of type AbstractHTTPDestination and then decides if it should use the property "org.apache.cxf.transport.endpoint.address" or the address from the endpoint. I think it would be better to always use the property if it is present. I am not sure though if there could be problems if the transport is a non http transport e.g. jms.

In general I think the getEndpointAddress is the better place to fix. I will also ask Sergey as he has written most of the jaxrs code.


> Endpoint address not resolved correctly when message exchange destination is not instance of AbstractHTTPDestination
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-3478
>                 URL: https://issues.apache.org/jira/browse/CXF-3478
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2, 2.3.3, 2.4, 2.3.4, 2.4.1, 2.3.5
>            Reporter: Aukjan van Belkum
>            Priority: Minor
>
> Issue occurs (for example) if CXF jaxrs server is called as a consumer in a Camel Route. The jaxrs server is then setup with an direct camel address: 'camel://direct:jaxrsEndpoint', and is fed requests from a camel-jetty component. 
> At this point Calls to HttpUtils.getEndpointAddress returns the 'camel://direct:jaxrsEndpoint' address, instead of the actual 'http://' address. This seems to be correct behavior, but is not what the user might expect. 
> I am not completely sure where to change this (since I just stared using CXF), but I think it is either: org.apache.cxf.jaxrs.utils.HttpUtils.getEndpointAddress(), where the endpoint is fetched from the destination of the message, or: org.apache.cxf.jaxrs.impl.UriInfoImpl.getBaseUri(), where an extra check can be Build in looking for the existence of:  org.apache.cxf.message.Message.BASE_PATH (which can be set to indicate the base path (I think)), indicating the 'real' HTTP Base Uri, instead of the destination Endpoint.
> I am going to make a patch for the second option, but if anyone has a better suggestion, please let me know.

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