1

I am having a problem with one of my app development in android and I was wondering if anyone could give any help. Iam developing an app in android to convert english paragraph to malayalam. For that I am using opennlp library. I am using opennlp models like en-sent.bin,en-token.bin also. I parse a sentence using "en-parser-chunking.bin" model to generate parsed sentences like the one given below. (TOP (S (NP (NN Programcreek) ) (VP (VBZ is) (NP (DT a) (ADJP (RB very) (JJ huge) (CC and) (JJ useful) ) ) ) (. website.) ) ) I am getting correct parsed sentence in netbeans but I'm getting error in android. The error is like this.

06-10 08:11:55.420: W/dalvikvm(1623): threadid=1: thread exiting with uncaught exception (group=0xb3ad6b90)
***06-10 08:11:55.440: E/AndroidRuntime(1623): FATAL EXCEPTION: main
06-10 08:11:55.440: E/AndroidRuntime(1623): Process: com.example.opennlp1, PID: 1623
06-10 08:11:55.440: E/AndroidRuntime(1623): java.lang.NoClassDefFoundError: opennlp.model.GenericModelReader
06-10 08:11:55.440: E/AndroidRuntime(1623):     at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)***
06-10 08:11:55.440: E/AndroidRuntime(1623):     at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
06-10 08:11:55.440: E/AndroidRuntime(1623):     at opennlp.tools.util.model.BaseModel.loadModel(BaseModel.java:231)
06-10 08:11:55.440: E/AndroidRuntime(1623):     at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:181)
06-10 08:11:55.440: E/AndroidRuntime(1623):     at opennlp.tools.sentdetect.SentenceModel.<init>(SentenceModel.java:95)
06-10 08:11:55.440: E/AndroidRuntime(1623):     at com.example.opennlp1.MainActivity.SentenceDetect(MainActivity.java:52)
06-10 08:11:55.440: E/AndroidRuntime(1623):     at com.example.opennlp1.MainActivity.onCreate(MainActivity.java:33)
06-10 08:11:55.440: E/AndroidRuntime(1623):     at android.app.Activity.performCreate(Activity.java:5243)
06-10 08:11:55.440: E/AndroidRuntime(1623):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
06-10 08:11:55.440: E/AndroidRuntime(1623):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2140)
06-10 08:11:55.440: E/AndroidRuntime(1623):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
06-10 08:11:55.440: E/AndroidRuntime(1623):     at android.app.ActivityThread.access$700(ActivityThread.java:135)
06-10 08:11:55.440: E/AndroidRuntime(1623):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
06-10 08:11:55.440: E/AndroidRuntime(1623):     at android.os.Handler.dispatchMessage(Handler.java:102)

Can anyone help me to solve the error?

Chris Barlow
  • 3,274
  • 4
  • 31
  • 52
Suganya
  • 21
  • 2

1 Answers1

-1

this error usually happens when the java virtual machine is not able to find a class during runtime that was available during compilation. in order to fix it, check the .classpath file in your project, probably the jar file you added is missing from class path. write the path to it yourself in the .classpath file and your program should work.

check out this link: http://javarevisited.blogspot.com/2011/06/noclassdeffounderror-exception-in.html

Nawar Khoury
  • 170
  • 2
  • 13