I don't really know a lot about RMI, but as i understand it, Serialization
is a core neccessity -- if the arguments you want to pass to your Remote
Method aren't serializable, then RMI can't pass those argument across the
wire.

That said: it's not clear to me from the psuedocode/stacktrace you
included *what* isn't serializable ... is it a Solr class or a core Lucene
class?

If it's a Lucene class, you may want to start by making a small proof
of concept RMI app that just uses the Lucene core classes, once that
works then try your changes in Solr.


: Date: Tue, 9 May 2006 02:32:45 -0700
: From: Koji Miyamoto <[EMAIL PROTECTED]>
: Reply-To: solr-user@lucene.apache.org
: To: solr-user@lucene.apache.org
: Subject: extending SolrIndexSearcher
:
: Hi,
:
: I am looking at extending the source code for SolrIndexSearcher for my own
: purposes.  Basically, I am trying to replace the use of Lucene's
: IndexSearcher with a ParallelMultiSearcher version so that I can have a
: query search both locally available indexes as well as remote indexes
: available only via RMI.  This ParallelMultiSearcher is instantiated to
: consist of both local and remote Searchable references.  The local
: Searchables are simply IndexSearcher instances tied to local disk (separate
: indexes), while the remote Searchables are made reachable via RMI.
:
: In essence, where it used to be:
:
:   IndexSearcher searcher = new IndexSearcher(reader);
:
: it is now: (not the actual code but similar)
:
:   Searchable[] searchables = new Searchable[3];
:   for (int i=0; i<2; i++) {
:     // Local searchable:
:     searchables[i] = new IndexSearcher("/disk" + i + "/index");
:   }
:
:   // RMI searchable:  throws exception during search..
:   searchables[2] = (Searchable) Naming.lookup
: ("//remote_host:1099/remote_svc");
:
:   ParallelMultiSearcher searcher = new ParallelMultiSearcher(sch);
:
: When I build the source and use it (the short story, by replacing the
: relevant class file(s) within solr.war used by the example jetty
: implementation), it starts up just fine.  If I comment out the RMI
: searchable line, submission of a search query to Jetty/Solr works just fine,
: and it is able to search any number of indexes.  However, with the RMI
: searchable uncommented out, I get an exception thrown (here's the ending of
: it):
:
: May 9, 2006 1:38:07 AM org.apache.solr.core.SolrException log
: SEVERE: java.rmi.MarshalException: error marshalling arguments; nested
: exception is:
:         java.io.NotSerializableException:
: org.apache.lucene.search.MultiSearcher$1
:         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
:         at org.apache.lucene.search.RemoteSearchable_Stub.search(Unknown
: Source)
:         at org.apache.lucene.search.MultiSearcher.search(MultiSearcher.java
: :248)
:         at org.apache.lucene.search.Searcher.search(Searcher.java:116)
:         at org.apache.lucene.search.Searcher.search(Searcher.java:95)
:         at org.apache.solr.search.SolrIndexSearcher.getDocListNC(
: SolrIndexSearcher.java:794)
:         at org.apache.solr.search.SolrIndexSearcher.getDocListC(
: SolrIndexSearcher.java:712)
:         at org.apache.solr.search.SolrIndexSearcher.getDocList(
: SolrIndexSearcher.java:605)
:         at org.apache.solr.request.StandardRequestHandler.handleRequest(
: StandardRequestHandler.java:106)
:
: So it looks like it requires Serialization somehow to get it to work.
: Wondering if anyone has any ideas to get around this problem.
:
: tia,
: Koji
:



-Hoss

Reply via email to