On Jun 21, 2009, at 11:07 PM, timshawn wrote:

I can't seem to figure out why java can't find the clojure class in
the following example,
where f is a clojure function....

(defn cascading-function [f]
 (proxy [BaseOperation Function] [(Integer. 1) (Fields. (into-array
Comparable ["line"]))]
   (operate [flowProcess functionCall]
     (let [clojureData (. (Tuple. (. (. functionCall getArguments)
getTuple)) getString 1)
           result (hadoop-function f clojureData)
           resultTuple (Tuple.)]
       (. resultTuple add result)
       (. (. functionCall getOutputCollector) add resultTuple)))))

cascading function returns a java object that implements Function
(from the cascading framework) and extends BaseOperation, and it
implements the operate method.
The error that I am seeing is a ClassNotFoundException for whatever I
pass in as f.

The only place f appears is as the argument to hadoop-function. What's that expecting for arguments?

In general if you can come up with a small runnable example that shows the problem (with as few dependencies as possible), that's the easiest way for interested folks to help.

Showing the relevant portion of the stack trace for the exception is also likely to be helpful.

You can get the stack trace for the most recent exception caught by the REPL with

        (.printStackTrace *e)

(see also clojure.contrib.repl-utils for convenience functions around that.)

--Steve

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to