Q:

Invoke a static method on a Java class stored in a var

I'm processing a stream of events, encoded as Google Protobuffers, stored as bytes. The trick with Protobuffers is that you must know the class of a thing before you attempt to load that thing. Another trick is that the event I'm loading is nested. 
So. I have the ByteArray of the innermost event. Fortunately, there's a field in the next-to-innermost event which specifies the type of the innermost event, so I can figure out what class should load it.
Good news: the parse function has the same name (parseFrom) on every candidate class.
Bad news: the function I need to call is static, and dispatches on both arity and type. 
What I'm trying to do is this:
(ns do-the-thing
  (import com.thing.place Type$Subtype Type$SecondSubType)

(def decl-obj-map
  {:type-subtype Type$SubType
   :type-second-subtype Type$Second$SubType})

(defn call-fn
  [class n-args method]
  (let [o (gensym)
        args (repeatedly n-args gensym)
        assure-symbol (fn [thing] (if (symbol? thing) thing (symbol thing)))
        method (assure-symbol method)]
    (eval
     `(fn [~o ~@args]
        (. ~(with-meta o {:tag class})
           (~method ~@args))))))

(def event-type (.getSubtypeField event-obj)
(def parse-func (call-fn (event-type decl-obj-map) 0 "parseFrom")

(parse-func (.getByteArrayFromInnerObj inner-obj))

So. This doesn't work at all. Instead of call-fn, I've also tried this method from clojure.contrib. It throws the ever-inscruitable IllegalArgumentException array element type mismatch  java.lang.reflect.Array.set (Array.java:-2) error. 
Anyone?

A:

There are a few issues with that code as applied to static methods of a class, the most important being that the class has to be known at compile time for the dot special form and friends [Note: (Class/method ...) expands to (. Class method ...)]. Therefore, you would have to eval on each invocation with this strategy -- the eval would have to be moved inside the returned function (after patching it up a bit). That is undesirable.
You could solve this with reflection, for example
(defn call-fn [^Class class method] 
  (fn [& args] 
    (clojure.lang.Reflector/invokeStaticMethod 
      (.getName class) 
      (str method) 
      (to-array args))))

(def my-abs (call-fn Math "abs"))
(my-abs -1) ;=> 1

But I think you've over-engineered your problem. Instead of a map from type keywords to classes, consider a map from specs directly to functions, for example
(def spec->parser
  {:type-subtype {1 #(Type$Subtype/parseFrom %) 2 #(Type$Subtype/parseFrom % %2)} 
   :type-second-subtype {1 #(Type$SecondSubtype/parseFrom %) ...}})

Then your call-fn is just
(defn get-parser [type-kw nargs] (get-in spec->parser [type-kw nargs]))

or simply #(get-in spec->parser &%)

