0

How to use Dynamic Jasper Reports

asked 2010-01-07 13:35:34 +0800

kubiscopus gravatar image kubiscopus
40 1 1 2

I face the problem of having to generate a Jasper Report with Dynamic columns.
Because I didn’t find nothing about, I start to code a solution
Here is the solution.
Don’t forget to add DynamicJasper and Jasper Report dependencies to you project.
//---------------------------------------------------------------------------------------------------
FastReportBuilder drb = new FastReportBuilder();
DynamicReport dr;
final InputStream mediais;
final AMedia amedia;

//Create columns for Report from a ListBox
Set<Listitem> seletedListItems = (Set<Listitem>)((Listbox)Localwin.getFellow("ElementsList")).getSelectedItems();
for(Listitem item:seletedListItems){
String col2add = ((Label)((Listcell)item.getFirstChild()).getFirstChild()).getValue();
if(col2add.equalsIgnoreCase("First Name")){
drb.addColumn("First Name", "firstName", String.class.getName(),30);
}
else if(col2add.equalsIgnoreCase("Last Name")){
drb.addColumn("Last Name", "lastName", String.class.getName(),30);
}
else if(col2add.equalsIgnoreCase("Middle Name")){
drb.addColumn("Middle Name", "middleName", String.class.getName(),30); }
else if(col2add.equalsIgnoreCase("Social Number")){
drb.addColumn("Social Number", "socialNumber", String.class.getName(),30); }
}

//Sets the Report Columns, header, Title, Groups, Etc Formats
//DynamicJasper documentation
drb.setTitle("Test of Dynamic Columns Jasper Report");
drb.setSubtitle("This report was generated at " + FbDateTimeUtils.getCurrentDate().toString());
drb.setPrintBackgroundOnOddRows(true);
drb.setUseFullPageWidth(true);
dr = drb.build();

//Get information from database
List<Domain> domains = employeeManager.loadAllDomains();
List<Employee> employees = new ArrayList<Employee>();
for(Domain domain:domains){
employees.add((Employee)domain);
}

//Create Datasource and put it in Dynamic Jasper Format
List data = new ArrayList(employees.size());
for(Employee employee:employees){
Map<String, String> map1 = new HashMap<String, String>();
map1.put("firstName", employee.getFirstName());
map1.put("lastName", employee.getLastName());
map1.put("middleName", employee.getMiddleName());
map1.put("socialNumber", employee.getSocialNumber());
data.add(map1);
}

//Generate Jarper Report
JRDataSource ds = new JRBeanCollectionDataSource(data);
JasperReport report = DynamicJasperHelper.generateJasperReport(dr, new ClassicLayoutManager(), new HashMap());

String OutputFormat = ((Combobox)Localwin.getFellow("OutputFormat")).getSelectedItem().getLabel();
if(OutputFormat.length() <=0){
OutputFormat = "PDF";
}
ByteArrayOutputStream output = new ByteArrayOutputStream();
JasperPrint jasperPrint=null;
jasperPrint=JasperFillManager.fillReport(report, new HashMap(), ds);

//Create Report depending on the output format
//callReportWindow just sets the iframe content attribute.
// ((Iframe) Localwin.getFellow("externalreport")).setContent(amedia);
// If you are using zk alone you can have more integration, in this case I use myfaces with faclets.
//only PDF format is open in a modal window, other formats are opened in the host applications like msexcel

if(OutputFormat.equalsIgnoreCase("PDF")){
asperExportManager.exportReportToPdfStream(jasperPrint, output);
mediais = new ByteArrayInputStream(output.toByteArray());
amedia = new AMedia("FirstReport.pdf", "pdf", "application/pdf", mediais);
callReportWindow(amedia, "PDF");
}
else if(OutputFormat.equalsIgnoreCase("XLS")){
JExcelApiExporter exporterXLS=new JExcelApiExporter();
exporterXLS.setParameter(JExcelApiExporterParameter.JASPER_PRINT, jasperPrint);
exporterXLS.setParameter(JExcelApiExporterParameter.OUTPUT_STREAM, output);
exporterXLS.setParameter(JExcelApiExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE);
exporterXLS.setParameter(JExcelApiExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.TRUE);
exporterXLS.setParameter(JExcelApiExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE);
exporterXLS.exportReport();
mediais = new ByteArrayInputStream(output.toByteArray());
amedia = new AMedia("FileFormatExcel", "xls", "application/vnd.ms-excel", mediais);
callReportWindow(amedia, "XLS");
}
else if(OutputFormat.equalsIgnoreCase("RTF") || OutputFormat.equalsIgnoreCase("DOC")){
JRRtfExporter exporterRTF = new JRRtfExporter();
exporterRTF.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporterRTF.setParameter(JRExporterParameter.OUTPUT_STREAM, output);
exporterRTF.exportReport();
mediais = new ByteArrayInputStream(output.toByteArray());
amedia = new AMedia("FileFormatRTF", "rtf", "application/rtf", mediais);
callReportWindow(amedia, "RTF-DOC");
}
//---------------------------------------------------------------------------------------------------

I hope it helps

delete flag offensive retag edit

8 Replies

Sort by » oldest newest

answered 2010-01-07 15:59:43 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2010-01-07 16:01:00 +0800

Hi kubiscopus, many thanks for these codes.


Only a hint: I know from a guy who does this work (dynamically creating reports) with the iText library.

best
Stephan

link publish delete flag offensive edit

answered 2010-01-07 19:54:04 +0800

PeterKuo gravatar image PeterKuo
481 2

Hi, kubiscopus, welcome to ZK.

Would you like to contribute a smalltalk in our wiki?

link publish delete flag offensive edit

answered 2010-01-09 05:47:19 +0800

kubiscopus gravatar image kubiscopus
40 1 1 2

Hi Terry. Jasper is a requirment in this application. But thanks for the hint. I will investigate.

Hi Peter: I'm thinking in write a smalltalk about Myfaces + facelets integration. It is something you can't find. I just need time. Thanks

link publish delete flag offensive edit

answered 2011-03-21 13:08:36 +0800

sollex gravatar image sollex
3

Hi kubiscopus,

Thanks for posting your solution.
Did you integrate your solution in iReport?

link publish delete flag offensive edit

answered 2011-03-21 16:27:18 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2011-03-21 16:29:03 +0800

iReport is a GUi for designing reports, means it's build the xml-file with the codes for jasper.
DynamicJasper does this by jumping over this deklaration file and generate the codes directly in java.

. . .
drb.setUseFullPageWidth(true);
dr = drb.build();

best
Stephan

PS: you can see many of them in the Zksample2 demo app.

link publish delete flag offensive edit

answered 2011-08-29 10:58:16 +0800

GabrielSilva gravatar image GabrielSilva flag of Portugal
6
http://www.freebalance.co...

Hi All.
Sorry for the delay, but I'm been out of the office.
First...yes. We integrate the solution in our application. As Dynamic Jasper and with Reports design with the iReport.
In this moment we are in the phase of making a contract with ZKOSS to use this in a legal way. We integrate the ZKOSS framework with Trinidad Myfaces with facelets (xhtml) in a very simple way. soon I will write a smalltalk about it.
Thanks all

link publish delete flag offensive edit

answered 2012-05-08 08:06:59 +0800

LOOPSTER gravatar image LOOPSTER
6

Hi all , i am trying to work with DynamicJasper-3.0.13 and jasperreports-3.5.1 .
my code is :

public DynamicReport buildReport()  throws ColumnBuilderException, ClassNotFoundException{
	    log.info("______________1 FastReportBuilder_______________");
		FastReportBuilder drb = new FastReportBuilder();
		log.info("______________2 FastReportBuilder_______________");
	   	drb.setTitle("Aprile 2012  report")
		.setSubtitle("This report was generated at " + new Date())
		.setWhenNoDataShowNoDataSection()
		.setWhenNoData("No data for this report", null,true,true)		
		.setPrintBackgroundOnOddRows(true)
		.setUseFullPageWidth(true)
		.setReportName("ReportPROVA");
	     DynamicReport dr = drb.build();
		log.info("______________DynamicReport BUILD()_______________");
		return dr;

	
		
	}
	
protected JRDataSource getDataSource() {
 		return new JRBeanCollectionDataSource(Collections.EMPTY_LIST);
 	}
	
public void downloadPDF() throws ColumnBuilderException, ClassNotFoundException, JRException, NamingException, SQLException, IOException {
		
		FacesContext context = FacesContext.getCurrentInstance();
		 HttpServletResponse response = (HttpServletResponse)context.getExternalContext().getResponse();	
		 Map params = new HashMap();
		 JasperPrint jp;	
		 DynamicReport dyr ;
		dyr = buildReport();
		JRDataSource ds = getDataSource();
		log.info("_______DOWNLOAD PDF()_______buildReport()_______________");
		JasperReport jr = DynamicJasperHelper.generateJasperReport(dyr,new ClassicLayoutManager(), params);
		log.info("______________generatejasperreport_______________");
		jp = JasperFillManager.fillReport(jr, params, ds);
	
		log.info("______________generatejasper PRINT_______________");
		
		File fil = new File ("MyReport.jasper");
		log.info("______________MyReport.jasper_______________");	
		JRSaver.saveObject(jp, fil);
		log.info("______________JRSAVE J.PRINT_______________");
		JasperViewer.viewReport(jp);
		log.info("___________viewReport__________________");
}
		


i' ve all dependencies like it is written in maven repository bu i am getting this error :

2012-05-08 09:44:39,578 INFO  [com.mydomain.pkg.action.DynamicJasper] (http-127.0.0.1-8080-1) ______________1 FastReportBuilder_______________
2012-05-08 09:44:39,656 INFO  [com.mydomain.pkg.action.DynamicJasper] (http-127.0.0.1-8080-1) ______________2 FastReportBuilder_______________
2012-05-08 09:44:39,656 INFO  [com.mydomain.pkg.action.DynamicJasper] (http-127.0.0.1-8080-1) ______________DynamicReport BUILD()_______________
2012-05-08 09:44:39,671 INFO  [com.mydomain.pkg.action.DynamicJasper] (http-127.0.0.1-8080-1) _______DOWNLOAD PDF()_______buildReport()_______________
2012-05-08 09:44:39,750 INFO  [ar.com.fdvs.dj.core.DynamicJasperHelper] (http-127.0.0.1-8080-1) generating JasperReport
2012-05-08 09:44:39,750 INFO  [ar.com.fdvs.dj.core.DJJRDesignHelper] (http-127.0.0.1-8080-1) obtaining DynamicJasperDesign instance
2012-05-08 09:44:39,812 WARN  [ar.com.fdvs.dj.core.DynamicJasperHelper] (http-127.0.0.1-8080-1) Can't find bundle for base name dj-messages, locale it_IT, usign default (dj-messages)
2012-05-08 09:44:40,968 INFO  [com.mydomain.pkg.action.DynamicJasper] (http-127.0.0.1-8080-1) ______________generatejasperreport_______________
2012-05-08 09:44:41,031 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (http-127.0.0.1-8080-1) java.lang.reflect.InvocationTargetException
javax.faces.el.EvaluationException: java.lang.reflect.InvocationTargetException
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
	at javax.faces.component.UICommand.broadcast(UICommand.java:387)
	at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
	at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
	at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
	at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
	at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:86)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
	at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
	at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
	at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
	at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
	at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
	at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
	at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
	at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
	at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
	at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
	at com.mydomain.pkg.action.DynamicJasper_$$_javassist_seam_9.downloadPDF(DynamicJasper_$$_javassist_seam_9.java)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
	at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280)
	at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
	at org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
	at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
	at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
	at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
	... 53 more
Caused by: java.lang.ExceptionInInitializerError
	at net.sf.jasperreports.engine.util.JRStyledTextParser.<clinit>(JRStyledTextParser.java:80)
	at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:176)
	at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:77)
	at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:59)
	at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:147)
	at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:83)
	at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:628)
	at com.mydomain.pkg.action.DynamicJasper.downloadPDF(DynamicJasper.java:186)
	... 84 more
Caused by: net.sf.jasperreports.engine.JRRuntimeException: Class net.sf.jasperreports.extensions.DefaultExtensionsRegistry does not implement/extend net.sf.jasperreports.extensions.ExtensionsRegistry
	at net.sf.jasperreports.engine.util.ClassUtils.instantiateClass(ClassUtils.java:60)
	at net.sf.jasperreports.extensions.ExtensionsEnvironment.createDefaultRegistry(ExtensionsEnvironment.java:84)
	at net.sf.jasperreports.extensions.ExtensionsEnvironment.<clinit>(ExtensionsEnvironment.java:72)
	... 92 more
2012-05-08 09:44:41,218 WARNING [javax.enterprise.resource.webcontainer.jsf.lifecycle] (http-127.0.0.1-8080-1) #{dynamicJasper.downloadPDF()}: java.lang.reflect.InvocationTargetException
javax.faces.FacesException: #{dynamicJasper.downloadPDF()}: java.lang.reflect.InvocationTargetException
	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
	at javax.faces.component.UICommand.broadcast(UICommand.java:387)
	at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
	at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
	at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
	at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
	at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:86)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
	at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
	at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
	at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
	at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
	at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
	at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
	at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
	at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:619)
Caused by: javax.faces.el.EvaluationException: java.lang.reflect.InvocationTargetException
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
	... 52 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
	at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
	at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
	at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
	at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
	at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
	at com.mydomain.pkg.action.DynamicJasper_$$_javassist_seam_9.downloadPDF(DynamicJasper_$$_javassist_seam_9.java)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335)
	at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:280)
	at org.jboss.el.parser.AstMethodSuffix.getValue(AstMethodSuffix.java:59)
	at org.jboss.el.parser.AstMethodSuffix.invoke(AstMethodSuffix.java:65)
	at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
	at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
	at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
	... 53 more
Caused by: java.lang.ExceptionInInitializerError
	at net.sf.jasperreports.engine.util.JRStyledTextParser.<clinit>(JRStyledTextParser.java:80)
	at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:176)
	at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:77)
	at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:59)
	at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:147)
	at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:83)
	at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:628)
	at com.mydomain.pkg.action.DynamicJasper.downloadPDF(DynamicJasper.java:186)
	... 84 more
Caused by: net.sf.jasperreports.engine.JRRuntimeException: Class net.sf.jasperreports.extensions.DefaultExtensionsRegistry does not implement/extend net.sf.jasperreports.extensions.ExtensionsRegistry
	at net.sf.jasperreports.engine.util.ClassUtils.instantiateClass(ClassUtils.java:60)
	at net.sf.jasperreports.extensions.ExtensionsEnvironment.createDefaultRegistry(ExtensionsEnvironment.java:84)
	at net.sf.jasperreports.extensions.ExtensionsEnvironment.<clinit>(ExtensionsEnvironment.java:72)
	... 92 more
2012-05-08 09:44:41,421 SEVERE [javax.enterprise.resource.webcontainer.jsf.lifecycle] (http-127.0.0.1-8080-1) JSF1054: (Phase ID: INVOKE_APPLICATION 5, View ID: /homeCuriosita.xhtml) Exception thrown during phase execution: javax.faces.event.PhaseEvent[[email protected]]

link publish delete flag offensive edit

answered 2012-05-11 09:19:22 +0800

LOOPSTER gravatar image LOOPSTER
6

Hi all , i ve solved the problem it was due to a conflict of jasperreport library .

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-01-07 13:35:34 +0800

Seen: 8,656 times

Last updated: May 11 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More