Jump to content
We've recently updated our Privacy Statement, available here ×

EsauCairn

Members
  • Posts

    3
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by EsauCairn

  1. I would prefer to wait to file the report until I can pinpoint the problem and possibly recommend a solution. I took the jar file out of my project. Instead, I included the source code from Jasper 3.0.0 into my project, built it, and ran it. The bug did not appear. This is, naturally, puzzling. When the bug appears in the .jar, the stack trace line numbers match the source code line numbers exactly, so I consider the possibility that the official .jar has separate code from the source tree to be very small. Next I am going to use the .jar and replace the affected class files with ones compiled from source one at a time to pinpoint the problem.
  2. lucianc, You were correct and I was wrong. I apologize for posting unhelpful data. All I can see is that if you replace net.sf.jasperreports.text.measurer.factory=default net.sf.jasperreports.text.measurer.factory.default=net.sf.jasperreports.engine.fill.TextMeasurerFactory with net.sf.jasperreports.text.measurer.factory=net.sf.jasperreports.engine.fill.TextMeasurerFactory The null pointer exception goes away. The problem baffles me. To reproduce the problem, I simply need to run: Code: String path = getPath(); String fileName = getReportFileName(); Map parameters = new HashMap(); populate(parameters); JasperCompileManager.compileReportToFile(path + filename + ".jrxml"«»); JasperFillManager.fillReportToFile(path+filename+".jasper", parameters, new JREmptyDataSource()); It runs without errors with the change to the default.jasperreports.properties configuration file above, and gives the noted nullpointerexception otherwise. I'll try to take another stab at this over the weekend, see if I can't lock it down. Thanks for your help.
  3. I got the same problem as this when moving from Jasper 2.0.1 to 3.0.0, and I tracked it down. To repeat, this is the stack trace: Code: java.lang.NullPointerException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:161) at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(JRClassLoader.java:119) at net.sf.jasperreports.engine.util.JRSingletonCache.createInstance(JRSingletonCache.java:88) at net.sf.jasperreports.engine.util.JRSingletonCache.getCachedInstance(JRSingletonCache.java:78) at net.sf.jasperreports.engine.util.JRTextMeasurerUtil.getTextMeasurerFactory(JRTextMeasurerUtil.java:118) at net.sf.jasperreports.engine.util.JRTextMeasurerUtil.createTextMeasurer(JRTextMeasurerUtil.java:103) at net.sf.jasperreports.engine.util.JRTextMeasurerUtil.createTextMeasurer(JRTextMeasurerUtil.java:90) at net.sf.jasperreports.engine.fill.JRFillTextElement.createTextMeasurer(JRFillTextElement.java:115) at net.sf.jasperreports.engine.fill.JRFillTextElement.ensureTextMeasurer(JRFillTextElement.java:122) at net.sf.jasperreports.engine.fill.JRFillTextElement.chopTextElement(JRFillTextElement.java:972) at net.sf.jasperreports.engine.fill.JRFillStaticText.prepare(JRFillStaticText.java:193) at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:344) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:346) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:305) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillTitle(JRVerticalFiller.java:313) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:247) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:113) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:879) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:801) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:89) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:601) at net.sf.jasperreports.engine.JasperFillManager.fillReportToFile(JasperFillManager.java:492) at net.sf.jasperreports.engine.JasperFillManager.fillReportToFile(JasperFillManager.java:448) I am not fluent with the Jasper source enough to propose a fix, but I now where the problem occurs. In net.sf.jasperreports.engine.util.JRTextMeasurerUtil line 86 there is this function: Code:[code] public static JRTextMeasurer createTextMeasurer(JRCommonText text) { JRPropertiesHolder propertiesHolder = text instanceof JRPropertiesHolder ? (JRPropertiesHolder) text : null; return createTextMeasurer(text, propertiesHolder); } As you can see, if the input is not an instance of JRPropertiesHolder then the function ends with a call to createTextMeasurer(text, null). createTextMeasurer calls other functions to load a class based upon its second input parameter, and naturally this throws a NullPointerException.
×
×
  • Create New...