You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Benson Margulies <bi...@gmail.com> on 2011/07/07 04:21:20 UTC

ClassCastException launching recent snapshot

Launching solr-4.0-20110705.223601-1.war, I get a class cast exception

org.apache.lucene.index.DirectoryReader cannot be cast to
org.apache.solr.search.SolrIndexReader with the following backtrace.

I'm launching solr-as-a-webapp via an embedded copy of tomcat 7. The
location of the index is set up via:

System.setProperty("solr.data.dir", solrDataDirectory);

Further, the sources in the corresponding -sources .jar doesn't seem
to have a cast to SolrIndexReader in it anywhere in SolrIndexSearcher.

SolrIndexSearcher.<init>(SolrCore, IndexSchema, String, IndexReader,
boolean, boolean) line: 142
SolrCore.getSearcher(boolean, boolean, Future[]) line: 1085	
SolrCore.<init>(String, String, SolrConfig, IndexSchema,
CoreDescriptor) line: 587
CoreContainer.create(CoreDescriptor) line: 660	
CoreContainer.load(String, InputStream) line: 412	
CoreContainer$Initializer.initialize() line: 246	
SolrDispatchFilter.init(FilterConfig) line: 86	
ApplicationFilterConfig.initFilter() line: 273	
ApplicationFilterConfig.getFilter() line: 254	
ApplicationFilterConfig.setFilterDef(FilterDef) line: 372	
ApplicationFilterConfig.<init>(Context, FilterDef) line: 98	
StandardContext.filterStart() line: 4584	
StandardContext$2.call() line: 5262	
StandardContext$2.call() line: 5257	
FutureTask$Sync.innerRun() line: 303	
FutureTask<V>.run() line: 138	
ThreadPoolExecutor$Worker.runTask(Runnable) line: 886

Re: ClassCastException launching recent snapshot

Posted by Benson Margulies <bi...@gmail.com>.
I just checked the classpath. No strays.

You can't 'use the example solr installation' when downloading the war
artifact from the snapshot repo.

You might ask me: what happens if I just drop that war into a plain
tomcat? And I plan to try that.

On Thu, Jul 7, 2011 at 8:29 AM, Erick Erickson <er...@gmail.com> wrote:
> Then I would guess that you have other (older) jars in your classpath
> somewhere. Does the example Solr installation work?
>
> Best
> Erick
>
> On Wed, Jul 6, 2011 at 10:21 PM, Benson Margulies <bi...@gmail.com> wrote:
>> Launching solr-4.0-20110705.223601-1.war, I get a class cast exception
>>
>> org.apache.lucene.index.DirectoryReader cannot be cast to
>> org.apache.solr.search.SolrIndexReader with the following backtrace.
>>
>> I'm launching solr-as-a-webapp via an embedded copy of tomcat 7. The
>> location of the index is set up via:
>>
>> System.setProperty("solr.data.dir", solrDataDirectory);
>>
>> Further, the sources in the corresponding -sources .jar doesn't seem
>> to have a cast to SolrIndexReader in it anywhere in SolrIndexSearcher.
>>
>> SolrIndexSearcher.<init>(SolrCore, IndexSchema, String, IndexReader,
>> boolean, boolean) line: 142
>> SolrCore.getSearcher(boolean, boolean, Future[]) line: 1085
>> SolrCore.<init>(String, String, SolrConfig, IndexSchema,
>> CoreDescriptor) line: 587
>> CoreContainer.create(CoreDescriptor) line: 660
>> CoreContainer.load(String, InputStream) line: 412
>> CoreContainer$Initializer.initialize() line: 246
>> SolrDispatchFilter.init(FilterConfig) line: 86
>> ApplicationFilterConfig.initFilter() line: 273
>> ApplicationFilterConfig.getFilter() line: 254
>> ApplicationFilterConfig.setFilterDef(FilterDef) line: 372
>> ApplicationFilterConfig.<init>(Context, FilterDef) line: 98
>> StandardContext.filterStart() line: 4584
>> StandardContext$2.call() line: 5262
>> StandardContext$2.call() line: 5257
>> FutureTask$Sync.innerRun() line: 303
>> FutureTask<V>.run() line: 138
>> ThreadPoolExecutor$Worker.runTask(Runnable) line: 886
>>
>

Re: ClassCastException launching recent snapshot

Posted by Erick Erickson <er...@gmail.com>.
Been There, Done That, Got the T-shirt <G>

Erick

On Thu, Jul 7, 2011 at 12:13 PM, Benson Margulies <bi...@gmail.com> wrote:
> I built a fresh set of snapshots myself, I carefully cleaned my
> project, and everything is happy. So this goes down in the department
> of pirate error.
>
> On Thu, Jul 7, 2011 at 8:29 AM, Erick Erickson <er...@gmail.com> wrote:
>> Then I would guess that you have other (older) jars in your classpath
>> somewhere. Does the example Solr installation work?
>>
>> Best
>> Erick
>>
>> On Wed, Jul 6, 2011 at 10:21 PM, Benson Margulies <bi...@gmail.com> wrote:
>>> Launching solr-4.0-20110705.223601-1.war, I get a class cast exception
>>>
>>> org.apache.lucene.index.DirectoryReader cannot be cast to
>>> org.apache.solr.search.SolrIndexReader with the following backtrace.
>>>
>>> I'm launching solr-as-a-webapp via an embedded copy of tomcat 7. The
>>> location of the index is set up via:
>>>
>>> System.setProperty("solr.data.dir", solrDataDirectory);
>>>
>>> Further, the sources in the corresponding -sources .jar doesn't seem
>>> to have a cast to SolrIndexReader in it anywhere in SolrIndexSearcher.
>>>
>>> SolrIndexSearcher.<init>(SolrCore, IndexSchema, String, IndexReader,
>>> boolean, boolean) line: 142
>>> SolrCore.getSearcher(boolean, boolean, Future[]) line: 1085
>>> SolrCore.<init>(String, String, SolrConfig, IndexSchema,
>>> CoreDescriptor) line: 587
>>> CoreContainer.create(CoreDescriptor) line: 660
>>> CoreContainer.load(String, InputStream) line: 412
>>> CoreContainer$Initializer.initialize() line: 246
>>> SolrDispatchFilter.init(FilterConfig) line: 86
>>> ApplicationFilterConfig.initFilter() line: 273
>>> ApplicationFilterConfig.getFilter() line: 254
>>> ApplicationFilterConfig.setFilterDef(FilterDef) line: 372
>>> ApplicationFilterConfig.<init>(Context, FilterDef) line: 98
>>> StandardContext.filterStart() line: 4584
>>> StandardContext$2.call() line: 5262
>>> StandardContext$2.call() line: 5257
>>> FutureTask$Sync.innerRun() line: 303
>>> FutureTask<V>.run() line: 138
>>> ThreadPoolExecutor$Worker.runTask(Runnable) line: 886
>>>
>>
>

Re: ClassCastException launching recent snapshot

Posted by Benson Margulies <bi...@gmail.com>.
I built a fresh set of snapshots myself, I carefully cleaned my
project, and everything is happy. So this goes down in the department
of pirate error.

On Thu, Jul 7, 2011 at 8:29 AM, Erick Erickson <er...@gmail.com> wrote:
> Then I would guess that you have other (older) jars in your classpath
> somewhere. Does the example Solr installation work?
>
> Best
> Erick
>
> On Wed, Jul 6, 2011 at 10:21 PM, Benson Margulies <bi...@gmail.com> wrote:
>> Launching solr-4.0-20110705.223601-1.war, I get a class cast exception
>>
>> org.apache.lucene.index.DirectoryReader cannot be cast to
>> org.apache.solr.search.SolrIndexReader with the following backtrace.
>>
>> I'm launching solr-as-a-webapp via an embedded copy of tomcat 7. The
>> location of the index is set up via:
>>
>> System.setProperty("solr.data.dir", solrDataDirectory);
>>
>> Further, the sources in the corresponding -sources .jar doesn't seem
>> to have a cast to SolrIndexReader in it anywhere in SolrIndexSearcher.
>>
>> SolrIndexSearcher.<init>(SolrCore, IndexSchema, String, IndexReader,
>> boolean, boolean) line: 142
>> SolrCore.getSearcher(boolean, boolean, Future[]) line: 1085
>> SolrCore.<init>(String, String, SolrConfig, IndexSchema,
>> CoreDescriptor) line: 587
>> CoreContainer.create(CoreDescriptor) line: 660
>> CoreContainer.load(String, InputStream) line: 412
>> CoreContainer$Initializer.initialize() line: 246
>> SolrDispatchFilter.init(FilterConfig) line: 86
>> ApplicationFilterConfig.initFilter() line: 273
>> ApplicationFilterConfig.getFilter() line: 254
>> ApplicationFilterConfig.setFilterDef(FilterDef) line: 372
>> ApplicationFilterConfig.<init>(Context, FilterDef) line: 98
>> StandardContext.filterStart() line: 4584
>> StandardContext$2.call() line: 5262
>> StandardContext$2.call() line: 5257
>> FutureTask$Sync.innerRun() line: 303
>> FutureTask<V>.run() line: 138
>> ThreadPoolExecutor$Worker.runTask(Runnable) line: 886
>>
>

Re: ClassCastException launching recent snapshot

Posted by Erick Erickson <er...@gmail.com>.
Then I would guess that you have other (older) jars in your classpath
somewhere. Does the example Solr installation work?

Best
Erick

On Wed, Jul 6, 2011 at 10:21 PM, Benson Margulies <bi...@gmail.com> wrote:
> Launching solr-4.0-20110705.223601-1.war, I get a class cast exception
>
> org.apache.lucene.index.DirectoryReader cannot be cast to
> org.apache.solr.search.SolrIndexReader with the following backtrace.
>
> I'm launching solr-as-a-webapp via an embedded copy of tomcat 7. The
> location of the index is set up via:
>
> System.setProperty("solr.data.dir", solrDataDirectory);
>
> Further, the sources in the corresponding -sources .jar doesn't seem
> to have a cast to SolrIndexReader in it anywhere in SolrIndexSearcher.
>
> SolrIndexSearcher.<init>(SolrCore, IndexSchema, String, IndexReader,
> boolean, boolean) line: 142
> SolrCore.getSearcher(boolean, boolean, Future[]) line: 1085
> SolrCore.<init>(String, String, SolrConfig, IndexSchema,
> CoreDescriptor) line: 587
> CoreContainer.create(CoreDescriptor) line: 660
> CoreContainer.load(String, InputStream) line: 412
> CoreContainer$Initializer.initialize() line: 246
> SolrDispatchFilter.init(FilterConfig) line: 86
> ApplicationFilterConfig.initFilter() line: 273
> ApplicationFilterConfig.getFilter() line: 254
> ApplicationFilterConfig.setFilterDef(FilterDef) line: 372
> ApplicationFilterConfig.<init>(Context, FilterDef) line: 98
> StandardContext.filterStart() line: 4584
> StandardContext$2.call() line: 5262
> StandardContext$2.call() line: 5257
> FutureTask$Sync.innerRun() line: 303
> FutureTask<V>.run() line: 138
> ThreadPoolExecutor$Worker.runTask(Runnable) line: 886
>