Issue with Custom full text lucene index

31 views
Skip to first unread message

Daniel

unread,
May 9, 2012, 2:46:27 PM5/9/12
to Neo4j
Hey Guys,

I implemented a custom analyzer(CustomAnalyzer) for lucene overriding
the ReusableAnalyzerBase class. Created an full text index during a
batch import operation

fulltextIndex = indexProvider.nodeIndex("mainTextParagraphs",
MapUtil.stringMap("type", "fulltext", "analyzer",
CustomAnalyzer.class.getName()));

everything works the db imports.

I then tested the db in a standalone project with the following code,
again everything works.
(PASTIE here)
http://pastie.org/3885606

When I try running it on an MVC that we are building I get a class not
found exception.

Caused by: java.lang.ClassNotFoundException:
MainSearchPackage.CustomAnalyzer
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at
org.neo4j.index.impl.lucene.IndexType.getByClassName(IndexType.java:
246)

I checked the classLoader and the class is present there with a single
instance & proper name.

I thought this may be a security permissions issue and surrounded the
index assignment with

AccessController.doPrivileged(new PrivilegedAction() {
public Object run(){
fulltextIndex =
DatabaseInstance.caseDB.index().forNodes("mainTextParagraphs",
MapUtil.stringMap("type", "fulltext",
"analyzer",CustomAnalyzer.class.getName()));
((LuceneIndex<Node>)
fulltextIndex ).setCacheCapacity( "mainTextParagraphs", cacheSize );
return null;
}
});

still same error, I also tried forcibly loading the classloader, same
error.

I am stumped do you guys have any idea what this is?

Thanks for the help
,

Dan


Peter Neubauer

unread,
May 9, 2012, 3:20:03 PM5/9/12
to ne...@googlegroups.com

Got the project somewhere? Sounds like something around maybe underlying OSGi separating your code and the loading index?

Send from mobile.

Daniel

unread,
May 10, 2012, 2:22:57 PM5/10/12
to Neo4j

I do, could I send you the code base via an email? It will be public
project soon/but isn't at the moment. Also the db is quite large ~ 5.9
G / ill provide you with a download link.

Best,

Dan
On May 9, 12:20 pm, Peter Neubauer <neubauer.pe...@gmail.com> wrote:
> Got the project somewhere? Sounds like something around maybe underlying
> OSGi separating your code and the loading index?
>
> Send from mobile.

Peter Neubauer

unread,
May 10, 2012, 2:29:34 PM5/10/12
to ne...@googlegroups.com

That is all just code? Don't need the full database...

Send from mobile.

Reply all
Reply to author
Forward
0 new messages