You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by sachin2713 <sa...@gmail.com> on 2012/10/09 16:34:35 UTC

StackOverflowError while creating webservices

Hi All, 

I am using camel 2.9.1 with cxf 2.4.2 and spring 3.0.5 to expose some
webservices with multiple operations using WSDL first approach and PAYLOAD
mode. 
i am getting stackoverflow error due to below recursion in cxf.. 

Caused by: java.lang.StackOverflowError 
        at
java.util.concurrent.ConcurrentHashMap$Segment.get(ConcurrentHashMap.java:350) 
        at
java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:781) 
        at
org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:116) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:130) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134) 
        at
org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)



--
View this message in context: http://cxf.547215.n5.nabble.com/StackOverflowError-while-creating-webservices-tp5716168.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: StackOverflowError while creating webservices

Posted by Daniel Kulp <dk...@apache.org>.
On Oct 9, 2012, at 1:38 PM, sachin2713 <sa...@gmail.com> wrote:

> Hi Glen,
> 
> I debugged the CXF code and found out the cause. 
> 
> As CXF 2.4 ( SoapTransportFactory class) only supposrts below namespaces. 
> 
> "http://schemas.xmlsoap.org/wsdl/soap/" 
>  "http://schemas.xmlsoap.org/wsdl/http" 
>    "http://schemas.xmlsoap.org/wsdl/soap/http" 
>     "http://schemas.xmlsoap.org/wsdl/soap/http/" 
>        "http://schemas.xmlsoap.org/wsdl/http/". 
> 
> But i have  http://schemas.xmlsoap.org/soap/http/ namespace in my wsdl
> binding , hence no match found, causing recursion. 
> Is this namespace not supported by CXF??

It's not really a valid namespace.  The proper string should be http://schemas.xmlsoap.org/soap/http  (without the trailing slash).     You should find where you are setting that and get that updated.

That said, it shouldn't stack overflow.

Dan



> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/StackOverflowError-while-creating-webservices-tp5716168p5716186.html
> Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: StackOverflowError while creating webservices

Posted by sachin2713 <sa...@gmail.com>.
Even with the namespace suggested http://schemas.xmlsoap.org/soap/http (
without trailing /) it causes Stack over flow. It is because of the
mapTransportURI() method of SoapTransportFactory class in
cxf-rt-bindings-soap-2.4.2.jar. If you notice there are no support for
http://schemas.xmlsoap.org/soap/http namespace, which cause the recursion as
it tried to resolve it by calling same method again and again.

And i checked cxf 2.5.4 also, there also same thing.

Regards
Sachin



--
View this message in context: http://cxf.547215.n5.nabble.com/StackOverflowError-while-creating-webservices-tp5716168p5716224.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: StackOverflowError while creating webservices

Posted by Freeman Fang <fr...@gmail.com>.
IIRC Camel 2.9.x should use CXF 2.5.x, so probably this mismatch cause that issue
-------------
Freeman Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042

On 2012-10-10, at 上午1:38, sachin2713 wrote:

> Hi Glen,
> 
> I debugged the CXF code and found out the cause. 
> 
> As CXF 2.4 ( SoapTransportFactory class) only supposrts below namespaces. 
> 
> "http://schemas.xmlsoap.org/wsdl/soap/" 
>  "http://schemas.xmlsoap.org/wsdl/http" 
>    "http://schemas.xmlsoap.org/wsdl/soap/http" 
>     "http://schemas.xmlsoap.org/wsdl/soap/http/" 
>        "http://schemas.xmlsoap.org/wsdl/http/". 
> 
> But i have  http://schemas.xmlsoap.org/soap/http/ namespace in my wsdl
> binding , hence no match found, causing recursion. 
> Is this namespace not supported by CXF??
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/StackOverflowError-while-creating-webservices-tp5716168p5716186.html
> Sent from the cxf-user mailing list archive at Nabble.com.


Re: StackOverflowError while creating webservices

Posted by sachin2713 <sa...@gmail.com>.
Hi Glen,

I debugged the CXF code and found out the cause. 

As CXF 2.4 ( SoapTransportFactory class) only supposrts below namespaces. 

"http://schemas.xmlsoap.org/wsdl/soap/" 
  "http://schemas.xmlsoap.org/wsdl/http" 
    "http://schemas.xmlsoap.org/wsdl/soap/http" 
     "http://schemas.xmlsoap.org/wsdl/soap/http/" 
        "http://schemas.xmlsoap.org/wsdl/http/". 

But i have  http://schemas.xmlsoap.org/soap/http/ namespace in my wsdl
binding , hence no match found, causing recursion. 
Is this namespace not supported by CXF??



--
View this message in context: http://cxf.547215.n5.nabble.com/StackOverflowError-while-creating-webservices-tp5716168p5716186.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: StackOverflowError while creating webservices

Posted by Glen Mazza <gl...@gmail.com>.
You'll probably need to debug your Camel route 
(http://www.jroller.com/gmazza/entry/eclipse_debug_web_services) to see 
why the infinite loop is occurring.  If it would help, you may want to 
at least temporarily switch to a direct CXF Provider implementation 
(because you want to work with payloads): 
http://www.jroller.com/gmazza/entry/using_mtom_and_apache_fop (see first 
bulleted item at the bottom of the article for links) without needing to 
deal with the Camel middleman--that may better point out where the error 
is (CXF or Camel).

Glen

On 10/09/2012 10:34 AM, sachin2713 wrote:
> Hi All,
>
> I am using camel 2.9.1 with cxf 2.4.2 and spring 3.0.5 to expose some
> webservices with multiple operations using WSDL first approach and PAYLOAD
> mode.
> i am getting stackoverflow error due to below recursion in cxf..
>
> Caused by: java.lang.StackOverflowError
>          at
> java.util.concurrent.ConcurrentHashMap$Segment.get(ConcurrentHashMap.java:350)
>          at
> java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:781)
>          at
> org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:116)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:130)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
> at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>          at
> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:134)
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/StackOverflowError-while-creating-webservices-tp5716168.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Glen Mazza
Talend Community Coders - coders.talend.com
blog: www.jroller.com/gmazza