You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Christian Connert (JIRA)" <ji...@apache.org> on 2009/12/02 16:02:20 UTC

[jira] Created: (CXF-2570) ServletDestinationFacotry and Tomcat can't locate services

ServletDestinationFacotry and Tomcat can't locate services
----------------------------------------------------------

                 Key: CXF-2570
                 URL: https://issues.apache.org/jira/browse/CXF-2570
             Project: CXF
          Issue Type: Bug
         Environment:   	
« Hide
System:
2.6.28-15-generic #52-Ubuntu SMP Wed Sep 9 10:48:52 UTC 2009 x86_64 GNU/Linux

Java:
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)

Apache CXF 2.2.3 (not in version list)

            Reporter: Christian Connert


The problem is that the service destinations aren't found by the destination factory.
I think this problem isn't Tomcat specific. It should occur if cxf is deployed as a war inside some application server.
I would suggest the following workaround:

1.) Implement a ServletTransportFactory (see attachment 1)
2.) Register this ServletTransportFactory in the default cxf.xml (classpath root, see attachment 2)

As a clean fix the ServletTransportFactory should make the static String getTrimmedPath(String path) method to a protected non static method. Than it can be easily overriden by custom subclasses.

Greetings



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


[jira] Updated: (CXF-2570) ServletDestinationFacotry and Tomcat can't locate services

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

Christian Connert updated CXF-2570:
-----------------------------------

    Attachment: cxf.xml
                TomcatDestinationFactory.java

> ServletDestinationFacotry and Tomcat can't locate services
> ----------------------------------------------------------
>
>                 Key: CXF-2570
>                 URL: https://issues.apache.org/jira/browse/CXF-2570
>             Project: CXF
>          Issue Type: Bug
>         Environment:   	
> « Hide
> System:
> 2.6.28-15-generic #52-Ubuntu SMP Wed Sep 9 10:48:52 UTC 2009 x86_64 GNU/Linux
> Java:
> java version "1.6.0_16"
> Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
> Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)
> Apache CXF 2.2.3 (not in version list)
>            Reporter: Christian Connert
>         Attachments: cxf.xml, TomcatDestinationFactory.java
>
>
> The problem is that the service destinations aren't found by the destination factory.
> I think this problem isn't Tomcat specific. It should occur if cxf is deployed as a war inside some application server.
> I would suggest the following workaround:
> 1.) Implement a ServletTransportFactory (see attachment 1)
> 2.) Register this ServletTransportFactory in the default cxf.xml (classpath root, see attachment 2)
> As a clean fix the ServletTransportFactory should make the static String getTrimmedPath(String path) method to a protected non static method. Than it can be easily overriden by custom subclasses.
> Greetings

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


[jira] Commented: (CXF-2570) ServletDestinationFacotry and Tomcat can't locate services

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

Daniel Kulp commented on CXF-2570:
----------------------------------


I'm trying to figure out exactly what the problem is.   What problem are you seeing that is requiring this?

Basically, I'd rather fix the ServletTransportFactory (or the CXFServlet) if something is needed there, but I really kind of need to know what the problem is.   Do you have a testcase or something that shows the problem?



> ServletDestinationFacotry and Tomcat can't locate services
> ----------------------------------------------------------
>
>                 Key: CXF-2570
>                 URL: https://issues.apache.org/jira/browse/CXF-2570
>             Project: CXF
>          Issue Type: Bug
>         Environment:   	
> « Hide
> System:
> 2.6.28-15-generic #52-Ubuntu SMP Wed Sep 9 10:48:52 UTC 2009 x86_64 GNU/Linux
> Java:
> java version "1.6.0_16"
> Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
> Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)
> Apache CXF 2.2.3 (not in version list)
>            Reporter: Christian Connert
>         Attachments: cxf.xml, TomcatDestinationFactory.java
>
>
> The problem is that the service destinations aren't found by the destination factory.
> I think this problem isn't Tomcat specific. It should occur if cxf is deployed as a war inside some application server.
> I would suggest the following workaround:
> 1.) Implement a ServletTransportFactory (see attachment 1)
> 2.) Register this ServletTransportFactory in the default cxf.xml (classpath root, see attachment 2)
> As a clean fix the ServletTransportFactory should make the static String getTrimmedPath(String path) method to a protected non static method. Than it can be easily overriden by custom subclasses.
> Greetings

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


[jira] Commented: (CXF-2570) ServletDestinationFacotry and Tomcat can't locate services

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

Daniel Kulp commented on CXF-2570:
----------------------------------


I'm pretty sure this is "working as designed" more or less.   In your cxf-servlet.xml or beans or whatever where you define your jaxws:endpoint things, are you putting address attributes on them to define the address (should be just "/OrderService" in your case)?     If not, you need to when using a Servlet.    





> ServletDestinationFacotry and Tomcat can't locate services
> ----------------------------------------------------------
>
>                 Key: CXF-2570
>                 URL: https://issues.apache.org/jira/browse/CXF-2570
>             Project: CXF
>          Issue Type: Bug
>         Environment:   	
> « Hide
> System:
> 2.6.28-15-generic #52-Ubuntu SMP Wed Sep 9 10:48:52 UTC 2009 x86_64 GNU/Linux
> Java:
> java version "1.6.0_16"
> Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
> Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)
> Apache CXF 2.2.3 (not in version list)
>            Reporter: Christian Connert
>         Attachments: cxf.xml, TomcatDestinationFactory.java
>
>
> The problem is that the service destinations aren't found by the destination factory.
> I think this problem isn't Tomcat specific. It should occur if cxf is deployed as a war inside some application server.
> I would suggest the following workaround:
> 1.) Implement a ServletTransportFactory (see attachment 1)
> 2.) Register this ServletTransportFactory in the default cxf.xml (classpath root, see attachment 2)
> As a clean fix the ServletTransportFactory should make the static String getTrimmedPath(String path) method to a protected non static method. Than it can be easily overriden by custom subclasses.
> Greetings

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


[jira] Closed: (CXF-2570) ServletDestinationFacotry and Tomcat can't locate services

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

Christian Connert closed CXF-2570.
----------------------------------

    Resolution: Invalid

Thanks for the information. I would appreciate if you could include this into the documentation.

> ServletDestinationFacotry and Tomcat can't locate services
> ----------------------------------------------------------
>
>                 Key: CXF-2570
>                 URL: https://issues.apache.org/jira/browse/CXF-2570
>             Project: CXF
>          Issue Type: Bug
>         Environment:   	
> « Hide
> System:
> 2.6.28-15-generic #52-Ubuntu SMP Wed Sep 9 10:48:52 UTC 2009 x86_64 GNU/Linux
> Java:
> java version "1.6.0_16"
> Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
> Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)
> Apache CXF 2.2.3 (not in version list)
>            Reporter: Christian Connert
>         Attachments: cxf.xml, TomcatDestinationFactory.java
>
>
> The problem is that the service destinations aren't found by the destination factory.
> I think this problem isn't Tomcat specific. It should occur if cxf is deployed as a war inside some application server.
> I would suggest the following workaround:
> 1.) Implement a ServletTransportFactory (see attachment 1)
> 2.) Register this ServletTransportFactory in the default cxf.xml (classpath root, see attachment 2)
> As a clean fix the ServletTransportFactory should make the static String getTrimmedPath(String path) method to a protected non static method. Than it can be easily overriden by custom subclasses.
> Greetings

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


[jira] Commented: (CXF-2570) ServletDestinationFacotry and Tomcat can't locate services

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

Christian Connert commented on CXF-2570:
----------------------------------------

O.k,

I'm trying to descripe the problem in detail:

first I've some wsdl with the following soap location:

<soap:address location="http://192.168.130.7:8080/BasicBusinessServices/services/OrderService" />

It's also used by clients to know the location of the service endpoint.

The ServletTransportFactory only removes the prefixs http://localhost/ and https://localhost/, thus in my case no prefixes are removed and the services are stored by the full path in the destinations map.

When invoking the service the ServletController uses the following line in the invoke method (line 131):

String address = request.getPathInfo() == null ? "" : request.getPathInfo();

For my sample this call returns "/OrderService", but since the ServletTransportFactory destinations map uses the full path as key (http://192.168.130.7:8080/BasicBusinessServices/services/OrderService) the ServletController calls ServletDestination d = getDestination(ei.getAddress()); (line 135) but this returns null and the call ends in the following code (line 153 - 157) of the ServletController:

 if (d == null || d.getMessageObserver() == null) {                        
                        LOG.warning("Can't find the request for " 
                                    + request.getRequestURL() + "'s Observer ");
                        generateNotFound(request, res);
 } 

> ServletDestinationFacotry and Tomcat can't locate services
> ----------------------------------------------------------
>
>                 Key: CXF-2570
>                 URL: https://issues.apache.org/jira/browse/CXF-2570
>             Project: CXF
>          Issue Type: Bug
>         Environment:   	
> « Hide
> System:
> 2.6.28-15-generic #52-Ubuntu SMP Wed Sep 9 10:48:52 UTC 2009 x86_64 GNU/Linux
> Java:
> java version "1.6.0_16"
> Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
> Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)
> Apache CXF 2.2.3 (not in version list)
>            Reporter: Christian Connert
>         Attachments: cxf.xml, TomcatDestinationFactory.java
>
>
> The problem is that the service destinations aren't found by the destination factory.
> I think this problem isn't Tomcat specific. It should occur if cxf is deployed as a war inside some application server.
> I would suggest the following workaround:
> 1.) Implement a ServletTransportFactory (see attachment 1)
> 2.) Register this ServletTransportFactory in the default cxf.xml (classpath root, see attachment 2)
> As a clean fix the ServletTransportFactory should make the static String getTrimmedPath(String path) method to a protected non static method. Than it can be easily overriden by custom subclasses.
> Greetings

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