Using Illinois Chunker - java

I am trying to extract noun phrases from text using the illinois chunker however i seem to be getting something wrong. I am trying to run the command in a centos6.4 system with jdk1.8 having downloaded the jar given in the link.
java -Xmx512m -classpath /path/to/LBJChunk.jar edu.illinois.cs.cogcomp.lbj.chunk.ChunksAndPOSTags snippeting.txt
this returns a class not found exception, what am i doing wrong >:( do i have to download an other jar for the parser?
Exception in thread "main" java.lang.NoClassDefFoundError: LBJ2/parse/Parser
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2688)
at java.lang.Class.getMethod0(Class.java:2937)
at java.lang.Class.getMethod(Class.java:1771)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: LBJ2.parse.Parser
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 6 more

You'll need some more jars on the classpath. It's not very clear, but the description for the chunker notes that LBJ (a language library) and the Illinois POS tagger are required. You can get more information on how to run it here.
Then, run this command:
java -classpath /path/to/LBJChunk.jar:/path/to/LBJ2Library.jar:/path/toLBJPOS.jar \
edu.illinois.cs.cogcomp.lbj.chunk.ChunksAndPOSTags snippeting.txt
That should work!

Related

Error while running ice on ubuntu ( java)

I am having trouble while trying to run the example for printer.
when i try to run the class for the server it prints
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: Ice/LocalException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: Ice.LocalException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
For what i have been searching it is caused by the classpath export?
i did export CLASSPATH=$CLASSPATH:./classes:$ICE_HOME/share/java/ice.jar
ICE_HOME is /usr.
Does anyone know how to fix? thanks
After typing the question continued looking for it. As it seems exports are wierd, when i do ctrl + shift + T for a new terminal it deletes them. Only after looking at the exports page i realized they were getting deleted.

java.lang.NoClassDefFoundError: org/apache/spark/sql/SchemaRDD

I am getting a NoClassDefFound error when trying to run Spark. I cannot figure out the reason behind this. Please help.
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/spark/sql/SchemaRDD
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:659)
at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:180)
at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:205)
at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:120)
at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
Caused by: java.lang.ClassNotFoundException: org.apache.spark.sql.SchemaRDD
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 10 more
NoClassDefFoundError means Java couldn't find the Class it was looking for. That normally means:
You defined wrongly the classpath.
Java is finding and using the wrong version of the jar (probably because of Maven dependency hell).
Solution for 1 is to check the classpath: make sure you are including the jar that defines org.apache.spark.sql.SchemaRDD.
Solution for 2 is to check if you have a Maven dependency that depends (transitively) on an older version of the resource that defines that class.

start kettle in ubuntu error

When I want to start Kettle:
$ cd ../kettle/data-integration
$ spoon.sh
there is a error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Composite
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2615)
at java.lang.Class.getMethod0(Class.java:2856)
at java.lang.Class.getMethod(Class.java:1668)
at org.pentaho.commons.launcher.Launcher.main(Launcher.java:91)
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.widgets.Composite
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 5 more
I have also faced this issue many times when i change the kettle directory or execute it from different path . The solution that worked for me is to remove the extracted folder and extract a fresh copy and the system starts working.Beside this also check that you are using Oracle java instead of open java comes with ubuntu.

java.lang.ClassNotFoundException: com.jme3.system.JmeDesktopSystem JME3

When I try to simulate my little project, I decided to use jme3 library and browsed the jar file through Configure-> JDK Profiles-> Add Archieve-> JME3-core.jar and ran the project sample code. The code was written in a website and I got the exception as:
Mar 25, 2014 10:53:44 AM com.jme3.system.JmeSystem checkDelegate
SEVERE: No JmeSystemDelegate specified, cannot instantiate default JmeDesktopSystem:
{0}
java.lang.ClassNotFoundException: com.jme3.system.JmeDesktopSystem
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at com.jme3.system.JmeSystem.checkDelegate(JmeSystem.java:125)
at com.jme3.system.JmeSystem.showSettingsDialog(JmeSystem.java:96)
at com.jme3.app.SimpleApplication.start(SimpleApplication.java:129)
at Main.main(Main.java:12)
Exception in thread "main" java.lang.NullPointerException
at com.jme3.system.JmeSystem.showSettingsDialog(JmeSystem.java:97)
at com.jme3.app.SimpleApplication.start(SimpleApplication.java:129)
at Main.main(Main.java:12)
Process completed.
Is the problem about the native libraries kind of issue which is also need to be dealt with J3D libraries? I mean, do I need to follow some instructions about installing and importing JME3 libraries? If so, can anyone tell me the instructions or where to download the correct .jar file?
find a similar discussion here ..this might be relevant ...
more on the same http://hub.jmonkeyengine.org/forum/topic/latest-jme3-sdk-update-trashed-13-of-my-installations/

Trouble setting up lucene on Mac OSX

I'm having a lot of trouble getting Lucene to work on Mac OS 10.7.5
I downloaded the binaries from http://lucene.apache.org/core/2_9_4/demo.html.
I changed my classpath
$ echo $CLASSPATH
/Users/me/Downloads/lucene-4.5.1/demo/lucene-demo-4.5.1.jar:/Users/me/Downloads/lucene-4.5.1/core/lucene-core-4.5.1.jar
Now I'm trying to run it.
$java org.apache.lucene.demo.IndexFiles /Users/me/Downloads/lucene-4.5.1/src
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/lucene/analysis/standard/StandardAnalyzer
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
at java.lang.Class.getMethod0(Class.java:2774)
at java.lang.Class.getMethod(Class.java:1663)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.analysis.standard.StandardAnalyzer
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 6 more
It's not working. Can someone give me a step-by-step guide to getting up and running with Lucene. I have a simple task I want to do achieve, which is searching for text in a directory of files in a more efficient way than grep. Any help would be appreciated.
You'll also need to add two more jars to your classpath: lucene-analyzers-common-{version}.jar to fix this problem, and lucene-queryparser-{version}.jar to fix the next one. More recent demo documentation makes this clear (the documentation you linked to is for version 2.9.4)

Categories