Issue with Custom full text lucene index

31 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Daniel

ungelesen,
09.05.2012, 14:46:2709.05.12
an 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

ungelesen,
09.05.2012, 15:20:0309.05.12
an 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

ungelesen,
10.05.2012, 14:22:5710.05.12
an 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

ungelesen,
10.05.2012, 14:29:3410.05.12
an ne...@googlegroups.com

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

Send from mobile.

Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten