Hi there,

I am trying to implement a Nutch plugin in Clojure 1.3. It works correctly 
in Nutch standalone mode, but not in Nutch distributed (Hadoop) mode. I 
have made the plugin inherit from Nutch's HtmlParser class, as follows. 

-------
(ns test_plugin.core)

(gen-class 
  :name test_plugin.core.Parser
  :implements [org.apache.nutch.parse.HtmlParseFilter]
  :prefix "parser-")

;; required by nutch to exist
(defn parser-setConf [this conf])

;; required by nutch to exist
(defn parser-getConf [this])

---------

Hadoop was then run with the following command:

hadoop jar apache-nutch-1.5.1.job org.apache.nutch.parse.ParserChecker 
-libjars /home/foobar/test-plugin/test-plugin-standalone.jar 
"http://nutch.apache.org";

* apache-nutch-1.5.1.job is a Hadoop job file created by Nutch that 
consists of the Nutch configuration files, plugins, etc. 
* The libjars option is required by Hadoop so that it can pick up on the 
3rd party jars (eg: Clojure etc)

The error that I get when I run Nutch in distributed mode is as follows:

Exception in thread "main" java.lang.ExceptionInInitializerError
        at clojure.core__init.__init0(Unknown Source)
        at clojure.core__init.<clinit>(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at clojure.lang.RT.loadClassForName(RT.java:2030)
        at clojure.lang.RT.load(RT.java:417)  
        at clojure.lang.RT.load(RT.java:398)  
        at clojure.lang.RT.doInit(RT.java:434)
        at clojure.lang.RT.<clinit>(RT.java:316)
        at clojure.lang.Namespace.<init>(Namespace.java:34)
        at clojure.lang.Namespace.findOrCreate(Namespace.java:176)
        at clojure.lang.Var.internPrivate(Var.java:149)
        at test_plugin.core.Parser.<clinit>(Unknown Source)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at java.lang.Class.newInstance0(Class.java:355)
        at java.lang.Class.newInstance(Class.java:308)
        at 
org.apache.nutch.plugin.Extension.getExtensionInstance(Extension.java:160)
        at 
org.apache.nutch.parse.HtmlParseFilters.<init>(HtmlParseFilters.java:59)
        at 
org.apache.nutch.parse.html.HtmlParser.setConf(HtmlParser.java:289)
        at 
org.apache.nutch.plugin.Extension.getExtensionInstance(Extension.java:162)
        at 
org.apache.nutch.parse.ParserFactory.getParsers(ParserFactory.java:132)
        at org.apache.nutch.parse.ParseUtil.parse(ParseUtil.java:71)
        at org.apache.nutch.parse.ParserChecker.run(ParserChecker.java:101)
        at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
        at org.apache.nutch.parse.ParserChecker.main(ParserChecker.java:138)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
Caused by: java.lang.IllegalStateException: Attempting to call unbound fn: 
#'clojure.core/refer
        at clojure.lang.Var$Unbound.throwArity(Var.java:43)
        at clojure.lang.AFn.invoke(AFn.java:39)
        at clojure.lang.Var.invoke(Var.java:401)
        at clojure.lang.RT.doInit(RT.java:447)
        at clojure.lang.RT.<clinit>(RT.java:316)
        ... 33 more

Any ideas why? 

Thanks,
Michael

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to