简体   繁体   中英

Unable to resolve NoClassDefFoundError for Jena IRIFactory

Below is the stacktrace of the error log I'm getting. If someone can tell what exactly could be causing this because as per the stacktrace I've everything in place.

Exception in thread "main" java.lang.NoClassDefFoundError: com/hp/hpl/jena/iri/IRIFactory
    at net.rootdev.javardfa.uri.IRIResolver.<init>(IRIResolver.java:26)
    at org.odftoolkit.odfdom.pkg.rdfa.SAXRDFaParser.createInstance(SAXRDFaParser.java:57)
    at org.odftoolkit.odfdom.pkg.OdfFileDom.initialize(OdfFileDom.java:217)
    at org.odftoolkit.odfdom.pkg.manifest.OdfManifestDom.initialize(OdfManifestDom.java:74)
    at org.odftoolkit.odfdom.pkg.OdfFileDom.<init>(OdfFileDom.java:132)
    at org.odftoolkit.odfdom.pkg.manifest.OdfManifestDom.<init>(OdfManifestDom.java:63)
    at org.odftoolkit.odfdom.pkg.OdfFileDom.newFileDom(OdfFileDom.java:189)
    at org.odftoolkit.odfdom.pkg.OdfPackage.parseManifest(OdfPackage.java:1219)
    at org.odftoolkit.odfdom.pkg.OdfPackage.readZip(OdfPackage.java:452)
    at org.odftoolkit.odfdom.pkg.OdfPackage.initializeZip(OdfPackage.java:422)
    at org.odftoolkit.odfdom.pkg.OdfPackage.<init>(OdfPackage.java:250)
    at org.odftoolkit.odfdom.pkg.OdfPackage.loadPackage(OdfPackage.java:320)
    at org.odftoolkit.simple.Document.loadDocument(Document.java:328)
    at org.odftoolkit.simple.TextDocument.loadDocument(TextDocument.java:305)
    at com.poc.LetsGetStarted.main(LetsGetStarted.java:13)
Caused by: java.lang.ClassNotFoundException: com.hp.hpl.jena.iri.IRIFactory
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 15 more

Jar Versions : jena-iri : 1.0.2 , java-rdfa : 0.4

Thanks.

我有理由,我已经尝试了java-rdfa版本0.4和0.5快照,但它们都引用了com.hp.hpl.jena.iri.IRIFactory ,但是在当前的包装中,IRIFactory被移动到包org.apache.jena.iri.IRIFactory

com/hp/hpl/jena/iri/IRIFactory class is not in any of the JARs specified in the class path.

To find the whether the class IRIFactory is in any of the jar files in the CLASS_PATH 1) In windows extract each jar file and check for the class name 2) In linux use "jar -tvf [jar-file-name] |grep "IRIFactory"

If none of the jar contains the class file, add the correct jar in the class path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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