OSGi バンドルで RMI ベースのシステムを公開する必要があります。RMIクライアントの「バンドル」は、bndツールを使用してOSGiバンドルに変換したjarであり(ソースにアクセスできません)、少なくともEclipseではすべて問題ないようですが、接続しようとするとRMI サーバーで、ClassCastException がスローされます。おそらく、OSGi と RMI のどちらかが ClassLoader をおかしく使用するためです。
どうすればこれを解決できますか? RMI クライアント jar を「システム」バンドルとして使用している可能性がありますか?
スタック トレースは次のとおりです。
Blipnet OSGi サービスを開始しています... com.blipsystems.blipnet.api.blipserver.BlipServerConnectionException: サーバーへの接続に問題がありました com.blipsystems.blipnet.api.core.blipserver.BlipServerConnectionAdapter で。(不明なソース) com.blipsystems.blipnet.api.core.blipserver.BlipServerConnectionAdapter で。(不明なソース) com.blipsystems.blipnet.api.blipserver.BlipServer.getConnection (不明なソース) で dk.itu.jingling.blipnetosgi.BlipnetConnectionService.setup (BlipnetConnectionService.java:28) で dk.itu.jingling.blipnetosgi.BlipnetConnectionService で。(BlipnetConnectionService.java:22) dk.itu.jingling.blipnetosgi.Activator.start (Activator.java:32) で org.apache.felix.framework.util.SecureAction$Actions.run(SecureAction.java:1235) で java.security.AccessController.doPrivileged(ネイティブメソッド)で org.apache.felix.framework.util.SecureAction.startActivator (SecureAction.java:658) で org.apache.felix.framework.Felix.activateBundle (Felix.java:1699) で org.apache.felix.framework.Felix.startBundle (Felix.java:1621) で org.apache.felix.framework.BundleImpl.start(BundleImpl.java:890) で org.apache.felix.framework.BundleImpl.start (BundleImpl.java:877) で org.apache.felix.fileinstall.internal.DirectoryWatcher.start (DirectoryWatcher.java:819) で org.apache.felix.fileinstall.internal.DirectoryWatcher.start (DirectoryWatcher.java:805) で org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles (DirectoryWatcher.java:798) で org.apache.felix.fileinstall.internal.DirectoryWatcher.run (DirectoryWatcher.java:299) で 原因: java.lang.ClassCastException: com.blipsystems.blipnet.blipserver.cms.NewApiHandler_Stub を com.blipsystems.blipnet.api.core.blipserver.RemoteBlipServerConnection にキャストできません