Hello,
I've recently encountered an interesting problem when trying to write a client
to connect to the code stubs generated by CXF's WSDL2Java tool. Basically, the
code stubs appear to generate correctly, but whenever I try to create a client
which uses those stubs, I obtain the following error message while trying to
getPort(), basically while the proxy classes are being generated:
INFO: Creating Service {http://example.com/}FooWebService from WSDL:
jar:file:/WorkflowExampleWebClient.jar!/FooWebService.wsdl
Error! Not able to run sample workflow completely.
java.lang.IllegalArgumentException: code size limit exceeded
at
sun.misc.ProxyGenerator.generateStaticInitializer(ProxyGenerator.java:1220)
at sun.misc.ProxyGenerator.generateClassFile(ProxyGenerator.java:443)
at sun.misc.ProxyGenerator.generateProxyClass(ProxyGenerator.java:306)
at java.lang.reflect.Proxy.getProxyClass(Proxy.java:501)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
at
org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:171)
at
org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:151)
at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:464)
at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:331)
at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:318)
at javax.xml.ws.Service.getPort(Service.java:92)
The WSDL is currently ~4.6MB with ~2400 methods. This was working before when
the wsdl was smaller, and If I remove around 300-400 methods, then this error
doesn't happen and the client works correctly. I've tried several versions of
CXF (the version used here is 2.4.8) and receive essentially the same error
message every time.
It appears to me to be a bug in the client side code generation or proxy
generation. I was wondering if anyone has seen this error before or if anyone
knows of any possible workarounds?
Thanks,
Ryan Hall