Net.sf.jasperreports.engine.JRException: Error loading object from file : C

I started using JasperReports for my web application report generation. I'm using JSPs for web development.
I created a .jrxml file using iReport and used the following code to generate the report.
try {
          JasperDesign jasperDesign = JRXmlLoader.load("C:\\tomcat\\webapps\\web\\JSP\\reports\\samples\\pmm-final.jrxml");
          JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
// Second, create a map of parameters to pass to the report.
          Map parameters = new HashMap();
          parameters.put("Title", "JasperReport");
// Third, get a database connection
          Connection conn = null;
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          conn=DriverManager.getConnection("jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=C:/tomcat/webapps/db1/db1.mdb");
// Fourth, create JasperPrint using fillReport() method
          JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,
                              parameters, conn);
// You can use JasperPrint to create PDF
          //JasperExportManager.exportReportToPdfFile(jasperPrint, "C:\\tomcat\\webapps\\web\\JSP\\reports\\TestReport.pdf");
          JasperExportManager.exportReportToHtmlFile(jasperPrint, "C:\\tomcat\\webapps\\web\\JSP\\reports\\TestPMM.html");
          JRXlsExporter exporter = new JRXlsExporter();
          exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
          exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "C:\\tomcat\\webapps\\web\\JSP\\reports\\TestPMM.xls");
          exporter.exportReport();
// Or to view report in the JasperViewer
          //JasperViewer.viewReport(jasperPrint);
} catch (JRException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
} catch (SQLException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
The above pmm-final.jrxml uses a subreport 'top.jasper'. Error being thrown while loading top.jasper file. Error is as follows.
java.io.InvalidClassException: net.sf.jasperreports.engine.base.JRBaseReport; lo
cal class incompatible: stream classdesc serialVersionUID = 604, local class ser
ialVersionUID = 606
at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:86
at net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLo
ader.java:236)
at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubre
port.java:295)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:
340)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillPageBand(JRVert
icalFiller.java:1224)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillPageHeader(JRVe
rticalFiller.java:353)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRV
erticalFiller.java:205)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVertic
alFiller.java:119)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:
613)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:
483)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:77
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillMa
nager.java:248)
at org.apache.jsp.JSP.UserGuide_jsp._jspService(org.apache.jsp.JSP.UserG
uide_jsp:74)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:325)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2
95)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:306)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:745)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.ja
va:675)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:868)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:684)
at java.lang.Thread.run(Unknown Source)
NESTED BY :
java.io.InvalidClassException: net.sf.jasperreports.engine.base.JRBaseReport; lo
cal class incompatible: stream classdesc serialVersionUID = 604, local class ser
ialVersionUID = 606
at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:86
at net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLo
ader.java:236)
at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubre
port.java:295)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:
340)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillPageBand(JRVert
icalFiller.java:1224)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillPageHeader(JRVe
rticalFiller.java:353)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRV
erticalFiller.java:205)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVertic
alFiller.java:119)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:
613)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:
483)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:77
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillMa
nager.java:248)
at org.apache.jsp.JSP.UserGuide_jsp._jspService(org.apache.jsp.JSP.UserG
uide_jsp:74)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:325)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2
95)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:306)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:745)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.ja
va:675)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:868)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:684)
at java.lang.Thread.run(Unknown Source)
NESTED BY :
net.sf.jasperreports.engine.JRException: Error loading object from file : C:\tom
cat\webapps\web\JSP\reports\samples\top.jasper
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:90
at net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLo
ader.java:236)
at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubre
port.java:295)
at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:
340)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillPageBand(JRVert
icalFiller.java:1224)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillPageHeader(JRVe
rticalFiller.java:353)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRV
erticalFiller.java:205)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVertic
alFiller.java:119)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:
613)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:
483)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:77
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillMa
nager.java:248)
at org.apache.jsp.JSP.UserGuide_jsp._jspService(org.apache.jsp.JSP.UserG
uide_jsp:74)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:325)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2
95)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:306)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:745)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.ja
va:675)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:868)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:684)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.InvalidClassException: net.sf.jasperreports.engine.base.JRBas
eReport; local class incompatible: stream classdesc serialVersionUID = 604, loca
l class serialVersionUID = 606
at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:86
... 33 more
Anyone pls help. It's bit urgent. Thanks.

I was using iReport v0.5.0 and it uses jasperreports-0.6.7.jar (v0.6.7) of
JasperReports. I compiled and i deployed my application in BEA weblogic server. I got the error listed below. Only after i saw your
response explaining that iReport was the issue, i checked the iReport lib directory and found this version of jasperreport jar.
iReport creates a java source file which is used to a jasper file.
iReport will link in the v0.6.7 version of jasperReports. When you
deploy your web application it will recognize this version through the compiled jasper file and give you the InvalidClassException, even
though you only have one jasperReport jar deployed with your war file.
The way i fixed this problem was to create my web application with the
jasperreport jar comes with iReport.
Thanks for mentioning iReport.
Christopher
Error:
Caused by: java.io.InvalidClassException: net.sf.jasperreports.engine.base.JRBas
eReport; local class incompatible: stream classdesc serialVersionUID = 607, local class serialVersionUID = 10002
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:463)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
...

Similar Messages

  • Classloading error: package net.sf.jasperreports.engine does not exist

    Hi all!
    We are migrating one of our web applications to SAP Web AS (Netweaver CE SR5) but we are facing one problem with finding an external library (Jasper Report).
    Our web application uses Spring and Hibernate and works fine in Tomcat 5.5 or higher.
    The problem is that the package net.sf.jasperreports.engine cannot be found (stack below) despite the jasper report jar is included inside the WEB-INF/lib dir of our WAR.
    Our application´s structure is as follows:
    cpl.ear
    cpl.ear/lib (hibernate´s and other thirdy party jars)
    cpl.ear/Cockpit_oracle9_3_5_0.war
    cpl.ear/Cockpit_oracle9_3_5_0.war/WEB-INF/lib/jasperreports-1.3.1.jar
    Does any body know why the application can´t find the jasper report packages?
    Thanks and regards.
    Ballock.
    #1.5 #001EC91DBA01002200000002000007900096BE50A0E2AB09#1219343345836#/System/Server/WebRequests#JavaEE/cpl#com.sap.engine.services.servlets_jsp.server.application.WebEvents#Guest#916####88ee30106eff11dd8e03001ec91dba01#Application ##0#0#Warning#1#com.sap.engine.services.servlets_jsp.server.application.WebEvents#Plain###Error occured in invoking event "contextInitialized()" on listener class org.springframework.web.context.ContextLoaderListener.
    The error is: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'service.load.report' defined in class path resource spring/model.services.xml: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class br.com.neolog.system.load.LoadReport: Constructor threw exception; nested exception is java.lang.IllegalStateException: net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
    C:
    usr
    sap
    CE1
    J00
    j2ee
    cluster
    server0
    loadReport_1219343342726_788986.java:4: package net.sf.jasperreports.engine does not exist
    import net.sf.jasperreports.engine.*;
    ^
    C:
    usr
    sap
    CE1
    J00
    j2ee
    cluster
    server0
    loadReport_1219343342726_788986.java:5: package net.sf.jasperreports.engine.fill does not exist
    import net.sf.jasperreports.engine.fill.*;
    ^
    C:
    usr
    sap
    CE1
    J00
    j2ee
    cluster
    server0
    loadReport_1219343342726_788986.java:14: package net.sf.jasperreports.engine does not exist
    import net.sf.jasperreports.engine.*;
    ^
    C:
    usr
    sap
    CE1
    J00
    j2ee
    cluster
    server0
    loadReport_1219343342726_788986.java:15: package net.sf.jasperreports.engine.data does not exist
    import net.sf.jasperreports.engine.data.*;
    ^
    C:
    usr
    sap
    CE1
    J00
    j2ee
    cluster
    server0
    loadReport_1219343342726_788986.java:21: cannot find symbol
    symbol: class JREvaluator
    public class loadReport_1219343342726_788986 extends JREvaluator
                                                         ^
    C:
    usr
    sap
    CE1
    J00
    j2ee
    cluster
    server0
    loadReport_1219343342726_788986.java:28: cannot find symbol
    symbol  : class JRFillParameter
    location: class loadReport_1219343342726_788986
        private JRFillParameter parameter_REPORT_RESOURCE_BUNDLE = null;
                ^
    C:
    usr
    sap
    CE1
    J00
    j2ee
    cluster
    server0
    loadReport_1219343342726_788986.java:29: cannot find symbol
    symbol  : class JRFillParameter
    location: class loadReport_1219343342726_788986
        private JRFillParameter parameter_REPORT_CLASS_LOADER = null;
    Obs.: The stack above is just a part of the total error log
    Edited by: Ballock on Aug 21, 2008 9:46 PM

    I also tried to move the jasperreports-1.3.1.jar file to the cpl.ear/lib dir but the problem still happened.
    Please, does anybody know how to deal with this problem?
    Thanks and regards.
    Ballock.

  • Net.sf.jasperreports.engine.fill.JRExpressionEvalException

    Hi!
    I am trying to change the print engine from an old software project to JasperReports.
    Some data comes in a wrong characterset over the jdbcodbc-interface. I can't use an other driver, because this is a verry special database.
    I helped me with changing the fields to a new String($F{LB_TEXT}.getBytes(), "MacRoman").
    This worked verry well under iReport and Eclipse. And also, if I test my code over a btach-file under Windows XP.
    But if I call the programm inside the old application (same place, and same way as in the batch-file), I get the following error.
    ERROR!
    Message:
    net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression :
    Source text : new String($F{LB_TEXT}.getBytes(), "MacRoman")
    Level:
    SEVERE
    Stack Trace:
    Error evaluating expression : Source text : new String($F{LB_TEXT}.getBytes(), "MacRoman")
    net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:197)
    net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:537)
    net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:505)
    net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:826)
    net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:368)
    net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:353)
    net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:275)
    net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:426)
    net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1380)
    net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupHeader(JRVerticalFiller.java:591)
    net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupHeaders(JRVerticalFiller.java:524)
    net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:253)
    net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:113)
    net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:879)
    net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:782)
    net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63)
    net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:402)
    net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:234)
    biz.soag.jr4ao.helpers.CreateReport.fillReport(CreateReport.java:112)
    biz.soag.jr4ao.helpers.CreateReport.doInBackground(CreateReport.java:67)
    biz.soag.jr4ao.helpers.CreateReport.doInBackground(CreateReport.java:1)
    javax.swing.SwingWorker$1.call(Unknown Source)
    java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    java.util.concurrent.FutureTask.run(Unknown Source)
    javax.swing.SwingWorker.run(Unknown Source)
    java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    java.lang.Thread.run(Unknown Source)
    MacRoman
    java.lang.StringCoding.decode(Unknown Source)
    java.lang.String.<init>(Unknown Source)
    java.lang.String.<init>(Unknown Source)
    LB45Ausdruck46d_lb_pos_1217230426744_870805.evaluate(LB45Ausdruck46d_lb_pos_1217230426744_870805:389)
    net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:186)
    net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:537)
    net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:505)
    net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:826)
    net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:368)
    net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:353)
    net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:275)
    net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:426)
    net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1380)
    net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupHeader(JRVerticalFiller.java:591)
    net.sf.jasperreports.engine.fill.JRVerticalFiller.fillGroupHeaders(JRVerticalFiller.java:524)
    net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:253)
    net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:113)
    net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:879)
    net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:782)
    net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63)
    net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:402)
    net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:234)
    biz.soag.jr4ao.helpers.CreateReport.fillReport(CreateReport.java:112)
    biz.soag.jr4ao.helpers.CreateReport.doInBackground(CreateReport.java:67)
    biz.soag.jr4ao.helpers.CreateReport.doInBackground(CreateReport.java:1)
    javax.swing.SwingWorker$1.call(Unknown Source)
    java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    java.util.concurrent.FutureTask.run(Unknown Source)
    javax.swing.SwingWorker.run(Unknown Source)
    java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    java.lang.Thread.run(Unknown Source)
    The problem comes from the conversation. Because if I don't make the conversation, or leafe the filed away, there is no error. But if I don't make the conversation, some german characters (Umlauts) are not correct.
    Has anybody an idea?
    Thanks,
    Christian.

    Hi,
    I solved this problem.
    An help is on this links:
    https://www.linuxnet.ch/jasper-reports-inline-images-as-svg-for-better-scaling/
    and
    http://community.jaspersoft.com/questions/525861/how-use-svg-jasperreports
    If you have/use a inline SVG string instead of SVG file, as showed in this links, it's necessary use this net.sf.jasperreports.renderers.BatikRenderer.getInstanceFromText in your report definition.
    Example of my .jrxml:
    <parameter name="ShapeImage" class="java.lang.String" isForPrompting="false">
    <parameterDescription><![CDATA[]]></parameterDescription>
    </parameter>
    <image hAlign="Center" vAlign="Middle">
    <reportElement x="2" y="106" width="551" height="186" uuid="0407b952-8088-4146-9dfc-b61f71e78201"/>
    <imageExpression><![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstanceFromText($P{ShapeImage})]]></imageExpression>
    </image>
    </frame>

  • Error loading schemas from wsdl

    Hello,
    Can someone please tell me the meaning of the error ->
    "Error loading schemas from wsdl"
    In our production environment , I see this error for one of the domains , whenever we restart services during the weekend .
    The exact error log is :
    <2007-09-22 05:11:26,749> <INFO> <Receipts.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::initiateInboundJcaEndpoint - Creating and initializing inbound JCA endpoint for:
    process='bpel://localhost/Receipts/ReceiptController~1.2/'
    domain='Receipts'
    WSDL location='receiptReaderService.wsdl'
    portType='Read_ptt'
    operation='Read'
    activation properties={BAERCVDET=/export/bpel/data/prod/outgoing, BAERCVDETARCH=/export/bpel/data/prod/archive, portType=Read_ptt}
    <2007-09-22 05:11:26,750> <INFO> <Receipts.collaxa.cube.activation> <AdapterFramework::Inbound> Adapter Framework instance: OraBPEL - endpointActivation for portType=Read_ptt, operation=Read
    <2007-09-22 05:11:26,910> <ERROR> <Receipts.collaxa.cube.activation> <AdapterFramework::Inbound> Error while performing endpoint Activation: ORABPEL-09701
    Error loading schemas from wsdl.
    Error while loading schemas from wsdl file at location "file:/oracle/product/10gas/busintel/integration/orabpel/domains/Receipts/tmp/.bpel_ReceiptController_1.2.jar/receiptReaderService.wsdl". The reason is Error loading schemas from wsdl.
    Error while loading schemas from wsdl file at location "file:/oracle/product/10gas/busintel/integration/orabpel/domains/Receipts/tmp/.bpel_ReceiptController_1.2.jar/receiptReaderService.wsdl". The reason is Connection refused.
    Please verify the schemas defined in wsdl.
    Please verify the schemas defined in wsdl.
    <2007-09-22 05:11:26,914> <ERROR> <Receipts.collaxa.cube.activation> <AdapterFramework::Inbound>
    ORABPEL-09701
    Error loading schemas from wsdl.
    Error while loading schemas from wsdl file at location "file:/oracle/product/10gas/busintel/integration/orabpel/domains/Receipts/tmp/.bpel_ReceiptController_1.2.jar/receiptReaderService.wsdl". The reason is Error loading schemas from wsdl.
    Error while loading schemas from wsdl file at location "file:/oracle/product/10gas/busintel/integration/orabpel/domains/Receipts/tmp/.bpel_ReceiptController_1.2.jar/receiptReaderService.wsdl". The reason is Connection refused.
    Please verify the schemas defined in wsdl.
    Please verify the schemas defined in wsdl.
         at com.collaxa.cube.xml.xsd.xerces.WSDLSchemaManager.loadAllSchemas(WSDLSchemaManager.java:314)
         at com.collaxa.cube.ws.wsdl.WSDLManager.getWSDLSchemaManager(WSDLManager.java:368)
         at oracle.tip.adapter.fw.jca.AdapterFrameworkImpl.endpointActivation(AdapterFrameworkImpl.java:406)
         at oracle.tip.adapter.fw.agent.jca.JCAActivationAgent.activateInboundJcaEndpoint(JCAActivationAgent.java:869)
         at oracle.tip.adapter.fw.agent.jca.JCAActivationAgent.initiateInboundJcaEndpoint(JCAActivationAgent.java:856)
         at oracle.tip.adapter.fw.agent.jca.JCAActivationAgent.init(JCAActivationAgent.java:399)
         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:324)
         at com.collaxa.cube.engine.core.BaseCubeProcess.notifyActivationAgents(BaseCubeProcess.java:558)
         at com.collaxa.cube.engine.core.BaseCubeProcess.enableActivationAgents(BaseCubeProcess.java:490)
         at com.collaxa.cube.engine.deployment.CubeProcessHolder.setDefaultRevision(CubeProcessHolder.java:1166)
         at com.collaxa.cube.engine.deployment.CubeProcessHolder.setDefaultRevision(CubeProcessHolder.java:1098)
         at com.collaxa.cube.engine.CubeEngine.setDefaultRevision(CubeEngine.java:1047)
         at com.collaxa.cube.engine.ejb.impl.CubeEngineBean.setDefaultRevision(CubeEngineBean.java:530)
         at ICubeEngineLocalBean_StatelessSessionBeanWrapper0.setDefaultRevision(ICubeEngineLocalBean_StatelessSessionBeanWrapper0.java:2345)
         at com.collaxa.cube.engine.dispatch.message.process.SetDefaultMessageHandler.handle(SetDefaultMessageHandler.java:42)
         at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:125)
         at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
         at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
         at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:123)
         at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:755)
         at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:928)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)
    <2007-09-22 05:11:27,035> <ERROR> <Receipts.collaxa.cube> <BaseCubeSessionBean::logError> Error while invoking bean "cube engine": Could not initialize activation agent.
    An error occured while initializing an activation agent for process "ReceiptController", revision "1.2".
    Please ensure that the activation agents are configured correctly in the bpel deployment descriptor (bpel.xml).
    oracle.tip.adapter.fw.agent.jca.JCAActivationAgent: java.lang.reflect.InvocationTargetException
    ORABPEL-09903
    How can i further troubleshoot this . later on when I restart again ...it works .
    Help appreciated .
    Amith

    Hello,
    Thanks for your response.
    U see ..this happens only when the all the services / databases etc come back up after a cold backup during the weekend . And like I u have mentioned , I thought this could be due to the BPEL service trying to connect to one of the databases as mentioned in the oc4j-ra.xml ( there are 3 distinct database connections to 3 diff databases ) . So I made sure that all the dbs are up and running before this particular service is started . It wroks at times ..but then it fails at times . So I have started wondering whether this is a different issue . And I am not able to troubleshoot it any further .
    What exactly should I check in the wsdl file ..
    Appreciate your help !
    Amith

  • 'Error loading plugin: Plugin file not found' message on ONLY 5 sites, but all others OK.  Help, please!

    Hi Again!
    I posted this problem here before, but since I really need to access the sites that receive this error message in less than a month, I had to re-post; hopefully someone who didn't see it before will see it & have a solution for me.
    Here are the details:  I'm running windows 8.1 & I use Firefox 33.1.1, Pale Moon 25.1.0 or Opera 26.0 as my browsers, (I have IE installed & up-to-date, but I never use it).  I followed the 10-point checklist on Adobe & everything was done, except for "uncheck Hardware Acceleration" in Flash 'Settings'; I tried to uncheck it on this site, where it's indicated, as well as in my 4 browsers when I'm doing something that uses Flash, but no matter how hard I try, I can't 'uncheck' the check mark in that tiny box!  Since this error problem only affects 5 web sites, & I can watch streaming media on all other sites, I don't think it's an issue. 
    Here's how this problem began:  I was watching a live, streaming nest-cam on 5/09/14 around 11:00AM, (yes, I DO know the exact time & date, because it happened so suddenly while I was watching this website that I'd been watching since the end of February, 2014), when my screen went black.  I thought it was probably an Adobe Crash, but when the usual Crash Report window didn't show up, I just closed Firefox & reopened it, expecting to resume watching the nest-cam.  When I went back to the site, I got the black screen with the "Error loading plugin: Plugin file not found" message.  The chat portion on the site still works, though. I know there are other sites with this nest-cam feed, so I started trying them, but it took several tries for me to find one that didn't get the error message! I posted this problem on "Windows BBS" forum, & someone else posted that the same thing happened to them AND on the same sites!  They didn't have a solution, either.  I cleared my cache, rebooted my PC & even did a System Restore, but whatever happened in that brief second made using ONLY 5 sites impossible.  Here are the sites that receive the error message:
    http://pixcontroller.com/eagles, (but I CAN go to http://pixcontroller.com, but there isn't any streaming media)
    http://cbslocal.com/eagles
    http://westmorelandconservancy.org/BlueBirdwebcam-1.htm
    http://wildearth.tv/cam/pittsburgh-bald-eagles, (I get the error message on ALL cams on this site)
    http://aviary.org/BE-NestCam1 (I get the error message on ALL cams on this site)
    Now if any videos from the 5 websites above are uploaded to YouTube, I can watch them perfectly...no error message if I watch the videos elsewhere.  Luckily, I found Ustream, & they have most of the nest cams I watch, but I need to fix this issue, because it's nearing nesting time!  I'm an amateur nest-watcher & it's vital that I have access to these 5 sites, so if anyone knows how to fix this, PLEASE tell me!
    Thanks for taking the time to read my post.
    All suggestions/solutions are gratefully accepted.
    Thanks in advance for your help!
    DogPal 

    File Not Found Error in Welcome Screen
    07-Nov-2013 10:25
    Tags: #dreamweaver_cs6_update
    Help please!
    Live preview also not working.
    I have exactly the exact problem described below but do not have a folder with the same name as the volume created under the volume. Please can someone help - I've tried everything. This problem only happened when I upgraded to Dreaweaver CC!
    "On launching Dreamweaver on your Macintosh if your Welcome Screen is not loading and if you see a "File not found" error, please check if you have a folder with the same name as your volume created under the volume. For more info on this please go through the attached pdf document. Other dialogs/panels in dreamweaver that will be blank due to this issue are Jquery Swatches panel, Adobe Edge Webfonts tab in Manage Fonts dialog,W3c Error Info dialog, Externalise Javascript dialog and svn revert dialog. After following the changes mentioned in the attached document please check all the affected dialogs/panels to confirm everything is working as expected."
    Thanks,
    Martin Bond
    [personal information removed by moderator]

  • "Error loading media. File Could not be played"  when trying to view streaming media on only some sites.  How to fix?

    Hi!
    I've been having a problem trying to view streaming media, but it only happens on some sites.  It's similar to a problem I have on my Windows PC, that's related to Adobe Flash, but since I'm very new to using my iPad Mini, I don't even know if Apple devices have Flash...do they?
    Anyway, when I go to a site that's plagued by this issue, I tap the 'Play' arrow on my screen & the circle spins like it's gonna play, but then the screen turns black & this error message appears:
                                                  "Error loading media. File Could not be played"  followed by a triangle with an exclamation point !
    I read several articles online & the solutions ran from updating firmware in their router, (mine is brand new...installed last Thursday), to disabling ad-block programs in their browsers...(I don't have any enabled), and the last one was making changes to the DNS...(I know it means 'domain name server', but I don't have the foggiest idea how to make changes to it!
    Anyway, that's my problem.  I hope that someone out there knows what I can do to fix it!
    Thanks in advance for your help.
    K-9Pal

    I would assume an issue with the HTML5 media player.
    If those aren't working on Windows then it is possible that the proper codecs aren't installed.
    You can try to disable the HTML5 media player and make Firefox use the Flash plugin.
    You can do this by setting these two prefs to false on the <b>about:config</b> page:
    *media.windows-media-foundation.enabled
    *media.directshow.enabled
    See also:
    Windows Media Feature Pack for Windows 7 N and for Windows 7 KN:
    *http://support.microsoft.com/kb/968211 - www.microsoft.com/en-us/download/details.aspx?id=16546

  • EmbeddedLDAP BEA-171526 Error loading initial replica file, attempting

    After add a new XACML policy following the steps described in [1] I get the following error after restart a managed server.
    >
    <02/08/2012 16h35min03s BRT> <Error> <EmbeddedLDAP> <BEA-000000> <Error adding entry: >cn=urn@Lbea@[email protected]@Lentitlement@Lresource@LDummyMBeanAuthPolicy->v1+xacmlVersion=1.0,ou=Policies,ou=XACMLAuthorization,ou=myrealm,dc=poc-jmx>
    <02/08/2012 16h35min03s BRT> <Notice> <EmbeddedLDAP> <BEA-171526> <Error loading initial replica file, attempting reload.>
    <02/08/2012 16h35min04s BRT> <Error> <EmbeddedLDAP> <BEA-000000> <Error adding entry: >cn=urn@Lbea@[email protected]@Lentitlement@Lresource@LDummyMBeanAuthPolicy->v1+xacmlVersion=1.0,ou=Policies,ou=XACMLAuthorization,ou=myrealm,dc=poc-jmx>
    <02/08/2012 16h35min04s BRT> <Critical> <WebLogicServer> <BEA-000386> <Server subsystem failed. Reason: >weblogic.ldap.EmbeddedLDAPException: [EmbeddedLDAP:171525]Error loading initial replica file. Check EmbeddedLDAP log for more details.
    weblogic.ldap.EmbeddedLDAPException: [EmbeddedLDAP:171525]Error loading initial replica file. Check EmbeddedLDAP log for more details.
         at weblogic.ldap.EmbeddedLDAP.loadInitialReplicaFile(EmbeddedLDAP.java:1420)
         at weblogic.ldap.EmbeddedLDAP.start(EmbeddedLDAP.java:328)
         at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    <02/08/2012 16h35min04s BRT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FAILED>
    <02/08/2012 16h35min04s BRT> <Error> <WebLogicServer> <BEA-000383> <A critical service failed. The server will shut itself down>
    <02/08/2012 16h35min04s BRT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FORCE_SHUTTING_DOWN>"This error occurs only with managed servers. The Admin server starst fine. I tried to restore the myrealm security data but it not works. The managed servers are stuck on this error. The EmbededLDAP logs is empty.
    My XACML policy (xml file used to load the policy into myrealm using WLST) has the following content:
    <Policy PolicyId="urn:bea:xacml:2.0:entitlement:resource:DummyMBeanAuthPolicy-v1"
         RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable">
    <Description>VBV XACML Authorization Policy</Description>
    <Target>
    <Resources>
    <Resource>
    <ResourceMatch
    MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal">
    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">
              type=&lt;jmx&gt;, operation=invoke, application=, mbeanType=DummyMBean, target=dummyOperation
    </AttributeValue>
    <ResourceAttributeDesignator
    AttributeId="urn:oasis:names:tc:xacml:2.0:resource:resource-ancestor-or-self"
    DataType="http://www.w3.org/2001/XMLSchema#string"
    MustBePresent="true"/>
    </ResourceMatch>
    </Resource>
    </Resources>
    </Target>
    <Rule RuleId="primary-rule" Effect="Permit">
    <Condition>
    <Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-is-in">
    <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">
    vbvRole
    </AttributeValue>
    <SubjectAttributeDesignator
    AttributeId="urn:oasis:names:tc:xacml:2.0:subject:role"
    DataType="http://www.w3.org/2001/XMLSchema#string" />
    </Apply>
    </Condition>
    </Rule>
    <Rule RuleId="deny-rule" Effect="Deny"/>
    </Policy>Some idea about this error?
    Thanks.
    [1] http://docs.oracle.com/cd/E12840_01/wls/docs103/secwlres/xacmlusing.html

    Hey @The_assface!
    I check again my domain -> security -> embeded ldap config and in fact the option "Master First" was unchecked (as default). When you suggested check this option on your last reply, I didn't pay attention and the option checked was the "Refresh Replica At Startup" (and not "Master First" as you pointed). By default both option is unchecked. My intention checking "Refresh Replica At Startup" was to force managed server get a fresh copy of master embedded ldap (hold by Admin server). But this didn't works in my scenario.
    Now I unchecked "Refresh Replica At Startup" and checked "Master First". Then I restart Admin server and a managed server and until now the error do not occurs any more.
    Your suggestion works, but one question remains: Why managed servers' embedded ldap (replica) got corrupted after adding a XACML policy manually?
    Many thanks!

  • Unable to see IKM Hyperion to Planning when loading metadata from File/Tabl

    Hello,
    I am unable to view the IKM SQL to Hyperion Planning Knowledge Module in the flow tab. I reverse engineered the KM and I see the KM in my Project(Have only 1 project). I am trying to load metadata from file to planning and selected staging area different from target. I was able to reverse engineer the planning cube successfully to ODI Models.
    ODI Version: 11.1.1.6.3
    Planning Version: 11.1.2.2
    Any help will be appreciated.
    -Kash

    932916 wrote:
    Hello,
    I am unable to view the IKM SQL to Hyperion Planning Knowledge Module in the flow tab. I reverse engineered the KM and I see the KM in my Project(Have only 1 project). I am trying to load metadata from file to planning and selected staging area different from target. I was able to reverse engineer the planning cube successfully to ODI Models.
    What is your staging area pointing to ? Make sure it is pointing to a RDBMS schema or SUNOPSIS MEMORY
    ODI Version: 11.1.1.6.3
    Planning Version: 11.1.2.2
    Any help will be appreciated.
    -Kash

  • Problems with load DSO from file

    I am working with BI 7.0.
    I am loading data from file to DSO and my problem is that data is not active in my DSO, the data are loaded how New Data and I haven´t the data in query and DSO.
    The settings of my dso are:
    Type: standard
    SIDs Generation upon Activation: X
    Set Quality Status to 'OK' Automatically: X
    Activate Data Automatically: X
    I have created one transformation from datasource to DSO and one DTP that extract from datasource ( No PSA).
    When I execute the DTP there aren´t errors, the status is green and ok but the data is not active.
    If I try activate the data manually the job is launched but the data no active.
    Thanks.

    hai
    Isabel Bautista 
    u r saying the data is not active in dso and also u r loading the data from file directly( no psa).
               i think u know in B.I the data should be in psa then only u can load the data using DTP .so how can u load the data with out data in psa  .i thinks may be because of this u r data is not activating in dso
    if it helps
    assign some points ok

  • Load data from File on Client side (via Sqlplus)

    Server OS: RedHat, Oracle 10g rel 2.
    I am trying to load data from OS .txt files to clob field.
    I am able to do this successfully using:
    Oracle DIRECTORY
    BFILE
    DBMS_LOB.loadclobfromfile packageIssue is: this only works if my files and DIR are on database server.
    Is it not possible "load clob from file" from client side, files being on client and exec command via SQLPlus. Is there any other option to load data from client side.
    Thanks for any help.

    Options:
    1) Search for OraDAV
    2) Learn about Application Express.

  • Export with Table Splitting : ORA-01115: IO error reading block from file

    Hello,
    We are in perfroming the last dryrun of our CU&UC conversion.
    The are now in the process of exporting the ECC6 system (Oracle 10.2.0.4.0, HPUX ia64) using sapinst features, "table splitting preparation"
    When doing so, we are facing critical errors :
    Creating file /export_uni/sapinst_splitting/ora_query3_tmp3_1.sql.
    ERROR 2010-08-11 10:27:28.881
    CJS-00084  SQL statement or script failed. DIAGNOSIS: Error message: ORA-12801: error signaled in parallel query server P002
    ORA-01115: IO error reading block from file 90 (block # 16640)
    ORA-27072: File I/O error
    HPUX-ia64 Error: 22: Invalid argument
    Additional information: 4
    Additional information: 16640
    Additional information: -1
    ORA-01115: IO error reading block from file 90 (block # 16640)
    ORA-27072: File I/O error
    HPUX-ia64 Error: 22: Invalid argument
    ORA-06512: at "SAPR3.TABLE_SPLITTER", line 775
    ORA-06512: at line 1
    I have therefore perfmed a dbverify ; no corruption has been recorded.
    When trying to perfrom the EXPORT, without table splitting ; it works fine ...but the processing time is extremely long, as you can imagine. Any help would be highly appreciated.Regards.
    Raoul

    Thank you Stefan,
    Our HPUX Release seems to be indeed 11v3,
    [root@:/root]# uname -a
    HP-UX B.11.31 U ia64 2566039091 unlimited-user license
    I'll check the installation of the  patch and keep you informed
    Thank you
    Raoul
    Edited by: Raoul Shiro on Aug 11, 2010 11:57 AM

  • How to read appended objects from file with ObjectInputStream?

    Hi to everyone. I'm new to Java so my question may look really stupid to most of you but I couldn't fined a solution by myself... I wanted to make an application, something like address book that is storing information about different people. So I decided to make a class that will hold the information for each person (for example: nickname, name, e-mail, web address and so on), then using the ObjectOutputStream the information will be save to a file. If I want to add a new record for a new person I'll simply append it to the already existing file. So far so good but soon I discovered that I can not read the appended objects using ObjectInputStream.
    What I mean is that if I create new file and then in one session save several objects to it using ObjectOutputStream they all will be read with no problem by ObjectInputStream. But after that if in a new session I append new objects they won't be read. The ObjectInputStream will read the objects from the first session after that IOException will be generated and the reading will stop just before the appended objects from the second session.
    The following is just a simple test it's not actual code from the program I was talking about. Instead of objects containing different kind of information I'm using only strings here. To use the program use as arguments in the console "w" to create new file followed by the file name and the strings you want save to the file (as objects). Example: "+w TestFile.obj Thats Just A Test+". Then to read it use "r" (for reading), followed by the file name. Example "+r TestFile.obj+". As a result you'll see that all the strings that are saved in the file can be successfully read back. Then do the same: "+w TestFile.obj Thats Second Test+" and then read again "+r TestFile.obj+". What will happen is that the strings only from the first sessions will be read and the ones from the second session will not.
    I am sorry for making this that long but I couldn't explain it more simple. If someone can give me a solution I'll be happy to hear it! ^.^ I'll also be glad if someone propose different approach of the problem! Here is the code:
    import java.io.*;
    class Fio
         public static void main(String[] args)
              try
                   if (args[0].equals("w"))
                        FileOutputStream fos = new FileOutputStream(args[1], true);
                        ObjectOutputStream oos = new ObjectOutputStream(fos);
                        for (int i = 2; i < args.length ; i++)
                             oos.writeObject(args);
                        fos.close();
                   else if (args[0].equals("r"))
                        FileInputStream fis = new FileInputStream(args[1]);
                        ObjectInputStream ois = new ObjectInputStream(fis);
                        for (int i = 0; i < fis.available(); i++)
                             System.out.println((String)ois.readObject());
                        fis.close();
                   else
                        System.out.println("Wrong args!");
              catch (IndexOutOfBoundsException exc)
                   System.out.println("You must use \"w\" or \"r\" followed by the file name as args!");
              catch (IOException exc)
                   System.out.println("I/O exception appeard!");
              catch (ClassNotFoundException exc)
                   System.out.println("Can not find the needed class");

    How to read appended objects from file with ObjectInputStream? The short answer is you can't.
    The long answer is you can if you put some work into it. The general outline would be to create a file with a format that will allow the storage of multiple streams within it. If you use a RandomAccessFile, you can create a header containing the length. If you use streams, you'll have to use a block protocol. The reason for this is that I don't think ObjectInputStream is guaranteed to read the same number of bytes ObjectOutputStream writes to it (e.g., it could skip ending padding or such).
    Next, you'll need to create an object that can return more InputStream objects, one per stream written to the file.
    Not trivial, but that's how you'd do it.

  • I can't read a Object from file, Please help me

    i want to write a Object into File. this is code of Object
    class objStoreCus implements Comparable, Serializable
    String customerID = new String();
    String customerName = new String();
    String customerEmail = new String();
    objStoreCus(String cusID, String cusName, String cusEmail)
    customerID = cusID;
    customerName = cusName;
    customerEmail = cusEmail;
    objStoreCus(){}
    public int compareTo(Object o)
    objStoreCus oS = new objStoreCus();
    oS = (objStoreCus)o;
    return(customerEmail.compareTo(oS.customerEmail));
    private void writeObject(ObjectOutputStream s) throws IOException {
    s.defaultWriteObject();
    private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
    try
    s.defaultReadObject();
    }catch(IOException ie){throw new IOException();}
    catch(ClassNotFoundException cnt){throw new ClassNotFoundException();}
    And I was wrote above Object into File by this code :+
    FileOutputStream fos;
    ObjectOutputStream oos;
    FileInputStream fis;
    ObjectInputStream ois;
    public void writeObjToFile(objStoreCus obj)
    try
    fos = new FileOutputStream("Exrcise3.ex3", true);
    }catch(FileNotFoundException fnfe){}
    try
    oos = new ObjectOutputStream(fos);
    //ghi doi tuong vao file
    oos.writeObject(obj);
    //dong stream
    oos.close();
    fos.close();
    }catch(IOException ie){}
    But i can't read above Object from file. allway have a Exception occur "StreamCorruptedException".
    this is code read Object form file :
    *parameter is ArrayList will be store Object from file.
    public void readObjFromFile(ArrayList al)
    try
    fis = new FileInputStream("Exrcise3.ex3");
    }catch(FileNotFoundException fnfe){}
    try
    ois = new ObjectInputStream(fis);
    while(true)
    try
    objStoreCus osc = new objStoreCus();
    osc = (objStoreCus)ois.readObject();
    System.out.println(osc.customerEmail);
    }catch(Exception e)
    e.printStackTrace();
    //System.out.println();
    break;
    ois.close();
    fis.close();
    }catch(IOException ie){}
    }

    Problem lies in
    os = new FileOutputStream("Exrcise3.ex3", true);
    You are trying to append to that file, You should always use new file to serialize objects.
    os = new FileOutputStream("Exrcise3.ex3");
    Try with above line.

  • Why can't I load plugins from file system ?

    Hello.
    Why can't I load plugins from file system, fore development sake for ex. ?
    Thx.
    Andrew.

    For security reasons, the Flash Player doesn't allow applications to access both the file system and the network.
    One workaround is to compile the plugins in statically (rather than load them dynamically).  The Akamai Plugin Sample shows you how to load plugins either way, you can see the source here: http://opensource.adobe.com/svn/opensource/osmf/trunk/apps/samples/plugins/AkamaiPluginSam ple/.

  • Can I dynamically load html from file, but do not stuck the UI

    I load my html from files.
    Use JEditorPane to setContentType("text/html"),
    use JEditorPane.read method to dynamically load html from file,
    the jeditorpane is add into a jdialog,
    when my application showing the dialog, the dialog was stuck,
    user can not click other UI component, I think it is not look dynamically
    So any other suggestion?
    You are appreciated.
    Thanks in advanced.

       yourDialog.setModal(false);

Maybe you are looking for

  • Wireless keyboard discoverable but will not type code to pair with iPad Mini

    The iPad Mini recognizes there is a wireless keyboard nearby and presents the code. When I type the code on the keyboard, nothing happens. Light is flashing too. If anyone has resolved this issue, what are the steps?

  • PR PO attachments

    Gurus, Attaching files to PR/PO is a standard functionality, but attachments from PR are not flowing into the PO. The document attached to the PR is not flowing to the PO. Is there some config that needs to be done to achieve this. Help will be great

  • FPM Search UIBB

    Can someone tell me how to make the search case-insensitive. I used the method cl_fpm_guibb_search_conversion=>to_abap_select_where_tab to create the Where clause for my SQL Is there any standard way to make it case insensitive. I would have used Nat

  • Ejb-jar.xml DOCTYPE

    Hi, When I deploy my application, Weblogic 6.1 validates the ejb-jar.xml against the public DTD http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd. In the production system, there will be no public internet access from the Weblogic server. How do I disabl

  • Dialog borderless and image, bug

    Adobe Photoshop CC, Windows 7 x64 Code: var w = new Window ("dialog", "", undefined, {borderless: true}); w.margins = [0, 0, 0, 0]; var all = new File(File($.fileName).path + "/photo.png"); var tt = w.add("image", undefined, all); var b = w.add ("but