OSGI Bundle无法使用Reflections

时间:2017-04-28 12:18:40

标签: apache nexus

我正在使用OSGI Bundle,我们使用反射从子jar中加载特定注释的类,所以我的结构有点像这样:

  
      
  • abc.jar      
        
          
    •     
    • reflections.jar
    •     
    • ab.jar
    •     
    • cd.jar
    •     
      
  •   

在使用ab.jar进行反思时,我们遇到了一些问题,我们收到以下错误:

2017-04-28 15:33:02,374+0530 WARN  [MessageConsumer-hosted.durable] *SYSTEM org.reflections.Reflections - could not create Dir using bundle from url bundle://186.0:3/. skipping.
java.lang.ClassNotFoundException: org.eclipse.core.runtime.FileLocator
    at java.net.URLClassLoader.findClass(Unknown Source) [na:1.8.0_102]
    at java.lang.ClassLoader.loadClass(Unknown Source) [na:1.8.0_102]
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) [na:1.8.0_102]
    at java.lang.ClassLoader.loadClass(Unknown Source) [na:1.8.0_102]
    at org.reflections.vfs.Vfs$DefaultUrlTypes$6.createDir(Vfs.java:274) [org.sonatype.nexus.plugins.eiffel-nexus-plugin:3.2.1.01]
    at org.reflections.vfs.Vfs.fromURL(Vfs.java:98) [org.sonatype.nexus.plugins.eiffel-nexus-plugin:3.2.1.01]
    at org.reflections.vfs.Vfs.fromURL(Vfs.java:90) [org.sonatype.nexus.plugins.eiffel-nexus-plugin:3.2.1.01]
    at org.reflections.Reflections.scan(Reflections.java:236) [org.sonatype.nexus.plugins.eiffel-nexus-plugin:3.2.1.01]
    at org.reflections.Reflections.scan(Reflections.java:203) [org.sonatype.nexus.plugins.eiffel-nexus-plugin:3.2.1.01]
    at org.reflections.Reflections.<init>(Reflections.java:128) [org.sonatype.nexus.plugins.eiffel-nexus-plugin:3.2.1.01]
    at org.reflections.Reflections.<init>(Reflections.java:169) [org.sonatype.nexus.plugins.eiffel-nexus-plugin:3.2.1.01]
    at org.reflections.Reflections.<init>(Reflections.java:142) [org.sonatype.nexus.plugins.eiffel-nexus-plugin:3.2.1.01]
    at com.message.MessagingVersion.findEventImplementations(MessagingVersion.java:120) [org.sonatype.nexus.plugins.eiffel-nexus-plugin:3.2.1.01]
    at com.message.MessagingVersion.getEventImplementations(MessagingVersion.java:82) [org.sonatype.nexus.plugins.eiffel-nexus-plugin:3.2.1.01]
org.reflections.Reflections - could not create Dir using commons_vfs2 from url bundle://186.0:3/. skipping.
java.lang.NoClassDefFoundError: org/apache/commons/vfs2/VFS
    at org.reflections.vfs.Vfs$DefaultUrlTypes$7.matches(Vfs.java:281) [org.sonatype.nexus.plugins.eiffel-nexus-plugin:3.2.1.01]
    at org.reflections.vfs.Vfs.fromURL(Vfs.java:97) [org.sonatype.nexus.plugins.eiffel-nexus-plugin:3.2.1.01]
    at org.reflections.vfs.Vfs.fromURL(Vfs.java:90) [org.sonatype.nexus.plugins.eiffel-nexus-plugin:3.2.1.01]
    at org.reflections.Reflections.scan(Reflections.java:236) [org.sonatype.nexus.plugins.eiffel-nexus-plugin:3.2.1.01]
    at org.reflections.Reflections.scan(Reflections.java:203) [org.sonatype.nexus.plugins.eiffel-nexus-plugin:3.2.1.01]
    at org.reflections.Reflections.<init>(Reflections.java:128) [org.sonatype.nexus.plugins.eiffel-nexus-plugin:3.2.1.01]
    at org.reflections.Reflections.<init>(Reflections.java:169) [org.sonatype.nexus.plugins.eiffel-nexus-plugin:3.2.1.01]
    at org.reflections.Reflections.<init>(Reflections.java:142) [org.sonatype.nexus.plugins.eiffel-nexus-plugin:3.2.1.01]
    at 

Caused by: java.lang.ClassNotFoundException: org.apache.commons.vfs2.VFS not found by org.sonatype.nexus.plugins.eiffel-nexus-plugin [186]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574) [na:na]
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79) [na:na]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018) [na:na]
at java.lang.ClassLoader.loadClass(Unknown Source) [na:1.8.0_102]
... 18 common frames omitted

有人可以帮我解决这个问题吗?

0 个答案:

没有答案