Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Exception: Caused by: java.lang.IllegalArgumentException: Cannot subclass primitive, array or final types: #1513

Closed
rootdavinalfa opened this issue Mar 1, 2022 · 3 comments

Comments

@rootdavinalfa
Copy link

I'm getting this following error when run gradle nativeCompile:

java.lang.IllegalArgumentException: Cannot subclass primitive, array or final types: class cinnamon.dto.tbond.ADTO
        at net.bytebuddy.ByteBuddy.subclass(ByteBuddy.java:406)
        at net.bytebuddy.ByteBuddy.subclass(ByteBuddy.java:379)
        at net.bytebuddy.ByteBuddy.subclass(ByteBuddy.java:276)
        at org.springframework.aop.framework.ProxyGenerator.getProxyBytes(ProxyGenerator.java:80)
        at org.springframework.aot.nativex.ConfigurationContributor.generateBuildTimeClassProxy(ConfigurationContributor.java:193)
        at org.springframework.aot.nativex.ConfigurationContributor.generateBuildTimeClassProxies(ConfigurationContributor.java:170)
        at org.springframework.aot.nativex.ConfigurationContributor.processBuildTimeClassProxyRequests(ConfigurationContributor.java:142)
        at org.springframework.aot.nativex.ConfigurationContributor.contribute(ConfigurationContributor.java:74)
        at org.springframework.aot.build.BootstrapCodeGenerator.generate(BootstrapCodeGenerator.java:91)
        at org.springframework.aot.build.BootstrapCodeGenerator.generate(BootstrapCodeGenerator.java:71)
        at org.springframework.aot.build.GenerateBootstrapCommand.call(GenerateBootstrapCommand.java:107)
        at org.springframework.aot.build.GenerateBootstrapCommand.call(GenerateBootstrapCommand.java:42)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
        at picocli.CommandLine.access$1300(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
        at picocli.CommandLine.execute(CommandLine.java:2078)
        at org.springframework.aot.build.GenerateBootstrapCommand.main(GenerateBootstrapCommand.java:112)
java.lang.IllegalStateException: Problem creating proxy with configuration: org.springframework.aop.framework.ProxyConfiguration@b36aa7bc
        at org.springframework.aop.framework.ProxyGenerator.getProxyBytes(ProxyGenerator.java:94)
        at org.springframework.aot.nativex.ConfigurationContributor.generateBuildTimeClassProxy(ConfigurationContributor.java:193)
        at org.springframework.aot.nativex.ConfigurationContributor.generateBuildTimeClassProxies(ConfigurationContributor.java:170)
        at org.springframework.aot.nativex.ConfigurationContributor.processBuildTimeClassProxyRequests(ConfigurationContributor.java:142)
        at org.springframework.aot.nativex.ConfigurationContributor.contribute(ConfigurationContributor.java:74)
        at org.springframework.aot.build.BootstrapCodeGenerator.generate(BootstrapCodeGenerator.java:91)
        at org.springframework.aot.build.BootstrapCodeGenerator.generate(BootstrapCodeGenerator.java:71)
        at org.springframework.aot.build.GenerateBootstrapCommand.call(GenerateBootstrapCommand.java:107)
        at org.springframework.aot.build.GenerateBootstrapCommand.call(GenerateBootstrapCommand.java:42)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
        at picocli.CommandLine.access$1300(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
        at picocli.CommandLine.execute(CommandLine.java:2078)
        at org.springframework.aot.build.GenerateBootstrapCommand.main(GenerateBootstrapCommand.java:112)
Caused by: java.lang.IllegalArgumentException: Cannot subclass primitive, array or final types: class cinnamon.dto.tbond.ADTO
        at net.bytebuddy.ByteBuddy.subclass(ByteBuddy.java:406)
        at net.bytebuddy.ByteBuddy.subclass(ByteBuddy.java:379)
        at net.bytebuddy.ByteBuddy.subclass(ByteBuddy.java:276)
        at org.springframework.aop.framework.ProxyGenerator.getProxyBytes(ProxyGenerator.java:80)
        ... 16 more
java.lang.IllegalArgumentException: Cannot subclass primitive, array or final types: class cinnamon.dto.tbond.ADTO
        at net.bytebuddy.ByteBuddy.subclass(ByteBuddy.java:406)
        at net.bytebuddy.ByteBuddy.subclass(ByteBuddy.java:379)
        at net.bytebuddy.ByteBuddy.subclass(ByteBuddy.java:276)
        at org.springframework.aop.framework.ProxyGenerator.getProxyBytes(ProxyGenerator.java:80)
        at org.springframework.aot.nativex.ConfigurationContributor.generateBuildTimeClassProxy(ConfigurationContributor.java:193)
        at org.springframework.aot.nativex.ConfigurationContributor.generateBuildTimeClassProxies(ConfigurationContributor.java:170)
        at org.springframework.aot.nativex.ConfigurationContributor.processBuildTimeClassProxyRequests(ConfigurationContributor.java:142)
        at org.springframework.aot.nativex.ConfigurationContributor.contribute(ConfigurationContributor.java:74)
        at org.springframework.aot.build.BootstrapCodeGenerator.generate(BootstrapCodeGenerator.java:91)
        at org.springframework.aot.build.BootstrapCodeGenerator.generate(BootstrapCodeGenerator.java:71)
        at org.springframework.aot.build.GenerateBootstrapCommand.call(GenerateBootstrapCommand.java:107)
        at org.springframework.aot.build.GenerateBootstrapCommand.call(GenerateBootstrapCommand.java:42)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
        at picocli.CommandLine.access$1300(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
        at picocli.CommandLine.execute(CommandLine.java:2078)
        at org.springframework.aot.build.GenerateBootstrapCommand.main(GenerateBootstrapCommand.java:112)
java.lang.IllegalStateException: Problem creating proxy with configuration: org.springframework.aop.framework.ProxyConfiguration@b36aa7bc
        at org.springframework.aop.framework.ProxyGenerator.getProxyBytes(ProxyGenerator.java:94)
        at org.springframework.aot.nativex.ConfigurationContributor.generateBuildTimeClassProxy(ConfigurationContributor.java:193)
        at org.springframework.aot.nativex.ConfigurationContributor.generateBuildTimeClassProxies(ConfigurationContributor.java:170)
        at org.springframework.aot.nativex.ConfigurationContributor.processBuildTimeClassProxyRequests(ConfigurationContributor.java:142)
        at org.springframework.aot.nativex.ConfigurationContributor.contribute(ConfigurationContributor.java:74)
        at org.springframework.aot.build.BootstrapCodeGenerator.generate(BootstrapCodeGenerator.java:91)
        at org.springframework.aot.build.BootstrapCodeGenerator.generate(BootstrapCodeGenerator.java:71)
        at org.springframework.aot.build.GenerateBootstrapCommand.call(GenerateBootstrapCommand.java:107)
        at org.springframework.aot.build.GenerateBootstrapCommand.call(GenerateBootstrapCommand.java:42)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
        at picocli.CommandLine.access$1300(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
        at picocli.CommandLine.execute(CommandLine.java:2078)
        at org.springframework.aot.build.GenerateBootstrapCommand.main(GenerateBootstrapCommand.java:112)
Caused by: java.lang.IllegalArgumentException: Cannot subclass primitive, array or final types: class cinnamon.dto.tbond.ADTO
        at net.bytebuddy.ByteBuddy.subclass(ByteBuddy.java:406)
        at net.bytebuddy.ByteBuddy.subclass(ByteBuddy.java:379)
        at net.bytebuddy.ByteBuddy.subclass(ByteBuddy.java:276)
        at org.springframework.aop.framework.ProxyGenerator.getProxyBytes(ProxyGenerator.java:80)
        ... 16 more

Data class in kotlin is final on the bytecode, so it led to that exception. Is it any workaround / it will be supported in next release?

Compiled with:

  1. Gradle version 7.2
  2. Spring native version 0.11.2
  3. Springboot version 2.6.3
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 1, 2022
@sdeleuze
Copy link
Contributor

sdeleuze commented Mar 3, 2022

Likely a duplicate of #969, so could you please try with 0.11.3 and let us know if that works? If not, please share a repro project.

@sdeleuze sdeleuze added the status: waiting-for-feedback We need additional information before we can continue label Mar 3, 2022
@spring-projects-issues
Copy link

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Mar 10, 2022
@spring-projects-issues
Copy link

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged or decided on labels Mar 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants