ListValuedMap NoClassDefFoundError when Reading Excel using Apache Poi? - java

While Executing the Program, Below are the issues Compiler is throwing
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/collections4/ListValuedMap
at ReadExcel.main(ReadExcel.java:19)
Caused by: java.lang.ClassNotFoundException:
org.apache.commons.collections4.ListValuedMap
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)
... 1 more
Please help me know how to solve this
Thanks in advance

you should be good if you add the below jar.
https://mvnrepository.com/artifact/org.apache.commons/commons-collections4/4.1

You are missing some required class maybe check your version on pom.xml if you are using eclipse you can do cnt shift T and see if you can open the missing class (ListValuedMap)file and see if it comes from the same jar as you specified in your pom.

Related

Eclipse: export java library with dependencies

I am trying to export a java library in eclipse that has other dependencies - namely apache commons-io. I was able to export it by going to Export >> Jar File - making sure that the libraries are ticked in the "Select the resources to export" box. However, when I implement the library into a test class and run it; I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils
at com.jwf.JavaWebFramework.main.PageBuilder.copyInputFiles(PageBuilder.java:135)
at com.jwf.JavaWebFramework.main.PageBuilder.build(PageBuilder.java:44)
at com.jwf.JavaWebFramework.main.JWF.init(JWF.java:18)
at com.jwf.JWFTest.JWFTest2Main.main(JWFTest2Main.java:23)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils
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)
... 4 more
For whatever reason, Eclipse doesn't appear to be finding the FileUtils class.
Any advice would be greatly appreciated.
Cheers!

Can not get an Output file in Stanford NER

I'm new to Stanford NER and have some problems.
I have downloaded Stanford Named Entity Recognizer version 3.6.0. It works, no problem. But I can't get a tagged text as an output file. Read about extracting data on this site: http://www.themacroscope.org/2.0/using-the-stanford-named-entity-recognizer-to-extract-data-from-texts (Windows user).
Tried to do the same, but got a few errors in command line:
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFacto
ry
at edu.stanford.nlp.io.IOUtils.<clinit>(IOUtils.java:42)
at edu.stanford.nlp.ie.AbstractSequenceClassifier.loadClassifier(Abstrac
tSequenceClassifier.java:1484)
at edu.stanford.nlp.ie.AbstractSequenceClassifier.loadClassifierNoExcept
ions(AbstractSequenceClassifier.java:1497)
at edu.stanford.nlp.ie.crf.CRFClassifier.main(CRFClassifier.java:3015)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
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)
... 4 more
Can somebody explain what's wrong and how should I correct it?
Thank you!
You need to include the lib folder in your CLASSPATH. It contains the necessary jars.
Your program is missing a logger dependency (or somehow it's being blocked by another dependency). I'd try adding it manually:
http://mvnrepository.com/artifact/org.slf4j/slf4j-api/1.7.21
Side note: you can also give a try to illinois-NER.

how can i fix the error in epubcheck 3.01.jar

Is there any one knows how to fix the error below. Before I have epubcheck-1.2.jar and it perfectly worked in my program and now i try to incorporate this new epubcheck-3.0.1.jar. I encounter this error. I am not a java developer, hope someone can help me here.. I need to upgrade my program because the for epub 2 and epub 3, or there is any one knows an offline validator.
Epubcheck Version 3.0.1
java.lang.NoClassDefFoundError: com/thaiopensource/validate/SchemaReaderFactory
at com.adobe.epubcheck.ocf.OCFChecker.<clinit>(OCFChecker.java:65)
at com.adobe.epubcheck.api.EpubCheck.validate(EpubCheck.java:205)
at com.adobe.epubcheck.tool.Checker.validateFile(Checker.java:172)
at com.adobe.epubcheck.tool.Checker.run(Checker.java:255)
at com.adobe.epubcheck.tool.Checker.main(Checker.java:182)
Caused by: java.lang.ClassNotFoundException: com.thaiopensource.validate.SchemaReaderFactory
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)
... 5 more
It's look like You missed at least one dependency
http://mvnrepository.com/artifact/com.thaiopensource/jing/20091111
here it is on maven. if you add this to your project anything should be ok.

Classpath Wildcards - Class Not Found Java

While running a scheduler program through command prompt, I am getting the below error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/quartz/ScheduleBu
ilder
Caused by: java.lang.ClassNotFoundException: org.quartz.ScheduleBuilder
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)
Could not find the main class: ScheduleEmail. Program will exit.
Even after adding all the jar files also I am getting the following.
Java command : java - cp .;E:/Jars/*; ScheduleEmail
Can anyone please suggest why I am getting this?
When using a wildcard (on windows platform), you need to surround it with quotes to work correctly:
java -cp ".;E:/Jars/*;" ScheduleEmail
1. http://docs.oracle.com/javase/6/docs/technotes/tools/windows/classpath.html
first, make sure if there is a typo, there's no space between "-" and "cp"
second, check if quarts jars are in E:/Jars/

Error NoClassDefFoundError/ClassNotFoundException

after about a month of not opening eclipse at all, I get a strange error
java.lang.NoClassDefFoundError: Z
Caused by: java.lang.ClassNotFoundException: Z
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)
Exception in thread "main"
I don't really understand what it wants, it doesn't show me anything else, something about main class "Z" not being defined? but it is, isn't it?
[CODE][/CODE] doesn't work very well here so I'll put source here: http://pastebin.com/heMhDqU2
Thank you.
Edit 1: it shows me when I try to compile and run. Btw, indent code by using 4 spaces for 500 lines... seems kinda reduntant
Your code is fine it compiles here.
Most probably an eclipse error.
Try this.
Close eclipse
Start eclipse with the flag .../eclipse.exe -clean
Press Project -- > Clean

Categories