0

im trying to use the POI classes from apache to convert a dovx to txt. I included all the jars that the zip has, but i get this error:

05-21 21:32:04.508: E/dalvikvm(1977): Could not find class 'org.apache.poi.xwpf.usermodel.XWPFDocument', referenced from method com.example.flashcards.WordToTxt.convert
05-21 21:32:04.508: E/AndroidRuntime(1977): FATAL EXCEPTION: main
05-21 21:32:04.508: E/AndroidRuntime(1977): java.lang.NoClassDefFoundError: org.apache.poi.xwpf.usermodel.XWPFDocument
05-21 21:32:04.508: E/AndroidRuntime(1977):     at com.example.flashcards.WordToTxt.convert(WordToTxt.java:16)
05-21 21:32:04.508: E/AndroidRuntime(1977):     at com.example.flashcards.MainActivity.onCreate(MainActivity.java:65)
05-21 21:32:04.508: E/AndroidRuntime(1977):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-21 21:32:04.508: E/AndroidRuntime(1977):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
05-21 21:32:04.508: E/AndroidRuntime(1977):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
05-21 21:32:04.508: E/AndroidRuntime(1977):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
05-21 21:32:04.508: E/AndroidRuntime(1977):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
05-21 21:32:04.508: E/AndroidRuntime(1977):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-21 21:32:04.508: E/AndroidRuntime(1977):     at android.os.Looper.loop(Looper.java:130)
05-21 21:32:04.508: E/AndroidRuntime(1977):     at android.app.ActivityThread.main(ActivityThread.java:3683)
05-21 21:32:04.508: E/AndroidRuntime(1977):     at java.lang.reflect.Method.invokeNative(Native Method)
05-21 21:32:04.508: E/AndroidRuntime(1977):     at java.lang.reflect.Method.invoke(Method.java:507)
05-21 21:32:04.508: E/AndroidRuntime(1977):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
05-21 21:32:04.508: E/AndroidRuntime(1977):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
05-21 21:32:04.508: E/AndroidRuntime(1977):     at dalvik.system.NativeStart.main(Native Method)

and the jar that i included are:

poi-examples
poi-excelant
poi-ooxml
poi-scratchpad

dom4j
stax-api
xmlbeans

Why is not finding that class?? thanks a lot

Now i've these jars in dependencies (in eclipse)

26/11/2012  16:22         1.869.113 poi-3.9-20121203.jar
26/11/2012  16:22           309.368 poi-examples-3.9-20121203.jar
26/11/2012  16:22            30.446 poi-excelant-3.9-20121203.jar
26/11/2012  16:22           936.648 poi-ooxml-3.9-20121203.jar
26/11/2012  16:22         4.802.621 poi-ooxml-schemas-3.9-20121203.jar
26/11/2012  16:22         1.226.511 poi-scratchpad-3.9-20121203.jar

14/05/2011  09:51            73.098 commons-codec-1.5.jar
18/09/2009  15:17            52.915 commons-logging-1.1.jar
05/04/2009  12:24           121.070 junit-3.8.1.jar
05/04/2009  12:24           358.180 log4j-1.2.13.jar

05/04/2009  12:28           313.898 dom4j-1.6.1.jar
23/02/2011  11:31            26.514 stax-api-1.0.1.jar
05/04/2009  12:29         2.666.695 xmlbeans-2.3.0.jar

1 Answer 1

3

Looks like you are missing a few jar's.

http://poi.apache.org/overview.html

You need:

poi-version-yyyymmdd.jar
commons-logging.jar
commons-codec.jar
log4j.jar
poi-ooxml-schemas-version-yyyymmdd.jar
xmlbeans.jar
stax-api-1.0.1.jar
dom4j.jar
Sign up to request clarification or add additional context in comments.

7 Comments

But... where are those files? I downloaded the version 3.9 it's suposed to be all there, I don't see other links... Do I need the version 3.6 to make it run?
They are also included in the 3.9 package (poi-bin-3.9-20121203.tar.gz). You have to unpack it and put the jars in the correct location.
I already did, added the commons-XXX.jar bu still saying class not found... but i see the class inside the package... strange, hate this... thanks anyway
Can you list all jars you have in your project ?
Maybe the problem is that im testing the app in virtualbox? because i tryed with tika jar, and i got the same Exception, classNotFound... (but i dont have errors while importing)
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.