Jump to content
Changes to the Jaspersoft community edition download ×

WriteAbortedException DefaultFormatFactory


martynhiemstra

Recommended Posts

Hi All,

 

I have possibly found a bug in jasperreport. I used to use version 1.3.0 but a few days ago I replaced jasperreport 1.3.0 with 1.3.3

 

Now when I startup tomcat I see this in my logs:

SEVERE: Exception loading sessions from persistent storage

java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: net.sf.jasperreports.engine.util.DefaultFormatFactory

 

As you can see it is marked as SEVERE.

 

Anybody expierencing this?

 

Martyn

 

------------------------

Here is the log output:

 

SEVERE: IOException while loading persisted sessions: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: net.sf.jasperreports.engine.util.DefaultFormatFactory

java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: net.sf.jasperreports.engine.util.DefaultFormatFactory

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1309)

at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)

at java.util.HashMap.readObject(HashMap.java:1067)

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:585)

at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)

at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809)

at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)

at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)

at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1392)

at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:921)

at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:393)

at org.apache.catalina.session.StandardManager.load(StandardManager.java:320)

at org.apache.catalina.session.StandardManager.start(StandardManager.java:636)

at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:431)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4155)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)

at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:608)

at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535)

at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)

at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)

at org.apache.catalina.core.StandardService.start(StandardService.java:450)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)

at org.apache.catalina.startup.Catalina.start(Catalina.java:551)

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:585)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)

 

------------------------

Post edited by: martynhiemstra, at: 2007/05/18 07:30

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

  • 7 months later...

I have the same problem, when I send an JasperPrint object through layers my web application

 

Error (de-)serializing object: net.sf.jasperreports.engine.util.DefaultFormatFactory; nested exception is:

java.io.NotSerializableException: net.sf.jasperreports.engine.util.DefaultFormatFactory

 

I used version jasperreport 2.0.2.

Link to comment
Share on other sites

dramirez wrote:

I have the same problem, when I send an JasperPrint object through layers my web application

Error (de-)serializing object: net.sf.jasperreports.engine.util.DefaultFormatFactory; nested exception is:
java.io.NotSerializableException: net.sf.jasperreports.engine.util.DefaultFormatFactory

I used version jasperreport 2.0.2.

 

How can we reproduce this? Do you have a full stacktrace?

 

We serialize JasperPrint objects all the time, and we've never seen this error.

 

Regards,

Lucian

Link to comment
Share on other sites

  • 5 years later...

I've encountered the same problem and this is how I managed it. Hopefully it will help somebody.

 

On my web-app (Apache Wicket based), on one of my pages (ReportsHomePage), I have a button which triggers the creation of reports.

From the form, I gather informations (ReportTemplate, JasperExporterType, parameters Map) and construct a JavaBean (JasperBean).

Then I pass this bean to the constructor of my button.

 

The button is pressed, it creates the report just fine, and afterwards, my page (with my button, my bean, my Map of parameters) gets serialized.

 

Only that, during the creation of the report, my Map of parameters gains additional elements, from

{

PARAM_TABLE1_ID=1,

PARAM_TABLE2_ID=10001

}

 

to

 

{

REPORT_LOCALE=en_GB,

JASPER_REPORT=net.sf.jasperreports.engine.JasperReport@f1c2137,

REPORT_FORMAT_FACTORY=net.sf.jasperreports.engine.util.DefaultFormatFactory@7fc8a9a0,

REPORT_TIME_ZONE=sun.util.calendar.ZoneInfo[...],

REPORT_PARAMETERS_MAP=(this Map),

REPORT_CONNECTION=oracle.jdbc.driver.T4CConnection@4ef888ea,

PARAM_TABLE1_ID=1,

PARAM_TABLE2_ID=10001,

IS_IGNORE_PAGINATION=false

}

 

On the chain of method calls (JasperFillManager.fillReport(.., JRFiller.fillReport(.., filler.fill(.., fill(.., and so on), the following parameters are added

 

parameterValues.put(JRParameter.REPORT_CONNECTION, conn);

parameterValues.put(JRParameter.REPORT_FORMAT_FACTORY, formatFactory);

parameterValues.put(JRParameter.IS_IGNORE_PAGINATION, ignorePagination ? Boolean.TRUE : Boolean.FALSE);

parameterValues.put(JRParameter.REPORT_PARAMETERS_MAP, parameterValues);

parameterValues.put(JRParameter.JASPER_REPORT, filler.getJasperReport());

parameterValues.put(JRParameter.REPORT_LOCALE, locale);

parameterValues.put(JRParameter.REPORT_TIME_ZONE, timeZone);

 

 

So this is how and why I've got the "java.io.NotSerializableException: net.sf.jasperreports.engine.util.DefaultFormatFactory" exception.

 

Finally, to get rid of this problem, I garbage collect (Map params = new HashMap();) my Map of parameters immediately after the creation of the report and before handling the Response (before the Serialization phase).

 

Regards,

PetruBogdanPetrescu

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...