You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Igor Vaynberg (JIRA)" <ji...@apache.org> on 2009/04/17 20:28:14 UTC

[jira] Resolved: (WICKET-2228) Error running JasperReportsApplication.java

     [ https://issues.apache.org/jira/browse/WICKET-2228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2228.
-----------------------------------

    Resolution: Invalid
      Assignee: Igor Vaynberg

this is a bug report for wicketstuff.org jira, not for the core wicket project.

> Error running JasperReportsApplication.java
> -------------------------------------------
>
>                 Key: WICKET-2228
>                 URL: https://issues.apache.org/jira/browse/WICKET-2228
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4-RC2
>         Environment: Windows XP -jdk 1.6  Tomcat 6.0.16
>            Reporter: Teddy Clermont
>            Assignee: Igor Vaynberg
>            Priority: Critical
>
> 1. Error loading example.jasper file - looks like the file is corrupted -- also getting the error using IReport-nb-3.5.0
> 2. Replace file and code:
> /**
> 	 * Constructor.
> 	 */
> 	Integer knt = 0;
> 	public SimplePdfPage()
> 	{
> 		ServletContext context = ((WebApplication) getApplication()).getServletContext();
> //		final File reportFile = new File(context.getRealPath("/reports/example.jasper"));
> 		System.out.println("About to get file , " +   knt++ + "times");
> //		final
> 		File reportFile = new File(context.getRealPath("/reports/report1.jrxml"));
> 		System.out.println(" gott file , " + knt + "times");
> 		JasperDesign design = null;
> 		try {
> 			design = JRXmlLoader.load(reportFile);
> 			System.out.println(" design -- created " );
> 		} catch (JRException e) {
> 			// TODO Auto-generated catch block
> 			e.printStackTrace();
> 		}
> 		//do something with template
> 		try {
> 			JasperReport report = JasperCompileManager.compileReport(design);
> 			System.out.println(" report -- created " );
> 		} catch (JRException e) {
> 			// TODO Auto-generated catch block
> 			e.printStackTrace();
> 		} 
> 		final Map parameters = new HashMap();
> 		JRResource pdfResource = new JRPdfResource(reportFile).setReportParameters(
> 				parameters).setReportDataSource(new ExampleDataSource());
> 		System.out.println(" pdfResource -- created " );
> 		add(new EmbeddedJRReport("report", pdfResource));
> 		reportFile = null;
>  and now getting :
> About to get file , 0times
>  gott file , 1times
>  design -- created
>  report -- created
>  pdfResource -- created
> About to get file , 0times
>  gott file , 1times
>  design -- created
>  report -- created
>  pdfResource -- created
> 27655 [http-8080-2] ERROR org.apache.wicket.RequestCycle - net.sf.jasperreports.
> engine.JRException: Error loading object from file : C:\Apps\Wicket-Stuff\src\ex
> amples\webapp\reports\report1.jrxml
> org.apache.wicket.WicketRuntimeException: net.sf.jasperreports.engine.JRExceptio
> n: Error loading object from file : C:\Apps\Wicket-Stuff\src\examples\webapp\rep
> orts\report1.jrxml
>         at wicket.contrib.jasperreports.JRResource.getJasperReport(JRResource.ja
> va:230)
>         at wicket.contrib.jasperreports.JRResource.getFileName(JRResource.java:3
> 33)
>         at wicket.contrib.jasperreports.JRResource.setHeaders(JRResource.java:48
> 2)
>         at org.apache.wicket.markup.html.WebResource.configureResponse(WebResour
> ce.java:53)
>         at org.apache.wicket.Resource.onResourceRequested(Resource.java:121)
>         at wicket.contrib.jasperreports.EmbeddedJRReport.onResourceRequested(Emb
> eddedJRReport.java:55)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInte
> rface.java:182)
>         at org.apache.wicket.request.target.component.BookmarkableListenerInterf
> aceRequestTarget.processEvents(BookmarkableListenerInterfaceRequestTarget.java:1
> 63)
>         at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents
> (AbstractRequestCycleProcessor.java:92)
>         at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.j
> ava:1192)
>         at org.apache.wicket.RequestCycle.step(RequestCycle.java:1271)
>         at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1370)
>         at org.apache.wicket.RequestCycle.request(RequestCycle.java:501)
>         at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:
> 455)
>         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.ja
> va:288)
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
> icationFilterChain.java:235)
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
> ilterChain.java:206)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
> alve.java:233)
>         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
> alve.java:175)
>         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
> ava:128)
>         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
> ava:102)
>         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
> ve.java:109)
>         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
> a:286)
>         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
> :844)
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
> ss(Http11Protocol.java:583)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
> 7)
>         at java.lang.Thread.run(Thread.java:595)
> Caused by: net.sf.jasperreports.engine.JRException: Error loading object from fi
> le : C:\Apps\Wicket-Stuff\src\examples\webapp\reports\report1.jrxml
>         at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:96
> )
>         at wicket.contrib.jasperreports.JRResource$3.newJasperReport(JRResource.
> java:191)
>         at wicket.contrib.jasperreports.JRResource.getJasperReport(JRResource.ja
> va:226)
>         ... 30 more
> Caused by: java.io.StreamCorruptedException: invalid stream header
>         at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:764
> )
>         at java.io.ObjectInputStream.<init>(ObjectInputStream.java:277)
>         at net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream.
> <init>(ContextClassLoaderObjectInputStream.java:57)
>         at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:91
> )
>         ... 32 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.