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

Pi Song commented on PIG-183:
-----------------------------

Xu,

You compiled your class using Java 6 but your Pig runs on Java 5 JVM. 

{noformat}
[EMAIL PROTECTED]:~/dump/org/apache/pig/test/udf/storefunc$ javap -verbose 
StringStore
Compiled from "StringStore.java"
public class org.apache.pig.test.udf.storefunc.StringStore extends 
java.lang.Object implements org.apache.pig.StoreFunc,org.apache.pig.LoadFunc
  SourceFile: "StringStore.java"
  minor version: 0
  major version: 50     <=== This indicates Java 6
  Constant pool:   

{noformat}

> Pig could not resolve my udf class
> ----------------------------------
>
>                 Key: PIG-183
>                 URL: https://issues.apache.org/jira/browse/PIG-183
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Xu Zhang
>         Attachments: testudf.jar
>
>
> When I ran the following Pig script with the latest Pig stuff, I got an 
> exception for unresolved class. I noticed that 
> org.apache.pig.test.udf.storefunc is not among the packages that Pig searches 
> ([, org.apache.pig.builtin., com.yahoo.pig.yst.sds.ULT., 
> org.apache.pig.impl.builtin.]). 
> I am sure that the package path for StringStore 
> (org.apache.pig.test.udf.storefunc) is correct in testudf.jar.  I attached 
> testudf.jar here with this bug report. 
> {code}
> register /path/to/my/jar/testudf.jar;
> A = load '/user/pig/tests/data/singlefile/textdoc' using 
> org.apache.pig.test.udf.storefunc.StringStore();
> store A into 'results_4_1';
> {code}
> {noformat}
> 2008-04-03 13:20:25,154 [main] INFO  
> org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting 
> to hadoop file system at: wilbur11.labs.corp.sp1.yahoo.com:8020
> 2008-04-03 13:20:25,781 [main] ERROR org.apache.pig.tools.grunt.Grunt - 
> java.lang.RuntimeException: could not instantiate 
> 'org.apache.pig.test.udf.storefunc.StringStore' with arguments '[]'
>         at org.apache.pig.impl.PigContext.instantiateFunc(PigContext.java:504)
>         at 
> org.apache.pig.impl.PigContext.instantiateFuncFromSpec(PigContext.java:510)
>         at 
> org.apache.pig.impl.io.ValidatingInputFileSpec.getSlicer(ValidatingInputFileSpec.java:50)
>         at 
> org.apache.pig.impl.io.ValidatingInputFileSpec.validate(ValidatingInputFileSpec.java:42)
>         at 
> org.apache.pig.impl.io.ValidatingInputFileSpec.<init>(ValidatingInputFileSpec.java:37)
>         at 
> org.apache.pig.impl.logicalLayer.parser.QueryParser.LoadClause(QueryParser.java:795)
>         at 
> org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseExpr(QueryParser.java:628)
>         at 
> org.apache.pig.impl.logicalLayer.parser.QueryParser.Expr(QueryParser.java:484)
>         at 
> org.apache.pig.impl.logicalLayer.parser.QueryParser.Parse(QueryParser.java:334)
>         at 
> org.apache.pig.impl.logicalLayer.LogicalPlanBuilder.parse(LogicalPlanBuilder.java:47)
>         at org.apache.pig.PigServer.registerQuery(PigServer.java:262)
>         at 
> org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:446)
>         at 
> org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:226)
>         at 
> org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:62)
>         at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:60)
>         at org.apache.pig.Main.main(Main.java:265)
> Caused by: java.io.IOException: Could not resolve 
> org.apache.pig.test.udf.storefunc.StringStore using imports: [, 
> org.apache.pig.builtin., com.yahoo.pig.yst.sds.ULT., 
> org.apache.pig.impl.builtin.]
>         at 
> org.apache.pig.impl.util.WrappedIOException.wrap(WrappedIOException.java:16)
>         at 
> org.apache.pig.impl.PigContext.resolveClassName(PigContext.java:456)
>         at org.apache.pig.impl.PigContext.instantiateFunc(PigContext.java:486)
>         ... 15 more
> Caused by: java.lang.ClassNotFoundException: Could not resolve 
> org.apache.pig.test.udf.storefunc.StringStore using imports: [, 
> org.apache.pig.builtin., com.yahoo.pig.yst.sds.ULT., 
> org.apache.pig.impl.builtin.]
>         at 
> org.apache.pig.impl.PigContext.resolveClassName(PigContext.java:455)
>         ... 16 more
> 2008-04-03 13:20:25,784 [main] ERROR org.apache.pig.tools.grunt.Grunt - could 
> not instantiate 'org.apache.pig.test.udf.storefunc.StringStore' with 
> arguments '[]'
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to