2004 IR Help Posted August 20, 2006 Share Posted August 20, 2006 By: Bj - bjkhan 0.6.1 -> 0.6.2 : NullPointerException 2004-12-03 05:41 Hi, I made a report using JasperAssistant 1.3.4 and Jasper 0.6.1. I have migrated to JasperAssistant 1.4.2 and Jasper 0.6.2. Compilation under Eclipse is OK. During execution an exception is raised by the JasperAPI: java.lang.NullPointerException at java.util.Hashtable.put(Hashtable.java:393) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(Unknown Source) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(Unknown Source) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(Unknown Source) at net.sf.jasperreports.engine.JasperFillManager.fillReport(Unknown Source) at net.sf.jasperreports.engine.JasperFillManager.fillReport(Unknown Source) When, I go back with JasperAssistant 1.3.4 and Jasper 0.6.1, everything is ok... Where could be the problem and how can I solve it ? Best regards, Bj By: Teodor Danciu - teodord RE: 0.6.1 -> 0.6.2 : NullPointerException 2004-12-03 08:02 Hi, You supply your parameters into a Hashtable implementation that does not support null values. And the filling engine tries to add to this map the the built-in parameters values. The problem was introduced when adding support for i18n and I'll see about solving it. In the meantime, you could use a HashMap insted, probably by wrapping your current Hashtable. Thank you, Teodor By: Ian Gratton - igratton RE: 0.6.1 -> 0.6.2 : NullPointerException 2005-02-15 10:31 Hi there JasperReports basically rocks - its allowed me to build some really neat stuff without any great effort - well done folks !!! I've just switched from using Jasper 0.6.1 to Jasper 0.6.4 and appear to be getting exactly the same problem. Its take me a while as I was waiting for iReport to get in sync with Jasper before I upgraded. Even though my report does not make use of the i18n ResourceBundle prefix the code still goes and attempts to load a bundle which does not exist. I basically get a NullPointerException at the point where JRBaseFiller is trying to put JRParameter.REPORT_RESOURCE_BUNDLE into the parameterValues Map. Would it be good to branch the code around this if no ResourceBundle prefix is specified on the report itself ? As teodord says - if I pass in my parameters using a HashMap instead of a HashTable the problem obviously doesn't occur. Right now I've had to create a little static helper method in my code to Do this HashTable->HashMap conversion to get round this bug. Any idea when this will be fixed ? On another note - if I use i18n and place the .property files in the same directory as my .jrxml files (i.e. so they can be found at runtime) I get a lot of annoying output from the jrc custom ant task as it thinks the .properties files need to be compiled and they obviously fail. It would be real good if an ant <fileset> element could be used to restrict which files you would like the jrc to attempt to compile/or alternatively make the ant task only look for .jrxml files (but I appreciate this could be a restriction) Thanks again people !!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now