Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MethodTooLargeException when creating the proxy for the Port type #688

Open
papegaaij opened this issue Jun 11, 2024 · 1 comment
Open

Comments

@papegaaij
Copy link

When trying to use the virtual box sdk on Java 21, we get the following exception:

Exception in thread "Thread-5" jdk.internal.org.objectweb.asm.MethodTooLargeException: Method too large: jdk/proxy2/$Proxy89.<clinit> ()V
        at java.base/jdk.internal.org.objectweb.asm.MethodWriter.computeMethodInfoSize(MethodWriter.java:2120)
        at java.base/jdk.internal.org.objectweb.asm.ClassWriter.toByteArray(ClassWriter.java:543)
        at java.base/java.lang.reflect.ProxyGenerator.generateClassFile(ProxyGenerator.java:506)
        at java.base/java.lang.reflect.ProxyGenerator.generateProxyClass(ProxyGenerator.java:178)
        at java.base/java.lang.reflect.Proxy$ProxyBuilder.defineProxyClass(Proxy.java:544)
        at java.base/java.lang.reflect.Proxy$ProxyBuilder.build(Proxy.java:657)
        at java.base/java.lang.reflect.Proxy.lambda$getProxyConstructor$1(Proxy.java:440)
        at java.base/jdk.internal.loader.AbstractClassLoaderValue$Memoizer.get(AbstractClassLoaderValue.java:329)
        at java.base/jdk.internal.loader.AbstractClassLoaderValue.computeIfAbsent(AbstractClassLoaderValue.java:205)
        at java.base/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:438)
        at java.base/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1034)
        at com.sun.xml.ws.client.WSServiceDelegate$3.run(WSServiceDelegate.java:720)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
        at com.sun.xml.ws.client.WSServiceDelegate.createProxy(WSServiceDelegate.java:716)
        at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:797)
        at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:426)
        at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:392)
        at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:373)
        at jakarta.xml.ws.Service.getPort(Service.java:139)
        at org.virtualbox_7_0.jaxws.VboxService.getVboxServicePort(VboxService.java:56)
        at org.virtualbox_7_0.PortPool.getPort(VirtualBoxManager.java:151)
        at org.virtualbox_7_0.PortPool.preinit(VirtualBoxManager.java:120)
        at org.virtualbox_7_0.PortPool.access$200(VirtualBoxManager.java:73)
        at org.virtualbox_7_0.PortPool$1.run(VirtualBoxManager.java:97)
        at java.base/java.lang.Thread.run(Thread.java:1583)

The service endpoint interface it tries to generate the proxy for is very large. It has 1832 methods. However, this used to work fine with Java 17. Note, we transformed the virtualbox sdk jar to make it compatible with Jakarta EE.

@enexusde
Copy link

See also https://www.virtualbox.org/ticket/22094

:D
I have the same challenge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants