RE: Right place to put my Tokenizer jars

2009-10-15 Thread Chris Hostetter

: Actually, I meant to say I have my Tokenizer jars in solr/lib.
: I have the jars that my Tokenizer jars depend in lib/ext,
: as I wanted them to be loaded only once per container
: due to their internal description.  Bad idea?

unless there is something *really* hinky about those dependencies, i 
wouldn't worry about it -- just put them in solr/lib as well (or sharedLib 
if you use a solr.xml file)

:  This error can be fixed by putting another set of SLF4J jars 
:  in example/lib/ext, but I don't understand why.

In generaly what you are seeing is the security model of classloaders ... 
classes in Solr can access classes in the container's classloader, but 
classes in the container's loader can't see classes in solr.  Even if 
they are the same classes, they are differnet *instances* of those 
classes -- the Class obejcts themselves are distinct.

If you're really concerned about minimizing duplication and having a 
really tiny footprint, reconstructing the solr war to contain all of your 
classes 9and removing anything you *don't* need) is your best bet ... but 
for 99% of the worl hat's going to be major overkill.


-Hoss



Re: Right place to put my Tokenizer jars

2009-10-14 Thread Erik Hatcher
You're better off putting extensions like these in solr-home/lib and  
letting Solr load them rather than putting them in a container  
classpath like Jetty's lib/ext.  As you've seen, conflicts occur  
because of class loader visibility.


Erik

On Oct 14, 2009, at 7:28 PM, Teruhiko Kurosaka wrote:


I have my custom Tokenizer and TokenizerFactory in a jar,
and I've been putting it in example/lib/ext. and it's been
working fine with Solr 1.3.

This jar uses SLF4J as a logging API, and I had the SLF4J jars
in the same place, example/lib/ext.

Because Solr 1.4 uses SLF4J too and have it builtin,
I thought I wouldn't need to have another set of the
same jars, I removed them from example/lib/ext.  Then,
when my TokenizerFactory is run, I've got a
NoClassDefFoundError error.

This error can be fixed by putting another set of SLF4J jars
in example/lib/ext, but I don't understand why.
After all, my jar can access Lucene and Solr APIs whose
jars resides elsewhere than example/lib/ext.  Why only
SLF4J jars must be duplicated and exist in example/lib/ext?
Why SLF4J jars are special? Is this somethng to do
with the fact that SLF4J jars are needed at the static
initialization time? What is the correct place to put
my Tokenizer(Filter) jars?

-kuro




Re: Right place to put my Tokenizer jars

2009-10-14 Thread Koji Sekiguchi
Hi Kurosaka-san,

I think you got a kind of class loader problem.
I usually put my plugin jars under the lib directory of solr home.

http://wiki.apache.org/solr/SolrPlugins#How_to_Load_Plugins

Koji

Teruhiko Kurosaka wrote:
 I have my custom Tokenizer and TokenizerFactory in a jar,
 and I've been putting it in example/lib/ext. and it's been
 working fine with Solr 1.3. 

 This jar uses SLF4J as a logging API, and I had the SLF4J jars
 in the same place, example/lib/ext.

 Because Solr 1.4 uses SLF4J too and have it builtin,
 I thought I wouldn't need to have another set of the
 same jars, I removed them from example/lib/ext.  Then,
 when my TokenizerFactory is run, I've got a
 NoClassDefFoundError error.

 This error can be fixed by putting another set of SLF4J jars
 in example/lib/ext, but I don't understand why.
 After all, my jar can access Lucene and Solr APIs whose
 jars resides elsewhere than example/lib/ext.  Why only
 SLF4J jars must be duplicated and exist in example/lib/ext?
 Why SLF4J jars are special? Is this somethng to do
 with the fact that SLF4J jars are needed at the static
 initialization time? What is the correct place to put
 my Tokenizer(Filter) jars?

 -kuro 

   


-- 
http://www.rondhuit.com/en/



RE: Right place to put my Tokenizer jars

2009-10-14 Thread Teruhiko Kurosaka
Actually, I meant to say I have my Tokenizer jars in solr/lib.
I have the jars that my Tokenizer jars depend in lib/ext,
as I wanted them to be loaded only once per container
due to their internal description.  Bad idea?

-kuro

 From: Teruhiko Kurosaka 
 Sent: Wednesday, October 14, 2009 4:28 PM
 To: solr-user@lucene.apache.org
 Subject: Right place to put my Tokenizer jars
 
 I have my custom Tokenizer and TokenizerFactory in a jar, and 
 I've been putting it in example/lib/ext. and it's been 
 working fine with Solr 1.3. 
 
 This jar uses SLF4J as a logging API, and I had the SLF4J 
 jars in the same place, example/lib/ext.
 
 Because Solr 1.4 uses SLF4J too and have it builtin, I 
 thought I wouldn't need to have another set of the same jars, 
 I removed them from example/lib/ext.  Then, when my 
 TokenizerFactory is run, I've got a NoClassDefFoundError error.
 
 This error can be fixed by putting another set of SLF4J jars 
 in example/lib/ext, but I don't understand why.
 After all, my jar can access Lucene and Solr APIs whose jars 
 resides elsewhere than example/lib/ext.  Why only SLF4J jars 
 must be duplicated and exist in example/lib/ext?
 Why SLF4J jars are special? Is this somethng to do with the 
 fact that SLF4J jars are needed at the static initialization 
 time? What is the correct place to put my Tokenizer(Filter) jars?
 
 -kuro