Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Pig >> mail # user >> Javascript UDFs don't work in local mode? At all?


+
Russell Jurney 2012-08-15, 16:46
Copy link to this message
-
Re: Javascript UDFs don't work in local mode? At all?
This class is part of the Sun Java 6 JDK . What version of Java are
you running?

You should have something along the lines of
/usr/lib/jvm/java-6-openjdk/jre/lib/rhino.jar on your classpath.

Dmitriy
On Wed, Aug 15, 2012 at 9:46 AM, Russell Jurney
<[EMAIL PROTECTED]> wrote:
> 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
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB