[ 
https://issues.apache.org/jira/browse/PIG-137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Johannes Zillmann updated PIG-137:
----------------------------------

    Attachment: PIG-137-633746.patch

Oh, i think this case it has nothing to do with the logging. Its just about the 
exception conversion, where informations simply getting lost.
I've uploaded a patch for this case (simply removed the try-catch, since there 
can be only RuntimeException, which did not need to be wrapped or converted to 
IOExceptions). 
The stacktrace without the patch:
{noformat}
java.io.IOException: could not instantiate 'com.my.DatabaseStoreFunc' with 
arguments 'aDb, table'
        at org.apache.pig.impl.PigContext.instantiateFunc(PigContext.java:422)
        at 
org.apache.pig.impl.PigContext.instantiateFuncFromSpec(PigContext.java:429)
        at org.apache.pig.impl.logicalLayer.LOStore.<init>(LOStore.java:50)
        at 
org.apache.pig.impl.logicalLayer.parser.QueryParser.generateStorePlan(QueryParser.java:74)
        at org.apache.pig.PigServer.store(PigServer.java:321)
        at org.apache.pig.PigServer.store(PigServer.java:317)
        ...
{noformat}

The stacktrace with the patch:  
{noformat}
java.lang.RuntimeException: could not instantiate 'com.my.DatabaseStoreFunc' 
with arguments 'aDb, table'
        at org.apache.pig.impl.PigContext.instantiateFunc(PigContext.java:422)
        at 
org.apache.pig.impl.PigContext.instantiateFuncFromSpec(PigContext.java:429)
        at org.apache.pig.impl.logicalLayer.LOStore.<init>(LOStore.java:49)
        at 
org.apache.pig.impl.logicalLayer.parser.QueryParser.generateStorePlan(QueryParser.java:74)
        at org.apache.pig.PigServer.store(PigServer.java:321)
        at org.apache.pig.PigServer.store(PigServer.java:317)
        ...
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
        at org.apache.pig.impl.PigContext.instantiateFunc(PigContext.java:417)
        ... 24 more
Caused by: java.lang.RuntimeException: could not load properties file from 
classpath '/aDb.properties'
        ... 
{noformat}


 

> test instantiation of StoreFunc in LOStore swallows (cause) exceptions
> ----------------------------------------------------------------------
>
>                 Key: PIG-137
>                 URL: https://issues.apache.org/jira/browse/PIG-137
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>            Reporter: Johannes Zillmann
>         Attachments: PIG-137-633746.patch
>
>
> The current handling
> {noformat}
> IOException ioe = new IOException(e.getMessage());
> ioe.setStackTrace(e.getStackTrace());
> throw ioe;
> {noformat}
> passes the exception message and the stacktrace of the exception, but not the 
> stacktraces of the exceptions wich caused the exception.

-- 
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