[Pljava-dev] Error trapping help

Thomas Hallgren thomas at tada.se
Mon Sep 25 15:42:11 UTC 2006


Hi Scott,
Try and catch the ExceptionInInitializerError and print the stack trace 
of the exception that caused it. That will probably give you the 
information you are looking for.

Regards,
Thomas Hallgren

Scott Petersen wrote:
> Folks,
>
> I have loaded my Jasper report definition (.jrxml) into a postgresql 
> database as a text field.  I can retrieve the record and convert it to 
> an InputStream.  This is where the problem breaks down.  When I pass the 
> InputStream to  JRXmlLoader.load(is) to get a JasperDesign to then 
> continue on the compile and execution process I receive an error that I 
> have not been able to trap.
>
> The following jar files are loaded:
> commons-beanutils-1.5.jar
> commons-collections-2.1.jar
> commons-digester-1.7.jar
> commons-logging-1.0.2.jar
> itext-1.3.1.jar
> jasperreports-1.2.6.jar
> jdt-compiler-3.1.1.jar
> pljava.jar
>
> The following code snipet show what I am doing:
>     try
>     {
>       rs.next();
>       String reportSource = rs.getString("report_source");
>       InputStream is = fromString(rs.getString("report_source"));
> //      is.read(returnString, 0, is.available);         -- read of 
> buffer works
>       try
>       {
>         jasperDesign = JRXmlLoader.load(is); <<<== dies on this line
>       }
>       catch (JRException e)
>       {
>         e.printStackTrace();
>         return "JRXmlLoader failure";
>       }
>     }
>     catch (SQLException se)
>     {
>       se.printStackTrace();
>       if (rs != null)
>       {
>           rs.close();
>       }
>       return "InputStream failure";
>     }   
>
>
> I was able to read the InputStream in a previous test.  But when I add 
> the line that contains JRXmlLoader.load(is) the program returns the 
> following error:
>
> psql:java_test:112: ERROR:  java.lang.ExceptionInInitializerError
>
>
> I have 2 issues.  First how do I get past this issue?  The second 
> problem is how can I get more information on what the problem is in 
> order to track it down.
>
> Any and all help appreciated.
> Scott.
> _______________________________________________
> Pljava-dev mailing list
> Pljava-dev at gborg.postgresql.org
> http://gborg.postgresql.org/mailman/listinfo/pljava-dev
>   




More information about the Pljava-dev mailing list