2017-09-06 107 views
1

我試圖用彈簧啓動開發的WebService服務和ServiceMix的發佈,但是,我有這樣的例外:java.lang.ArrayStoreException:sun.reflect.annotation.TypeNotPresentExceptionProxy上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) 

這意味着某些註釋引用了一個不在類路徑中的類,但是如何知道哪個類錯過了? 我的清單header是:

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 

回答

0

你大部分的進口是resolution:=optional這意味着你的包可能會隨時解決,但你會在需要的時候不能保證需要的類是可用的。像你目前的情況一樣。可選的解決方案適用於真正可選的軟件包,並且您的軟件包已準備好處理缺失的類型。但是,如果您的代碼必須具有類型,那麼必須導入這些類型的包。

我建議您從您的進口中刪除resolution:=optional,看看事情進展如何。由於缺少軟件包導出程序,您可能會遇到解決錯誤,但這會告訴您軟件包需要什麼。