You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/08/08 02:19:05 UTC

[GitHub] [camel-quarkus] jingwang opened a new issue, #3963: [Quarkus 2.11.1.Final] Subclass of EndpointRouteBuilder quarkus:dev fail to start due to "Method too large" error

jingwang opened a new issue, #3963:
URL: https://github.com/apache/camel-quarkus/issues/3963

   We recently upgraded to camel-quarkus `2.11.0` that is on quarkus `2.11.1.Final`. We have noticed that the routes defined in the subclass of `EndpointRouteBuilder` fail to start with `mvn clean quarkus:dev`. After some debugging it seems to be caused by including more than a few methods in the subclass. We have managed to reproduce the error with a bare minimum class:
   ```
   import org.apache.camel.builder.endpoint.EndpointRouteBuilder;
   import javax.enterprise.context.ApplicationScoped;
   
   @ApplicationScoped
   public class TestRoute extends EndpointRouteBuilder {
   
       protected int dummy() {
           int a = 0;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           return a;
       }
       protected int dummy1() {
           int a = 0;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           return a;
       }
   
       protected int dummy2() {
           int a = 0;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           return a;
       }
   
       protected int dummy4() {
           int a = 0;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           return a;
       }
   
       protected int dummy5() {
           int a = 0;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           return a;
       }
   
       protected int dummy6() {
           int a = 0;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           return a;
       }
   
       protected int dummy3() {
           int a = 0;
           a++;
           a++;
           a++;
           a++;
           a++;
           a++;
           return a;
       }
   
       @Override
       public void configure()  throws Exception {
   
       }
   }
   ```
   When trying to start up with `mvn clean quarkus:dev`, gives the following errors:
   
   ```
   Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
   	[error]: Build step io.quarkus.arc.deployment.ArcProcessor#generateResources threw an exception: org.objectweb.asm.MethodTooLargeException: Method too large: TestRoute_Subclass.<init> (Ljavax/enterprise/context/spi/CreationalContext;Lio/quarkus/arc/InjectableInterceptor;)V
   	at org.objectweb.asm.MethodWriter.computeMethodInfoSize(MethodWriter.java:2088)
   	at org.objectweb.asm.ClassWriter.toByteArray(ClassWriter.java:511)
   	at io.quarkus.gizmo.ClassCreator.writeTo(ClassCreator.java:214)
   	at io.quarkus.gizmo.ClassCreator.close(ClassCreator.java:225)
   	at io.quarkus.arc.processor.SubclassGenerator.generate(SubclassGenerator.java:124)
   	at io.quarkus.arc.processor.BeanProcessor.generateResources(BeanProcessor.java:212)
   	at io.quarkus.arc.deployment.ArcProcessor.generateResources(ArcProcessor.java:537)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
   	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:977)
   	at io.quarkus.builder.BuildContext.run(BuildContext.java:281)
   	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
   	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
   	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
   	at java.base/java.lang.Thread.run(Thread.java:829)
   	at org.jboss.threads.JBossThread.run(JBossThread.java:501)
   
   	at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:330)
   	at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:252)
   	at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:60)
   	at io.quarkus.deployment.dev.IsolatedDevModeMain.firstStart(IsolatedDevModeMain.java:95)
   	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:485)
   	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:68)
   	at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:148)
   	at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:103)
   	at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:131)
   	at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:62)
   Caused by: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
   	[error]: Build step io.quarkus.arc.deployment.ArcProcessor#generateResources threw an exception: org.objectweb.asm.MethodTooLargeException: Method too large: TestRoute_Subclass.<init> (Ljavax/enterprise/context/spi/CreationalContext;Lio/quarkus/arc/InjectableInterceptor;)V
   	at org.objectweb.asm.MethodWriter.computeMethodInfoSize(MethodWriter.java:2088)
   	at org.objectweb.asm.ClassWriter.toByteArray(ClassWriter.java:511)
   	at io.quarkus.gizmo.ClassCreator.writeTo(ClassCreator.java:214)
   	at io.quarkus.gizmo.ClassCreator.close(ClassCreator.java:225)
   	at io.quarkus.arc.processor.SubclassGenerator.generate(SubclassGenerator.java:124)
   	at io.quarkus.arc.processor.BeanProcessor.generateResources(BeanProcessor.java:212)
   	at io.quarkus.arc.deployment.ArcProcessor.generateResources(ArcProcessor.java:537)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
   	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:977)
   	at io.quarkus.builder.BuildContext.run(BuildContext.java:281)
   	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
   	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
   	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
   	at java.base/java.lang.Thread.run(Thread.java:829)
   	at org.jboss.threads.JBossThread.run(JBossThread.java:501)
   
   	at io.quarkus.builder.Execution.run(Execution.java:123)
   	at io.quarkus.builder.BuildExecutionBuilder.execute(BuildExecutionBuilder.java:79)
   	at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:158)
   	at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:328)
   	... 9 more
   Caused by: org.objectweb.asm.MethodTooLargeException: Method too large: TestRoute_Subclass.<init> (Ljavax/enterprise/context/spi/CreationalContext;Lio/quarkus/arc/InjectableInterceptor;)V
   	at org.objectweb.asm.MethodWriter.computeMethodInfoSize(MethodWriter.java:2088)
   	at org.objectweb.asm.ClassWriter.toByteArray(ClassWriter.java:511)
   	at io.quarkus.gizmo.ClassCreator.writeTo(ClassCreator.java:214)
   	at io.quarkus.gizmo.ClassCreator.close(ClassCreator.java:225)
   	at io.quarkus.arc.processor.SubclassGenerator.generate(SubclassGenerator.java:124)
   	at io.quarkus.arc.processor.BeanProcessor.generateResources(BeanProcessor.java:212)
   	at io.quarkus.arc.deployment.ArcProcessor.generateResources(ArcProcessor.java:537)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
   	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:977)
   	at io.quarkus.builder.BuildContext.run(BuildContext.java:281)
   	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
   	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
   	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
   	at java.base/java.lang.Thread.run(Thread.java:829)
   	at org.jboss.threads.JBossThread.run(JBossThread.java:501)
   ```
   
   pom.xml
   ```
      ...
       <properties>
           <camel-quarkus.version>2.11.0</camel-quarkus.version>
           <quarkus-plugin.version>2.11.1.Final</quarkus-plugin.version>
           <quarkus.platform.version>2.11.1.Final</quarkus.platform.version>
       </properties>
       ...
   ```
   
   If the size/number of methods is reduced (e.g., commenting out some methods in the example), the application starts up fine.
   
   Note that this works fine if it is a subclass of `RouteBuilder`.
   
   Previously, the same code worked without errors on quarkus 2.10.0.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-quarkus] jingwang commented on issue #3963: [Quarkus 2.11.1.Final] Subclass of EndpointRouteBuilder quarkus:dev fail to start due to "Method too large" error

Posted by GitBox <gi...@apache.org>.
jingwang commented on issue #3963:
URL: https://github.com/apache/camel-quarkus/issues/3963#issuecomment-1207584308

   Thanks @zhfeng for the quick response. I believe it is a quarkus issue - This only happens when running quarkus:dev. `mvn clean package` runs without a problem.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel-quarkus] zhfeng commented on issue #3963: [Quarkus 2.11.1.Final] Subclass of EndpointRouteBuilder quarkus:dev fail to start due to "Method too large" error

Posted by GitBox <gi...@apache.org>.
zhfeng commented on issue #3963:
URL: https://github.com/apache/camel-quarkus/issues/3963#issuecomment-1207582422

   Thanks @jingwang for reporting and it looks more like a quarkus issue?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org