Cross posting in hopes a user has this working... Has anyone gotten JavaScript UDFs working in pig 0.10.0? The hello world example doesn't work. I added debug to the code, and the rhino class doesn't seem to be in the path? I tried installing rhino and including it and that doesn't help.
Wtf mate? :) Russell Jurney http://datasyndrome.com Begin forwarded message: *From:* Russell Jurney <[email protected]> *Date:* August 14, 2012 11:30:25 PM PDT *To:* [email protected] *Subject:* *Javascript UDFs don't work in local mode? At all?* I am loading 'test.js' in my script exactly as in the documentation for Pig 0.10, and the file contains the pasted example Javascript UDFs and I get: ================================================================================ Pig Stack Trace --------------- ERROR 2998: Unhandled internal error. org/mozilla/javascript/EcmaError java.lang.NoClassDefFoundError: org/mozilla/javascript/EcmaError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at org.apache.pig.scripting.ScriptEngine.getInstance(ScriptEngine.java:254) at org.apache.pig.PigServer.registerCode(PigServer.java:523) at org.apache.pig.tools.grunt.GruntParser.processRegister(GruntParser.java:422) at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:419) at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:189) at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165) at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:69) at org.apache.pig.Main.run(Main.java:490) at org.apache.pig.Main.main(Main.java:111) 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.ClassNotFoundException: org.mozilla.javascript.EcmaError at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 16 more ================================================================================ Help, I wanted to include a javascript UDF in a blog post :( -- Russell Jurney twitter.com/rjurney [email protected] datasyndrome.com
