You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@lucene.apache.org by vijaymohanp <vi...@ranker.com> on 2011/09/12 15:00:15 UTC

Solr upgraded to from 1.4.0 to 3.3.0 and getting exception at WordDelimiterFilterFactory

We have recently upgraded the solr version from 1.4.0 to version 3.3.0. Now
from app we are having custom word delimiter filter generate the
TokenStream. Now that method is failing WordDelimiterFilterFactory.create()
method. Exception that am getting given below, 

java.lang.NoSuchMethodError:
org.apache.solr.analysis.WordDelimiterFilter.addAttribute(Ljava/lang/Class;)Lorg/apache/lucene/util/Attribute;
	at
org.apache.solr.analysis.WordDelimiterFilter.(WordDelimiterFilter.java:123)
	at
org.apache.solr.analysis.WordDelimiterFilterFactory.create(WordDelimiterFilterFactory.java:108)
	at
com.ranker.app.service.search.AutoSuggestService.createWordDelimiterFilter(AutoSuggestService.java:363)
	at
com.ranker.app.service.search.AutoSuggestService.createSolrQuery(AutoSuggestService.java:336)
	at
com.ranker.app.service.search.AutoSuggestService.secondarySearch(AutoSuggestService.java:276)
	at
com.ranker.app.service.search.AutoSuggestServiceTest.testSecondarySearch(AutoSuggestServiceTest.java:174)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at junit.framework.TestCase.runBare(TestCase.java:134)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
	at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
	at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

And my method is,

private TokenStream createWordDelimiterFilter(TokenStream tokenStream)
    {
        WordDelimiterFilterFactory wordDelimiterFilterFactory = new
WordDelimiterFilterFactory();
        HashMap&lt;String, String&gt; wordDelimiterParameters = new
HashMap&lt;String, String&gt;();
        wordDelimiterParameters.put("generateWordParts", "1");
        wordDelimiterParameters.put("generateNumberParts", "1");
        wordDelimiterParameters.put("catenateWords", "0");
        wordDelimiterParameters.put("catenateNumbers", "0");
        wordDelimiterParameters.put("catenateAll", "0");
        wordDelimiterParameters.put("splitOnCaseChange", "0");
        wordDelimiterFilterFactory.init(wordDelimiterParameters);
        return wordDelimiterFilterFactory.create(tokenStream);
    }

Your help appreciated in advance!

--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-upgraded-to-from-1-4-0-to-3-3-0-and-getting-exception-at-WordDelimiterFilterFactory-tp3329542p3329542.html
Sent from the Lucene - General mailing list archive at Nabble.com.

Re: Solr upgraded to from 1.4.0 to 3.3.0 and getting exception at WordDelimiterFilterFactory

Posted by Chris Hostetter <ho...@fucit.org>.
: We have recently upgraded the solr version from 1.4.0 to version 3.3.0. Now
: from app we are having custom word delimiter filter generate the
: TokenStream. Now that method is failing WordDelimiterFilterFactory.create()
: method. Exception that am getting given below, 
: 
: java.lang.NoSuchMethodError:

NoSuchMethodError means that some peice of code is attempting to call a 
method that doesn't exist -- usually this happens because you are running 
a mix of classes (ie: jars) that aren't compatible.

more then likely you either have multiple duplicate jars, or you are 
trying to re-use a class from an older version that hasn't been recompiled 
(these kinds of incompatibilities would normally be caught at compliation)

Where this stack trace says the error is coming from suggests that you are 
using the WDF class from one version of solr combined with the WDFFactory 
class from a differnet version of solr.

In fact, this right here is a dead give away...

: org.apache.solr.analysis.WordDelimiterFilter.addAttribute(Ljava/lang/Class;)Lorg/apache/lucene/util/Attribute;
:         at
: org.apache.solr.analysis.WordDelimiterFilter.(WordDelimiterFilter.java:123)
:         at
: org.apache.solr.analysis.WordDelimiterFilterFactory.create(WordDelimiterFilterFactory.java:108)

...in Solr 3.3, WordDelimiterFilter was moved to 
org.apache.lucene.analysis.miscellaneous ... there is no 
o.a.s.analysis.WDF class.



-Hoss