hi,
DIH does not load class using the SolrResourceLoader. It tries a
Class.forName() with the name you provide if it fails it prepends
"org.apache.solr.handler.dataimport." and retries.

This is true for not just transformers but also for Entityprocessor,
DataSource and Evaluator

The reason for doing so is that we do not use any of the 'solr.'
packages in DIH. All our implementations fall into the default package
and we can directly use them w/o the package name.

So , if you are writing your own implementations use the default
package or provide the fully qualified class name.

--Noble

On Thu, Jun 19, 2008 at 8:09 AM, Jon Baer <[EMAIL PROTECTED]> wrote:
> Thanks.  Yeah took me a while to figure out I needed to do something like
> transformer="com.mycompany.solr.MyTransformer" on the entity before it would
> work ...
>
> - Jon
>
> On Jun 18, 2008, at 1:51 PM, Brendan Grainger wrote:
>
>> Hi,
>>
>> I set up the new DataimportHandler last night to replace some custom
>> import code I'd written and so far I'm loving it thank you.
>>
>> I had one issue you might want to know about it. I have some solr
>> extensions I've written and packaged in a jar which I place in:
>>
>> solr-home/lib
>>
>> as per:
>>
>>
>> http://wiki.apache.org/solr/SolrPlugins#head-59e2685df65335e82f8936ed55d260842dc7a4dc
>>
>> This works well for my handlers but a custom Transformer I wrote and
>> packaged the same way was throwing a ClassNotFoundException. I tracked it
>> down to the DocBuilder.loadClass method which was just doing a
>> Class.forName. Anyway, I fixed it for the moment by probably do something
>> stupid and creating a SolrResourceLoader (which I imagine could be an
>> instance variable, but at 3am I just wanted to get it working). Anyway, this
>> fixes the problem:
>>
>>  @SuppressWarnings("unchecked")
>>  static Class loadClass(String name) throws ClassNotFoundException {
>>   SolrResourceLoader loader = new SolrResourceLoader( null );
>>   return loader.findClass(name);
>>    // return Class.forName(name);
>>  }
>>
>> Brendan
>
>



-- 
--Noble Paul
  • Slight issue with clas... Brendan Grainger
    • Re: Slight issue ... Jon Baer
      • Re: Slight is... Noble Paul നോബിള്‍ नोब्ळ्
        • Re: Sligh... Brendan Grainger
          • Re: S... Noble Paul നോബിള്‍ नोब्ळ्
            • ... Brendan Grainger
            • ... Chris Hostetter
              • ... Noble Paul നോബിള്‍ नोब्ळ्
                • ... Brian Carmalt
                • ... Erik Hatcher
                • ... William Silva
                • ... Noble Paul നോബിള്‍ नोब्ळ्
                • ... Chris Hostetter

Reply via email to