[ 
https://issues.apache.org/jira/browse/PIG-2657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496424#comment-13496424
 ] 

Cheolsoo Park commented on PIG-2657:
------------------------------------

Hi Johnny,

Thank you very much for your time and effort. But I don't think that you tested 
it correctly. I think that jython 2.5.0 is present somewhere in your classpath, 
and that's why you're seeing that message. Here is my test using jython 2.2.1:
- Commented out the following lines in {{bin/pig}} so that jython 2.5.x is not 
present in my classpath. If you don't do this, you will end up with 2 versions 
of Jython in classpath:
{code}
#JYTHON_JAR=`echo ${PIG_HOME}/lib/jython*.jar`

#if [ -z "$JYTHON_JAR" ]; then
#    JYTHON_JAR=`echo $PIG_HOME/build/ivy/lib/Pig/jython*.jar`
#    if [ -n "$JYTHON_JAR" ]; then
#        CLASSPATH=${CLASSPATH}:$JYTHON_JAR
#    fi
#fi
{code}
- Set {{PIG_CLASSPATH=/usr/share/java/jython-2.2.1.jar}}.
- Ran a Python UDF.

The result for me is a {{NoClassDefFoundError}} as follows:
{code}
ERROR 2998: Unhandled internal error. org/python/Version

java.lang.NoClassDefFoundError: org/python/Version
        at 
org.apache.pig.scripting.jython.JythonScriptEngine$Interpreter.<clinit>(JythonScriptEngine.java:92)
{code}
The reason is because the {{org.python.Version}} class is introduced in Jython 
2.5.x, and thus doesn't exist in Jython 2.2.x:
http://grepcode.com/project/repo1.maven.org/maven2/org.python/jython/

In fact, this gives me a pause. By doing this, we're going to introduce a 
backward incompatibility with Jython releases prior to 2.5.x. For example, 
there may be some Python UDFs that used to work with Jython 2.2.x but will no 
longer work because of this change. After all, I am not sure if it is 
worthwhile to fix. Thoughts?
                
> Print warning if using wrong jython version
> -------------------------------------------
>
>                 Key: PIG-2657
>                 URL: https://issues.apache.org/jira/browse/PIG-2657
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Fabian Alenius
>              Labels: newbie
>             Fix For: 0.12
>
>         Attachments: PIG-2657.1.patch, PIG-2657.2.patch, PIG-2657.3.patch, 
> PIG-2657.4.patch
>
>
> Hi,
> It would be good if Pig would print a warning (or refuse to run) if you are 
> using an unsupported version of jython. I spent a couple of hours before 
> figuring out that you had to use 2.5.0. I've seen posts indicating that 
> others have run into this problem as well.
> Might write up a patch if others agree this is an issue.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to