Ruby + Apache Lucene using XMLRPC?

Sorry Frank… I’m pretty stumped too. If the commons-codec.jar is on
the classpath, it
should be found. And what really sucks is that you have a “no class
found” for an
exception… so even once you fix that, it’ll be throwing an
exception. Well, I guess it
might be catching it too, so maybe that won’t be a big deal.

Hmm, you say you “include the DecoderException class”… you don’t mean
just the .class
file, right? If so, that won’t do any good because the java package
system expects the
classes to be in their appropriate package directory. That’s why they
have jars… jars
are just zip files. You can unzip it and look at the package (i.e.
directory) structure
inside. You might actually take a look inside the commons-codec jar and
make sure it has
DecoderException.

Sorry this is being so difficult… Erik, you still lurking?

b

On Feb 24, 2006, at 12:35 PM, Ben M. wrote:

Sorry this is being so difficult… Erik, you still lurking?

Yes, I’m still lurking and reading infrequently. Yes, Commons Codec
is needed on the classpath. Provide us with the exact command-line
you’re using to launch and perhaps I can help further, but we’re
really talking about Java 101 here and it is perhaps abusing this
list to go into too many details on this when there are a plethora of
resources online that deal with this type of issue. No offense
intended, just trying to direct you to the most appropriate resources
rather than messaging a list of Rails users that most could not care
less about Java.

Other than having XML-RPC, Lucene, and Commons Codec’s JAR files on
the classpath you should be in good shape. Our production
SearchServer (different from Nick’s in underlying functionality, but
the same command-line interface) is launched like this:

java -cp build/nines.jar:lib/lucene-core-1.9-rc1-dev.jar:lib/commons-
codec-1.3.jar:lib/xmlrpc-2.0.jar
org.nines.SearchServer [port number]

our nines.jar contains org.nines.SearchServer.

Best of luck with your SearchServer efforts. Perhaps the free
codebase for Lucene in Action at http://www.lucenebook.com would help
you get rolling (lots of instructions on how to get the code running)
or the book would be the next step for you. :slight_smile:

Erik

Hey Ben,

Thanks for your reply.

I have searched all over the web and cannot find any reason why I
should be getting that error. I have tried recompiling with different
versions too but no luck.

Sorry Frank… I’m pretty stumped too.
If the commons-codec.jar is on the classpath, it should be
found. And what really sucks is that you have a “no class found” for an
exception… so even once you fix that, it’ll be throwing an
exception.

Yes I have the commons-codec.jar file on the classpath. I am compiling
using the following:

javac -cp
commons-codec-1.2.jar:/var/java/jdk1.5.0_06/lib/xmlrpc-2.0/xmlrpc-2.0.jar:/var/java/jdk1.5.0_06/lib/xmlrpc-2.0.jar:/var/java/jdk1.5.0_06/lib/lucene-core-1.9-rc1.jar:/var/java/jdk1.5.0_06/lib/commons-codec-1.2.jar
SearchServer.java

Hmm, you say you “include the DecoderException class”… you don’t
mean just the .class >> file, right?

Sorry for the confusion. I meant to say I have the following import
statements:

import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.*;

You can unzip it and look at the package (i.e. directory)
structure inside. You might actually take a look inside the
commons-codec jar and make sure it has DecoderException.

I unzipped the commons-codec.jar file and can see the DecoderException
class:

[root@srv30 test]# unzip commons-codec-1.2.jar
Archive: commons-codec-1.2.jar
creating: META-INF/
inflating: META-INF/MANIFEST.MF
creating: org/
creating: org/apache/
creating: org/apache/commons/
creating: org/apache/commons/codec/
creating: org/apache/commons/codec/binary/
creating: org/apache/commons/codec/language/
creating: org/apache/commons/codec/net/
creating: org/apache/commons/codec/digest/
inflating: org/apache/commons/codec/BinaryDecoder.class
inflating: org/apache/commons/codec/Decoder.class
inflating: org/apache/commons/codec/DecoderException.class
inflating: org/apache/commons/codec/BinaryEncoder.class
inflating: org/apache/commons/codec/Encoder.class
inflating: org/apache/commons/codec/EncoderException.class
inflating: org/apache/commons/codec/StringEncoder.class
inflating: org/apache/commons/codec/StringEncoderComparator.class
inflating: org/apache/commons/codec/binary/Base64.class
inflating: org/apache/commons/codec/binary/Hex.class
inflating:
org/apache/commons/codec/language/DoubleMetaphone$DoubleMetaphoneResult.class
inflating: org/apache/commons/codec/language/DoubleMetaphone.class
inflating: org/apache/commons/codec/language/Metaphone.class
inflating: org/apache/commons/codec/language/RefinedSoundex.class
inflating: org/apache/commons/codec/language/Soundex.class
inflating: org/apache/commons/codec/net/URLCodec.class
inflating: org/apache/commons/codec/StringDecoder.class
inflating: org/apache/commons/codec/digest/DigestUtils.class
inflating: META-INF/LICENSE.txt

I should also point that I have tried both version 1.2 and 1.3 of the
codec file and that the errors do not happen unless a call is made from
my XML-RPC client.

Sorry this is being so difficult… Erik, you still lurking?

Thank you so much to you, Erik and Nick for your assistance so far. I
would love to move forward once my test call goes without any error.

I am also asking the same question on JGuru forum but so far no luck.
If I get an answer I will post it here.

Thanks again guys.

Frank

Ben M. [email protected] wrote: Well, I guess it
might be catching it too, so maybe that won’t be a big deal.

Sorry this is being so difficult… Erik, you still lurking?

b

softwareengineer 99 wrote:

Frank
used cars.



Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com

Hey Erik and fellow list members

I was only posting and asking here thinking that someone later may be
able to benefit from this discussion as they try to implement Lucene
with ROR . My apologies if you thought I am abusing the list.

Yes, I’m still lurking and reading infrequently. Yes, Commons
Codec
is needed on the classpath.

My compile command:
javac -cp
commons-codec-1.2.jar:/var/java/jdk1.5.0_06/lib/xmlrpc-2.0/xmlrpc-2.0.jar:/var/java/jdk1.5.0_06/lib/xmlrpc-2.0.jar:/var/java/jdk1.5.0_06/lib/lucene-core-1.9-rc1.jar:/var/java/jdk1.5.0_06/lib/commons-codec-1.2.jar
SearchServer.java

My import statements:
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.*;

My server execution command

java SearchServer /var/www/html

No offense
intended, just trying to direct you to the most appropriate resources
rather than messaging a list of Rails users that most could not care
less about Java.

No offense taken. Thanks for your assistance any way. I will take my
questions else where (I am already trying on other lists and thought
someone here may have the solution).

I would like to buy your book but would like to compile my test
program first.

Nonetheless my apologies to the list members…

Frank

Erik H. [email protected] wrote:

Other than having XML-RPC, Lucene, and Commons Codec’s JAR files on
the classpath you should be in good shape. Our production
SearchServer (different from Nick’s in underlying functionality, but
the same command-line interface) is launched like this:

java -cp build/nines.jar:lib/lucene-core-1.9-rc1-dev.jar:lib/commons-
codec-1.3.jar:lib/xmlrpc-2.0.jar
org.nines.SearchServer [port number]

our nines.jar contains org.nines.SearchServer.

Best of luck with your SearchServer efforts. Perhaps the free
codebase for Lucene in Action at http://www.lucenebook.com would help
you get rolling (lots of instructions on how to get the code running)
or the book would be the next step for you. :slight_smile:

Erik

Any ideas are appreciated.



Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com

I wanted to let the list know that I have the search server working
now. Thank you so much for all the off-list replies I received from
members of this great list offering support.

I have the search server communicating with my ROR project and my
indices are ready to go.

I bought Erik’s wonderful book which is just amazingly full of
information. Not to mention its 457 pages long.

Erik goes in to a lot of detail about almost everything you will need.

For e.g., I was thinking about searching multiple fields in Lucene but
after reading Erik’s thoughts, I decided to combine the information in
a contents field.

My wish list :

I hope Erik updates the book so it doesn’t include deprecated function
calls such as:

Field.UnIndexed (…)
Field.Text (…)

instead of

new Field(…)

which causes the Java compiler to issue the following messages on
compile (at least when using Lucene 1.9):

Note: SearchServer.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Nonetheless, this book is a must-have for any application developer.
Don’t let the complexity of Java stop you from using Lucene.

My solution to Lucene indexing databases is ready and I am willing 

to provide any help I can about the implementation. Please message me
if you would like sample code (I plan to post it soon on my blog).

Thanks Erik, Ben, Nick and everyone who offered their help. You guys
are a great help.

Frank

Rails Blog: http://railsruby.blogspot.com
MySQL Blog: http://mysqldatabaseadministration.blogspot.com
Linux / Security Blog: http://frankmash.blogspot.com

On Feb 28, 2006, at 1:53 AM, softwareengineer 99 wrote:

I bought Erik’s wonderful book which is just amazingly full of
information. Not to mention its 457 pages long.

Erik goes in to a lot of detail about almost everything you will need.

Thanks for the kind words!

For e.g., I was thinking about searching multiple fields in Lucene
but after reading Erik’s thoughts, I decided to combine the
information in a contents field.

This all really depends on what you’re doing and how the user needs
to interact with the system. For most general purpose searching
needs, a user simply wants to enter keywords and find stuff, doesn’t
want to bother with selecting precise fields to narrow things down.
So a catch-all “contents” field often is the best way to go (though I
also do this in conjunction with separate fields for the advanced
cases where constraining more precisely is desired).

new Field(…)

which causes the Java compiler to issue the following messages on
compile (at least when using Lucene 1.9):

Note: SearchServer.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

Yes, we will be updating the book for the new 2.0 revision of Lucene
coming out soon. The book was written for Lucene 1.4.3, and Lucene
1.9 just came out today unofficially, and officially so in the next
few days. 1.9 is backwards compatible with 1.4.3 and forwards
compatible with the impending 2.0 release where we will sweep up and
remove all the deprecated API. Deprecation warnings in the Lucene
case are harmless, so no worries with seeing those at all and you
could turn off those warnings with a compiler switch if you like :slight_smile:

Erik

Frank,
I ironically enough have been trying to solve the exact same problem
as you and am completely Java illiterate as well. With the help of the
list threads (and Erik’s book), I’ve actually got this working now on
my development environment (os-x).

I’m using java version “1.4.2_09” and used the following jars:
lucene-1.4.3.jar
commons-codec-1.3.jar
xmlrpc-2.0.1.jar

I now have ruby performing remote procedure calls to the java like a
charm. Feel free to e-mail me offlist if you are still having
troubles.

Derek