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

   ### Pre-check
   
   - [x] I am sure that all the content I provide is in English.
   
   
   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Apache Dubbo Component
   
   Java SDK (apache/dubbo)
   
   ### Dubbo Version
   
   dubbo 3.3.5,java 17,mac 15.6
   
   ### Steps to reproduce this issue
   
   在非 spring 环境,项目在 jvm 运行时下是正常的。。。使用 dubbo-native + dubbo-maven-plugin 
(原生编译时)出现以下异常。
   
   * 异常
   
   ```
   Exception in thread "main" java.lang.NoClassDefFoundError: 
org/springframework/context/ApplicationContext
           at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
           at 
java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3373)
           at java.base/java.lang.Class.getConstructors(Class.java:2060)
           at 
org.apache.dubbo.aot.generate.ReflectConfigMetadataRepository.buildTypeDescriberWithConstructor(ReflectConfigMetadataRepository.java:74)
           at 
java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
           at 
java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
           at 
java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
           at 
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
           at 
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
           at 
java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
           at 
java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
           at 
java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
           at 
org.apache.dubbo.aot.generate.ReflectConfigMetadataRepository.registerSpiExtensionType(ReflectConfigMetadataRepository.java:45)
           at 
org.apache.dubbo.aot.generate.AotProcessor.main(AotProcessor.java:62)
   Caused by: java.lang.ClassNotFoundException: 
org.springframework.context.ApplicationContext
           at 
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
           at 
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
           at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
           ... 14 more
   ```
   
   * 截图
   
   <img width="2038" height="1232" alt="Image" 
src="https://github.com/user-attachments/assets/cf730c0f-cf54-405f-a97a-8365523064cc";
 />
   
   ### What you expected to happen
   
   希望 dubbo-native java 原生编译,不要硬性依赖 spring 相关接口。。。希望去除依赖,或者通过适配
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request to fix on your own?
   
   - [ ] Yes I am willing to submit a pull request on my own!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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-unsubscr...@dubbo.apache.org.apache.org

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


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

Reply via email to