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

Catalin Alexandru Zamfir commented on PIG-2634:
-----------------------------------------------

Hi Daniel,
The quick way to test this is:
- build an Eclipse (Maven) project;
- add the necessary libraries (for example pig-0.9.2-core.jar) to the build 
path;
- export (packaged) the project and run it with a given script. The script runs 
properly when run via "pig -x mapreduce order.pig" for example.
- but fails when the Java program, using PigServer/PigRunner tries to run the 
same script.
- it fails as i cannot find "rsrc: pig-0.9.2-core.ajr" in the 
createJar/mergeJar methods.

So as far as I'm guessing, it does not include jars that are currently on the 
build path. For example if I add pig-0.9.2-core.jar as an Eclipse dependency 
for the project, it does not find it, when it should.

I tried adding a "register /path/to/pig.jar" in the script, but still fails 
with the same name of the Eclipse dependency.
If I don't add pig-0.9.2-core.jar as a dependency in the Eclipse project, I 
cannot use PigServer/PigRunner.

So, the mergeJar/createJar methods need to be fised, maybe using Apache VFS2 to 
get jars on the build-path or in a path inside the running jar and add them to 
the jar that's going to be built by these methods. (which seems to be the 
JobXXXXXXXXXX.jar that gets submitted to the jobtracker).

Help would be appreciated, if not by a fix, then by help or direction, as I'm 
able to fix it on my own and provide a patch back to ASF/Pig.
                
> JarManager fails for rsrc: jars
> -------------------------------
>
>                 Key: PIG-2634
>                 URL: https://issues.apache.org/jira/browse/PIG-2634
>             Project: Pig
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 0.9.2
>            Reporter: Catalin Alexandru Zamfir
>            Priority: Blocker
>              Labels: engine, mapreducel, merge, parser, pigserver
>         Attachments: pig_1333633836139.log
>
>
> The following error occurs when using PigSever class, while using 
> registerScript (InputStream). The Eclipse Maven project adds "pig-0.9.2.jar" 
> as a dependency. When runned, if fails to merge pig-0.9.2.jar. The whole 
> trace is:
> ###
> Caused by: 
> org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobCreationException:
>  ERROR 2017: Internal error creating job configuration.
>         at 
> org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.getJob(JobControlCompiler.java:727)
>         at 
> org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.compile(JobControlCompiler.java:258)
>         at 
> org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher.launchPig(MapReduceLauncher.java:150)
>         at org.apache.pig.PigServer.launchPlan(PigServer.java:1314)
>         at 
> org.apache.pig.PigServer.executeCompiledLogicalPlan(PigServer.java:1299)
>         at org.apache.pig.PigServer.execute(PigServer.java:1289)
>         at org.apache.pig.PigServer.access$400(PigServer.java:125)
>         at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1591)
>         ... 44 more
> Caused by: java.io.FileNotFoundException: rsrc:pig-0.9.2-core.jar (No such 
> file or directory)
>         at java.io.FileInputStream.open(Native Method)
>         at java.io.FileInputStream.<init>(FileInputStream.java:137)
>         at java.io.FileInputStream.<init>(FileInputStream.java:96)
>         at org.apache.pig.impl.util.JarManager.mergeJar(JarManager.java:176)
>         at org.apache.pig.impl.util.JarManager.createJar(JarManager.java:118)
>         at 
> org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler.getJob(JobControlCompiler.java:412)
> ###
> Pig should not fail for jars on the "rsrc:" path.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to