You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "imgoby (via GitHub)" <gi...@apache.org> on 2024/01/17 02:21:33 UTC

[I] native-image compile failed ( java.lang.StackOverflowError) when field type is enum. [dubbo]

imgoby opened a new issue, #13671:
URL: https://github.com/apache/dubbo/issues/13671

    <dubbo.version>3.3.0-beta.1</dubbo.version>
   
   
   if field type is enum ,it causes this exception:
   public enum MyType {
       OK,
       FAILED
   }
   
   public class DemoServiceImpl implements DemoService {
   
       @Override
       public String sayHello(MyType type) {
           return "Hello " + type.name();
       }
   }
   
   public interface DemoService {
       String sayHello(MyType type);
   }
   
   ```
   2024-01-17T10:14:48.926+08:00  INFO 18606 --- [           main] o.s.c.a.ConfigurationClassPostProcessor  : Cannot enhance @Configuration bean definition 'org.apache.dubbo.spring.boot.autoconfigure.DubboAutoConfiguration' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
   2024-01-17T10:14:49.048+08:00  INFO 18606 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=fe7cc2c4-0c4b-303e-94cb-821e2db5fcad
   Exception in thread "main" java.lang.StackOverflowError
   	at java.base/java.util.HashMap.hash(HashMap.java:338)
   	at java.base/java.util.HashMap.put(HashMap.java:610)
   	at java.base/java.util.HashSet.add(HashSet.java:221)
   	at org.springframework.aot.hint.SerializationHints.registerType(SerializationHints.java:64)
   	at org.springframework.aot.hint.SerializationHints.registerType(SerializationHints.java:75)
   	at org.apache.dubbo.config.spring6.utils.AotUtils.registerSerializationType(AotUtils.java:48)
   	at org.apache.dubbo.config.spring6.utils.AotUtils.lambda$registerSerializationType$2(AotUtils.java:50)
   	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
   	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
   	at org.apache.dubbo.config.spring6.utils.AotUtils.registerSerializationType(AotUtils.java:50)
   	at org.apache.dubbo.config.spring6.utils.AotUtils.lambda$registerSerializationType$2(AotUtils.java:50)
   	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
   	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
   	at org.apache.dubbo.config.spring6.utils.AotUtils.registerSerializationType(AotUtils.java:50)
   	at org.apache.dubbo.config.spring6.utils.AotUtils.lambda$registerSerializationType$2(AotUtils.java:50)
   	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
   	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
   	at org.apache.dubbo.config.spring6.utils.AotUtils.registerSerializationType(AotUtils.java:50)
   	at org.apache.dubbo.config.spring6.utils.AotUtils.lambda$registerSerializationType$2(AotUtils.java:50)
   	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992)
   	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
   	at org.apache.dubbo.config.spring6.utils.AotUtils.registerSerializationType(AotUtils.java:50)
   
   ```
   
   my demo project is here:
   https://github.com/imgoby/spring-cloud-alibaba-dubbo-native/tree/main/spring-cloud-alibaba-consul-dubbo-provider
   
   https://github.com/imgoby/spring-cloud-alibaba-dubbo-native/tree/main/spring-cloud-alibaba-consul-dubbo-consumer


-- 
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: notifications-unsubscribe@dubbo.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] native-image compile failed ( java.lang.StackOverflowError) when field type is enum. [dubbo]

Posted by "CrazyHZM (via GitHub)" <gi...@apache.org>.
CrazyHZM commented on issue #13671:
URL: https://github.com/apache/dubbo/issues/13671#issuecomment-1897866994

   @imgoby 
   You are right. It will be fixed in the next version.


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] native-image compile failed ( java.lang.StackOverflowError) when field type is enum. [dubbo]

Posted by "CrazyHZM (via GitHub)" <gi...@apache.org>.
CrazyHZM commented on issue #13671:
URL: https://github.com/apache/dubbo/issues/13671#issuecomment-1897696740

   @imgoby 
   This does not seem to be supported by spring itself.
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] native-image compile failed ( java.lang.StackOverflowError) when field type is enum. [dubbo]

Posted by "CrazyHZM (via GitHub)" <gi...@apache.org>.
CrazyHZM closed issue #13671: native-image compile failed ( java.lang.StackOverflowError) when  field type is enum.
URL: https://github.com/apache/dubbo/issues/13671


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] native-image compile failed ( java.lang.StackOverflowError) when field type is enum. [dubbo]

Posted by "imgoby (via GitHub)" <gi...@apache.org>.
imgoby commented on issue #13671:
URL: https://github.com/apache/dubbo/issues/13671#issuecomment-1897687197

   ![image](https://github.com/apache/dubbo/assets/27885492/42ea1406-0fcd-476b-a7f6-669a68d78d11)
   This judgment seems to be acceptable


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] native-image compile failed ( java.lang.StackOverflowError) when field type is enum. [dubbo]

Posted by "imgoby (via GitHub)" <gi...@apache.org>.
imgoby commented on issue #13671:
URL: https://github.com/apache/dubbo/issues/13671#issuecomment-1895021860

   @CrazyHZM


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] native-image compile failed ( java.lang.StackOverflowError) when field type is enum. [dubbo]

Posted by "imgoby (via GitHub)" <gi...@apache.org>.
imgoby commented on issue #13671:
URL: https://github.com/apache/dubbo/issues/13671#issuecomment-1897710099

   this code file is under dubbo project.
   org.apache.dubbo.config.spring6.utils.AotUtils
   
   it is dubbo's code bug. not spring.
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org