gpt4 book ai didi

java - osgi.wiring.package; (&(osgi.wiring.package = org.json)(版本> = 0.0.0)) Unresolved 要求:

转载 作者:行者123 更新时间:2023-12-03 05:51:14 26 4
gpt4 key购买 nike

我正在编译一个使用org.json的Java插件。在添加此插件之前,该插件已能够编译并正确运行。我在stackoverflow上看到了类似的问题,但是没有一个问题使用gradle解决。

在我的类顶部,我有以下内容

import org.json.JSONArray;
import org.json.JSONObject;

我的gradle构建脚本包含以下内容:
repositories {
maven {
url "http://repo.dotcms.com/artifactory/libs-release"
}
mavenCentral()
flatDir {
dirs 'src/main/resources/localLibs'
}
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
compile fileTree(dir: 'src/main/resources/libs', include: '*.jar')
compile (group: 'com.dotcms', name: 'dotcms', version: '4.2.2'){
transitive = true
}
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.8'
compile group: 'org.json', name: 'json', version: '20170516'
compile group: 'org.simpleflatmapper', name: 'sfm-csv', version: '3.14.1'
/* Specifying an alternate configuration (see above 'configurations') keeps servlet-api.jar from being added to our own output Jar. */
providedCompile "javax.servlet:javax.servlet-api:3.1.0"
testCompile group: 'junit', name: 'junit', version: '4.12'
}

jar {
manifest {
name = 'Symplicity SOAP API Web Service'
symbolicName = 'Symplicity SOAP API Web Service'
instruction 'Bundle-Vendor', 'JustinKubicek'
instruction 'Bundle-Name', 'Symplicity SOAP API Web Service'
instruction 'Bundle-Description', 'This is a plugin to access the Symplicity SOAP API Web Service'
instruction 'Bundle-DocURL', 'https://bitbucket.org/justinkubicek/symplicity-soap-api-plugin'
instruction 'Bundle-Activator', 'com.symplicitysoapapi.soapapitool.osgi.Activator'
instruction 'DynamicImport-Package', '*'
instruction 'Import-Package', '*;version=0;'
}
}


我得到的错误是这里。
javax.servlet.ServletException: Unable to resolve Symplicity SOAP API Web Service
[197](R 197.0): missing requirement [Symplicity SOAP API Web Service [197](R 197.0)]
osgi.wiring.package; (&(osgi.wiring.package=org.json)(version>=0.0.0))
Unresolved requirements: [[Symplicity SOAP API Web Service [197](R 197.0)]
osgi.wiring.package; (&(osgi.wiring.package=org.json)(version>=0.0.0))]
Unable to start bundle
at com.dotmarketing.portlets.osgi.AJAX.OSGIAJAX.start(OSGIAJAX.java:122)
~[dotcms_4.2.2_999999.jar:?]

最佳答案

除非您需要自定义版本的JSON库,否则建议您更改导入以使用dotCMS库中包含的重新包装的类。重新包装了这些类,以允许开发人员在需要时包括此库的自定义版本。这是4.2.2版本中可用的json类的列表:

./dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/lib/dot.json-ukv_2.jar:com/dotcms/repackage/org/json/XMLTokener.java
./dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/lib/dot.json-ukv_2.jar:com/dotcms/repackage/org/json/XML.java
./dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/lib/dot.json-ukv_2.jar:com/dotcms/repackage/org/json/Test.java
./dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/lib/dot.json-ukv_2.jar:com/dotcms/repackage/org/json/JSONWriter.java
./dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/lib/dot.json-ukv_2.jar:com/dotcms/repackage/org/json/JSONTokener.java
./dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/lib/dot.json-ukv_2.jar:com/dotcms/repackage/org/json/JSONStringer.java
./dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/lib/dot.json-ukv_2.jar:com/dotcms/repackage/org/json/JSONString.java
./dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/lib/dot.json-ukv_2.jar:com/dotcms/repackage/org/json/JSONObject.java
./dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/lib/dot.json-ukv_2.jar:com/dotcms/repackage/org/json/JSONML.java
./dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/lib/dot.json-ukv_2.jar:com/dotcms/repackage/org/json/JSONException.java
./dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/lib/dot.json-ukv_2.jar:com/dotcms/repackage/org/json/JSONArray.java
./dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/lib/dot.json-ukv_2.jar:com/dotcms/repackage/org/json/HTTPTokener.java
./dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/lib/dot.json-ukv_2.jar:com/dotcms/repackage/org/json/HTTP.java
./dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/lib/dot.json-ukv_2.jar:com/dotcms/repackage/org/json/CookieList.java
./dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/lib/dot.json-ukv_2.jar:com/dotcms/repackage/org/json/Cookie.java
./dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/lib/dot.json-ukv_2.jar:com/dotcms/repackage/org/json/CDL.java
./dotserver/tomcat-8.0.18/webapps/ROOT/WEB-INF/lib/dot.json-ukv_2.jar:com/dotcms/repackage/org/json/


当然,要在运行时使用这些类,您需要确保它们已在“导出的包”列表中列出: https://dotcms.com/docs/latest/osgi-plugins#ExportedPackages

关于java - osgi.wiring.package; (&(osgi.wiring.package = org.json)(版本> = 0.0.0)) Unresolved 要求:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47660365/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com