I honestly don't think there is a workaround for this as this is something that
is a limitation down in the Java runtime, not CXF. If you do something simple
like:
InvocationHandler handler = new InvocationHandler() {
public Object invoke(Object proxy, Method method, Object[] args)
throws Throwable {
return null;
}
};
Proxy.newProxyInstance(SEIInterface.class.getClassLoader(),
new Class[] {SEIInterface.class}, handler);
it will likely generate the same exception. We just use the in-JVM facilities
for creating proxy objects from the interfaces and thus any limitation they
have would be reflected. I don't know if using a newer version of the JDK
would change anything.
That said, IMO, putting 2400 methods on a single portType is a really BAD BAD
idea. This service should be broken up into functional groups each in it's
own portType/binding/port.
Dan
On Aug 1, 2013, at 11:54 AM, Ryan Hall (ryhall) <[email protected]> wrote:
> 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
--
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com