简体   繁体   English

如何将 javax.json jar 正确包含到已部署的 .jar 文件中

[英]How to properly include javax.json jar to a deployed .jar file

I'm trying to include javax.json.jar to my project in Jdeveloper 12c IDE我正在尝试在Jdeveloper 12c IDE javax.json.jar包含到我的项目中

The final phillplugin.jar includes:最终的phillplugin.jar包括:

  • META-INF folder containing MANIFEST.MF file包含MANIFEST.MF文件的META-INF文件夹
  • phillplugin folder which includes my phillplugin.class包含我的phillplugin.class phillplugin文件夹
  • javax.json-1.0.2.jar file javax.json-1.0.2.jar文件
  • phillplugin.xml

Although the server crashes because it doesn't recognize my javax.json class from the MANIFEST.MF file with the following Error:尽管服务器崩溃是因为它无法从MANIFEST.MF文件中识别出我的 javax.json 类,并出现以下错误:

Unable to resolve 2.0: missing requirement [2.0] osgi.wiring.package; (osgi.wiring.package=javax.json)

This is how i'm exporting it:这是我导出它的方式:

  1. Right click the project -> properties右键单击项目->属性
  2. Libraries / Classpath -> checking the javax.json-1.0.2.jar/类路径-> 检查javax.json-1.0.2.jar
  3. Deployment -> editing deployed my profile部署-> 编辑部署我的配置文件
  4. File Groups -> new -> type : Libraries name : lib文件组-> 新建 ->类型:库名称:lib
  5. Contributors : Everything is checked贡献者:一切都被检查
  6. Filters : checking the javax.json-1.0.2.jar过滤器:检查javax.json-1.0.2.jar

and then im deploying it.然后我正在部署它。

Is the way i'm doing it wrong?是我做的方式不对吗?

i had to include in my MANIFEST.MF like so: org.json;resolution:= optional,org.json.JSONObject;resolution:=optional我必须像这样包含在我的MANIFEST.MForg.json;resolution:= optional,org.json.JSONObject;resolution:=optional

Manifest-Version: 1.0
Bundle-SymbolicName: PhillPlugin
Bundle-Version: 10
Bundle-Name: PhillPlugin
Bundle-Activator: phillplugin.PhillPlugin
Bundle-ManifestVersion: 2
Import-Package: org.osgi.framework;version="1.3.0",oracle.security.am.
 plugin,oracle.security.am.plugin.authn,oracle.security.am.plugin.impl
 ,oracle.security.am.plugin.api,oracle.security.am.common.utilities.pr
 incipal,oracle.security.idm,javax.security.auth,org.json;resolution:=
 optional,org.json.JSONObject;resolution:=optional

as well as the .jar and the library以及.jarlibrary

在此处输入图片说明

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM