gpt4 book ai didi

servicemix 上的 java.lang.ArrayStoreException : sun. reflect.annotation.TypeNotPresentExceptionProxy

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:49:31 26 4
gpt4 key购买 nike

我正在尝试使用 spring boot 开发 WebService 服务并将其发布到 ServiceMix 中,但我遇到了这样的异常:

      .   ____          _            __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot ::

java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:724)
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:531)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:355)
at sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)
at java.lang.Class.createAnnotationData(Class.java:3521)
at java.lang.Class.annotationData(Class.java:3510)
at java.lang.Class.getAnnotations(Class.java:3446)
at org.springframework.core.type.StandardAnnotationMetadata.getMetaAnnotationTypes(StandardAnnotationMetadata.java:84)
at org.springframework.context.annotation.AnnotationBeanNameGenerator.determineBeanNameFromAnnotation(AnnotationBeanNameGenerator.java:90)
at org.springframework.context.annotation.AnnotationBeanNameGenerator.generateBeanName(AnnotationBeanNameGenerator.java:69)
at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.registerBean(AnnotatedBeanDefinitionReader.java:146)
at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.registerBean(AnnotatedBeanDefinitionReader.java:128)
at org.springframework.context.annotation.AnnotatedBeanDefinitionReader.register(AnnotatedBeanDefinitionReader.java:123)
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:159)
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:135)
at org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:127)
at org.springframework.boot.SpringApplication.load(SpringApplication.java:635)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:355)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:301)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
at com.glodon.webservice_1.App.start(App.java:22)
at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2238)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2144)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1253)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1225)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1213)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:507)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)

这意味着一些注释引用了一个不在类路径中的类,但我怎么知道哪个类被遗漏了?我的 list 标题是:

Bnd-LastModified: 1504594453579
Build-Jdk: 1.8.0_144
Built-By: yangez
Bundle-Activator: com.glodon.webservice_1.App
Bundle-ManifestVersion: 2
Bundle-Name: webservice_1
Bundle-SymbolicName: com.glodon.webservice_1
Bundle-Version: 0.0.1.SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Export-Package: com.glodon.webservice_1; uses:="javax.jws, javax.xml.ws, org.apache.cxf.bus.spring, org.osgi.framework, org.springframework.boot.autoconfigure, org.springframework.boot.web.servlet, org.springframework.context.annotation"; version="0.0.1"
Import-Package: javax.jws; resolution:=optional, javax.servlet; resolution:=optional, javax.xml.ws; resolution:=optional, org.apache.cxf; resolution:=optional; version="[3.1, 4)", org.apache.cxf.bus.spring; resolution:=optional; version="[3.1, 4)", org.apache.cxf.jaxws; resolution:=optional; version="[3.1, 4)", org.apache.cxf.transport.servlet; resolution:=optional; version="[3.1, 4)", org.osgi.framework; resolution:=optional; version="[1.6, 2)", org.springframework.boot; resolution:=optional, org.springframework.boot.autoconfigure; resolution:=optional, org.springframework.boot.web.servlet; resolution:=optional, org.springframework.context; resolution:=optional, org.springframework.context.annotation; resolution:=optional
Manifest-Version: 1.0
Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.8))"
Tool: Bnd-3.3.0.201609221906

最佳答案

您的大部分导入都是 resolution:=optional 这意味着您的包可能总是会解析,但您无法保证所需的类在需要时可用。比如你现在的情况。可选解决方案适用于真正可选的包,并且您的包已准备好处理缺失的类型。但是,如果您的代码必须存在这些类型,则必须导入这些类型的包。

我建议您从导入中删除 resolution:=optional 并查看情况。由于缺少包的导出商,您可能会遇到解决错误,但这会告诉您包需要什么。

关于servicemix 上的 java.lang.ArrayStoreException : sun. reflect.annotation.TypeNotPresentExceptionProxy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46068252/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com