简体   繁体   English

OSGI捆绑包.bnd文件和冲突的导入包语句

[英]OSGI bundle .bnd file and conflicting import-package statements

I inherited a .bnd file that has the import !javax. 我继承了一个具有导入!javax的.bnd文件。 , and my program produces runtime errors if I take out that statement. ,如果我删除该语句,程序将产生运行时错误。 I currently need to add JavaHelp to my application, which is under javax.help. 我目前需要将JavaHelp添加到我的应用程序中,该应用程序位于javax.help下。 . When I have both of those imports in my .bnd and I use a class from JavaHelp, it produces a ClassNotFoundException for the specific class, like javax.help.JHelp. 当我在.bnd中同时拥有这两个导入并且使用JavaHelp中的类时,它将为特定类生成ClassNotFoundException,例如javax.help.JHelp。 Is there a way to handle this situation, I feel stuck. 有办法解决这种情况,我感到很困惑。

Bundles generally need to import all the package that do not start with "java.". 捆绑软件通常需要导入所有不以“ java”开头的软件包。 This includes "javax." 这包括“ javax”。 packages. 包。 If your bnd file explicitly does not import javax. 如果您的bnd文件明确不导入javax。 package, then it must rely upon non-standard boot delegation configuration for the framework. 软件包,那么它必须依赖非标准的启动委托配置框架。 That is, the boot delegation provides "free" access to javax. 也就是说,引导委托提供对javax的“免费”访问。 packages from the bundles parent classloader (likely the bootclassloader). 捆绑包的父类加载器(可能是bootclassloader)中的软件包。 So when you remove !javax. 因此,当您删除!javax时。 from the bnd file, your bundle starts to import those packages from some provider which may not be the same as whatever bootdelegation is providing. 从bnd文件中,您的捆绑包开始从某个提供程序导入那些软件包,而这些软件包可能与bootdelegation提供的内容不同。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从OSGI命令提示符运行OSGI捆绑包:导入包缺少约束 - Running OSGI bundle from OSGI command prompt :Import-package missing constraint 为什么此OSGi导入包不起作用? - Why does this OSGi Import-Package not work? OSGI Import-Package:版本vs bundle-version - 有什么区别? - OSGI Import-Package: version vs bundle-version - what's the difference? 强制OSGi包由maven-bundle-plugin / BND导入 - Force OSGi package to be imported by maven-bundle-plugin / BND 尽管有Import-Package,但org.osgi.framework.BundleActivator的ClassNotFoundException - ClassNotFoundException for org.osgi.framework.BundleActivator despite of Import-Package 在MacOS的IDEA中运行bnd结构的应用程序:未解决的要求:导入包:com.apple.eawt - Running bnd-structured app in IDEA on MacOS: Unresolved requirement: Import-Package: com.apple.eawt maven-bundle-plugin创建意外的导入包内容 - maven-bundle-plugin Creates unexpected Import-Package content maven-bundle-plugin不包含Import-Package - maven-bundle-plugin doesn't include Import-Package OSGi:Import-Package / Export-Package和Require-Capability / Provide Capability之间有什么区别? - OSGi: What's the difference between Import-Package/Export-Package and Require-Capability/Provide Capability? 在MANIFEST.MF中将Velocity jar从Bundle-ClassPath移到Import-Package(插件依赖)。然后,.vm文件的位置在哪里? - Moved Velocity jar from Bundle-ClassPath to Import-Package(Plugin dependancies) in MANIFEST.MF Then what should be the place for .vm file?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM