我们的应用程序已迁移到 OSGi,但我无法在 Eclipse 中启动/调试它。流程是什么:OSGi 应用程序开发人员是否需要设置 Equinox 环境,安装数百个包(jar=bundle?),然后从控制台启动?换句话说,启动“热插拔天才”应用程序与“模块化挑战”应用程序不同吗?
次要的,更具体的问题。有一个引导程序包应该可以处理所有事情,但是在加载了一堆类之后它会变慢并且几乎挂在:
...
...
...
Flat profile of 0.22 secs (16 total ticks): main
Interpreted + native Method
16.7% 1 + 0 java.awt.Toolkit.addAWTEventLi[Loaded java.awt.SentEvent from C:\Program Files\Java\jdk1.7.0_04\jre\lib\rt.jar]
stener
16.7% 1 + 0 jav[Loaded java.awt.DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent from C:\Program Files\Java\jdk1.7.0_04\jre\lib\rt.jar]
a.util.regex.Pattern.compile
16.7% 1 + 0 sun.util.logging.PlatformLogger.<init>
50.0% 3 + 0 Total interpreted
Thread-local ticks:
62.5% 10 Blocked (of total)
50.0% 3 Class loader
...
...
...
[Loaded sun.reflect.Label$PatchInfo from C:\Program Files\Java\jdk1.7.0_04\jre\lib\rt.jar]
[Loaded sun.reflect.MethodAccessorGenerator$1 from C:\Program Files\Java\jdk1.7.0_04\jre\lib\rt.jar]
[Loaded sun.reflect.ClassDefiner from C:\Program Files\Java\jdk1.7.0_04\jre\lib\rt.jar]
[Loaded sun.reflect.ClassDefiner$1 from C:\Program Files\Java\jdk1.7.0_04\jre\lib\rt.jar]
[Loaded sun.reflect.GeneratedMethodAccessor1 from __JVM_DefineClass__]
[Dynamic-linking native method sun.java2d.DefaultDisposerRecord.invokeNativeDispose ... JNI]
[Dynamic-linking native method java.lang.ref.Finalizer.invokeFinalizeMethod ... JNI]
编辑:自问题发布以来取得了一些进展
[Loaded sun.reflect.GeneratedMethodAccessor1 from __JVM_DefineClass__]
[Dynamic-linking native method sun.java2d.DefaultDisposerRecord.invokeNativeDispose ... JNI]
[Dynamic-linking native method java.lang.ref.Finalizer.invokeFinalizeMethod ... JNI]
--- new stuff ---
[Loaded sun.awt.windows.WComponentPeer$2 from C:\Program Files\Java\jdk1.7.0_04\jre\lib\rt.jar]
[Dynamic-linking native method sun.awt.windows.WInputMethod.disableNativeIME ... JNI]
因此,这不是一个僵局,是什么让它如此缓慢地令人难以忍受?