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

claudio.simonetti

Members
  • Posts

    3
  • Joined

  • Last visited

claudio.simonetti's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hi Lucian I think I've finally found the error, it was related to maven. In my project I've the jasper report library and also a jar with some custom fonts (created with jasper studio). Both jar have the same jasperreport_extension.properties file. When the maven shade plugin builds the final jar overwrites one of the two properties file, the most important, the one inside the jasper report library. So probably when I launch the app, jasper finds the properties file but at the inside there aren't the propeties he needs to work correctly and this generates that uncaught exception. I solved it by adding this configuration inside the maven shade plugin: <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <resource>jasperreports_extension.properties</resource></transformer>[/code]This tranformer appends the content of one properties file to the other one. I don't know, if in the future it can be helpful add in the jasper report library the exception to handle when some porperties are missing. Thanks for the help.
  2. Update: I've just discovered that it works if I launch my app from eclipse but when i build tha jar (with maven) it doesn't work neither on my pc. What ma i doing wrong?
  3. Hi all, I've developed a java application to create a pdf report. My app works fine on my local machine (Windows 7) but when I launch on a remote server(Windows Server 2008 R2 standard) i receive an absurde exception: Exception in thread "main" java.lang.ExceptionInInitializerError at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:108) at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:69) at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:57) at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:200) at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:215) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:115) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:583) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:929) at com.test.PdfWriter.writePdfFromList(PdfWriter.java:85)Exception: net.sf.jasperreports.engine.JRRuntimeException thrown from the UncaughtExceptionHandler in thread "main"[/code] I'm using jasper reports 6.2.2 and jdk 1.7.25. This is the method I've devoloped to write the pdf: public static void writePdfFromList(final LoggingSettings loggingSettings, final List<Object> listToWrite, final String jasperDataSourceParamName, final String jasperFile, final String pdfOutputFile) throws CustomException { LogManagement lm = new LogManagement(loggingSettings, CLASS_NAME); try { /* Convert List to JRBeanCollectionDataSource */ lm.debug(new StringBuilder("Defining JRBeanCollectionDataSource") .append(" that will store the array list")); JRBeanCollectionDataSource itemsJRBean = new JRBeanCollectionDataSource(listToWrite, false); /* Map to hold Jasper report Parameters */ lm.debug(new StringBuilder("Defining map to hold") .append(" Jasper report Parameters")); Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put(jasperDataSourceParamName, itemsJRBean); /* * Using compiled version(.jasper) of Jasper report to generate * PDF */ lm.debug(new StringBuilder("Getting JasperPrint") .append(" to the fill report")); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperFile, parameters, new JREmptyDataSource()); /* outputStream to create PDF */ lm.debug(new StringBuilder("Defining the outputStream") .append(" to create PDF")); OutputStream outputStream = new FileOutputStream(new File(pdfOutputFile)); /* Write content to PDF file */ lm.info(new StringBuilder("Write content to PDF file")); JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream); } catch (Exception e) { // TODO Auto-generated catch block throw lm.error(e); } }[/code] Searching on the web and on the community I found other topics that talks about using jasper javaflow. I've tried to use the jasper report javaflow but nothing is changed, I still receive same error. I'm going crazy because I'm not able to understand what is the problem, on my local machine it works, why it doesn't works on the remote server?? Colud you please someone help me or give me some suggestion on how I can solve it?? Thanks in advance
×
×
  • Create New...