ok. I built the class files for the java files attached herein, add them to lucene-core-3.6.2.jar at org.apache.lucene.analysis and lucene-analyzers-3.6.2.jar at org.apache.lucene.analysis. I then added the path of the dependencies to classpath in the init.py file. I ran the typical index file using this customized analyzer through PythonAnalyzer and got the above error. Meanwhile, I had earlier ran the index file using standard analyzer before adding the classes and it worked. After running the index file with the customized analyzer failed, I tried again with the standard analyzer which had earlier worked before adding the classes but failed this time around with same error message as above. I guess the problem has to do with array compatibility in java and python but I don't really know. Thanks.
On Fri, Oct 17, 2014 at 7:23 PM, Andi Vajda <va...@apache.org> wrote: > > On Fri, 17 Oct 2014, Alexander Alex wrote: > > Meanwhile, am using lucene 3.6.2 version. The problem is jvm instantiation >> from any python code using lucene caused as a result of the classes I >> added >> to lucene core. >> >> ---------- Forwarded message ---------- >> >> I added a customized lucene analyzer class to lucene core in Pylucene. >> > > Please explain in _detail_ the steps you followed to accomplish this. > A log of all the commands you ran would be ideal. > > Thanks ! > > Andi.. > > > This class is google guava as a dependency because of the array handling >> function available in com.google.common.collect.Iterables in guava. When >> I tried to index using this analyzer, I got the following error: >> >> Traceback (most recent call last): File "C:\IndexFiles.py", line 78, in >> lucene.initVM() JavaError: java.lang.NoClassDefFoundError: >> org/apache/lucene/analysis/CharArraySet Java stacktrace: >> java.lang.NoClassDefFoundError: org/apache/lucene/analysis/CharArraySet >> Caused by: java.lang.ClassNotFoundException: >> org.apache.lucene.analysis.CharArraySet 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) >> >> Even the example indexing code in Lucene in Action that I tried earlier >> and >> worked, when I retried it after adding this class is returning the same >> error above. Am not too familiar with CharArraySet class as I can see the >> problem is from it. How do i handle this? Attached is the java files whose >> class were added to lucene core in pylucene. Thanks >> >>