Problem in debuging jasper reports and ADF

Hi
I am using JDeveloper 11.1.2.2.0. Inside I created Fusion Web Application ADF, and on the index page created Go button. Now I created Servlet with doGet methode and conncected it to Go button. It is working OK.
Now I want to run simple jasper report from servlet. Jasper report is based on empty dataset. Here is servlet code:
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
ServletOutputStream servletOutputStream =response.getOutputStream();
InputStream reportStream = getServletConfig().getServletContext()
.getResourceAsStream("C:/Users/myDomain/Desktop/Reporting/ReportPDFPrazan.jasper");
try
JasperRunManager.runReportToPdfStream(reportStream,servletOutputStream,null, new JREmptyDataSource());
response.setContentType(CONTENT_TYPE);
servletOutputStream.flush();
servletOutputStream.close();
catch (JRException e)
// display stack trace in the browser
StringWriter stringWriter = new StringWriter();
PrintWriter printWriter = new PrintWriter(stringWriter);
e.printStackTrace(printWriter);
response.setContentType("text/plain");
response.getOutputStream().print(stringWriter.toString());
When I hit Go button here what I get:
java.lang.NullPointerException
     at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2265)
     at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2278)
     at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2749)
     at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:779)
     at java.io.ObjectInputStream.(ObjectInputStream.java:279)
     at net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream.(ContextClassLoaderObjectInputStream.java:53)
     at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:214)
     at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:632)
     at net.sf.jasperreports.engine.JasperRunManager.runToPdfStream(JasperRunManager.java:428)
     at net.sf.jasperreports.engine.JasperRunManager.runReportToPdfStream(JasperRunManager.java:849)
     at view.com.lanaco.servlets.PrviServlet.doGet(PrviServlet.java:35)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
and so on(I can put whole stack if necery)
I also imported this libraries inside ViewControl project:
     Jasperreports-4.7.1.jar
     Commons-beanutils-1.8.0.jar
     Commons-collections-2.1.1.jar
     Commons-digester-2.1.jar
     Commons-logging-1.1.1.jar
     IText-2.1.7.jar
     Groovy-all-1.7.5.jar
     Poi-3.7-20101029.jar
Can someone help me with debuging. Please
Edited by: MarcusO on 2012.10.23 05:18

I found solution. It should be used like this:
InputStream reportStream = new FileInputStream(new File("C:/Users/myDomain/Desktop/Reporting/ReportPDFPrazan.jasper"));
So problem was in input stream. It works fine now.

Similar Messages

  • Jasper Reports and ADF: JRDataSource question

    Hi all,
    I am stuck with a problem creating a dynamic report with jasper. I want to use data from a VO or binding, not via a select in my report. Here is were i am at right now:
    BindingContainer bc = this.getBindings();
    DCIteratorBinding iterBinding = (DCIteratorBinding) bc.get("VO1Iterator");
    RowSetIterator iter = iterBinding.getRowSetIterator();
    Row[] matrix = new Row[iter.getRangeSize()];
    int i=0;
    while(iter.hasNext())
    matrix[i] = iter.next();
    //output to my msg facet:
    fc.addMessage(null, new FacesMessage("Hour FROM: " + matrix.getAttribute("HourFrom") + " TO: " + matrix[i].getAttribute("HourTo") + " FACTOR: " + matrix[i].getAttribute("Factor")));
    i++;
    iter.closeRowSetIterator();
    JRDataSource myDS = new JRBeanArrayDataSource(matrix);
    In my report i am using $F{HourFrom} to access my values, but i keep getting:
    Jasper Error:Error retrieving field value from bean : HourFrom
    I'm using Jdev 10.1.3 with oracle 10g .
    I understand that i'm not accessing the JRDataSource correctly. Hopefully someone can point me in the right direction.
    Regards,
    Arnaud

    Hi all,
    I am stuck with a problem creating a dynamic report with jasper. I want to use data from a VO or binding, not via a select in my report. Here is were i am at right now:
    BindingContainer bc = this.getBindings();
    DCIteratorBinding iterBinding = (DCIteratorBinding) bc.get("VO1Iterator");
    RowSetIterator iter = iterBinding.getRowSetIterator();
    Row[] matrix = new Row[iter.getRangeSize()];
    int i=0;
    while(iter.hasNext())
    matrix[i] = iter.next();
    //output to my msg facet:
    fc.addMessage(null, new FacesMessage("Hour FROM: " + matrix.getAttribute("HourFrom") + " TO: " + matrix[i].getAttribute("HourTo") + " FACTOR: " + matrix[i].getAttribute("Factor")));
    i++;
    iter.closeRowSetIterator();
    JRDataSource myDS = new JRBeanArrayDataSource(matrix);
    In my report i am using $F{HourFrom} to access my values, but i keep getting:
    Jasper Error:Error retrieving field value from bean : HourFrom
    I'm using Jdev 10.1.3 with oracle 10g .
    I understand that i'm not accessing the JRDataSource correctly. Hopefully someone can point me in the right direction.
    Regards,
    Arnaud

  • What are correct steps of integrating and using jasper report with ADF 11g?

    Hi,
    I am using JDev 11.1.1.2.0 with ADF 11g.
    I want to use jasperreports 3.7.0 along with ADF 11g to build reports in PDF on a button event. This is the first time I will be attempting it so before starting up I went through forum to get exact and clear steps on the jars and integration points of jasper with adf. There is exhaustive list but still it does not have the needed clarity.
    Can anyone help in listing down the jars and integration steps? and also want to know if there are any points in particular that I need to be aware of while running i along with ADF faces.
    Pls note the ver. of jasper and adf mentioned above.
    Thanks in advance.
    Edited by: user8925296 on May 14, 2010 4:06 PM

    Hi,
    Basically, you need to:
    - have all the jars in ViewProject/WEB-INF/lib, and include them to the project (Project properties -> Libraries and Classpath) - last time I did this was with version 3.1.3 and the necessary jars were jasperreports-3.1.3.jar, jcommon-1.0.0.jar and iText-2.1.4.jar (plus poi<+whatever is the latest version+>.jar if you want to generate .XLS reports)
    - call the code for generating reports from your backing bean (button's actionListener)
    - flush the report to the client (directly to HTTPResponse or by using af:fileDownloadListener)
    Those are the general steps, without going into the coding.
    Pedja

  • Image Display Problem while exporting jasper report in EXCEL

    Hi
    I am using Jasper reports for my reporting work using java code.
    when i export my report in PDF then , report is ok and displaying Image properly.
    but when i export my report in EXCEL then , there is no image in my report, rest part is fine.
    Can anyone please help me in getting image in excel format also.
    thanks in advance
    Praveen

    I have not any problem in picture or logo.
    But I have an another problem.
    My Excel format produce multiple column,that is unefficient format.
    If you have not this problem please mail me at --- [email protected]

  • Jasper reports and bpel?

    Is it possible (somehow) to generate pdf document using jasper reports (or any other framework for that matter) from bpel process?
    Can anybody guide me to any tutorial or something that adresses this kind of "problem"?
    I'm quite a newbie in Oracle BPEL and SOA. Maybe there is already some mechanism for doing this?
    Thanks in advance :)

    I want to generate pdf file based on xml based result from bpel process and save that file to a file system.
    Creating web service for that purpose is, in my opinion, quite elegant solution. I'll go with that for now since I know web service and jasper reports technologies.

  • Problem in using Jasper Reports with JFrames

    Hi,
    I am using Jasper Reports in Swings.
    I could Generate Jasper Reports from JFrames with out any problem,
    but while closing the Report, the JFrame is also getting closed automatically.
    this should not happen for my application.
    So, how could i restrict the JFrame from exiting when Jasper Reports are closed.
    Thanx in advance.
    Reddy

    Create jasperviewer object as JasperViewer jasperViewer = new JasperViewer(jasperPrint, false);

  • COMMIT problem in TopLink, Struts, JSP and ADF Databinding sample

    In the sample Developing a J2EE Application using TopLink, Struts, JSP and ADF Databinding,
    I followed all the steps to build a department browse page and a edit page.
    But when I get to Step number 23 in "Create a JSP to Edit Departments" I have a problem with the commit.
    Only after I make a change in the form and click the sumbit button, the commit and rollback buttons become active. And After I click the commit button the data gets commited to the database but the page inofmation changes to the very first department record, not the current one.
    How do I make those buttons active with out the extra click on the submit?
    After I click the commit button, how do I keep the current data on the screen?
    Thanks for you help.

    Shay,
    Thanks for the reply.
    For #1, I was able to do the following and get away with not having to press submit first. I just removed the bindings for disable. I hope that does not cause any problems?
    <input type="submit" name="event_Commit" value="Commit" />
    <input type="submit" name="event_Rollback" value="Rollback" />
    For #2, How I add an action on an HTML button? My UIModel.xml for the edit department page currently has two actions on it. Commit and RollBack. Is it linked through the "name" attribute of the input tag?

  • Jasper report and image

    Hi,
    I use jasper report with an XML datasource. I have an image in the xml stream encode as a string with a class name Base64.
    I want to display the image in my report but I dont know how to do this. Does someone know something about this ?
    Help, please.
    Thanks.
    Guillaume.

    use iReport to edit you reports
    and insert images..
    ireport link .
    http://ireport.sourceforge.net/
    it's simple to add new images

  • How to generate jasper report and how to integrate jasper report in ADF11g

    Hi All,
    I want to generate jasper report in ADF11g Jdeveloper.and how to integrate jasper report in adf11g.give any link and simple example of jasper report with adf11g.then please help me and send example.
    Thanks&Regards
    Anup

    Ha, that's incredibly useful :-) Of course every response can be simplified to: http://lmgtfy.com/?q=let+me+google+that+for+you
    CM.

  • Jasper reports and web sphere

    how can i plugin the jasper reports into IBM websphere 5
    please help

    how can i plugin the jasper reports into IBM websphere 5
    please help

  • Long running threads (Jasper Reports) and AM-Pooling

    Hi,
    we are developing quite large application with ADF an BC. We have quite a lot of reports generated through Jasper that take quite long time to complete. The result is a PDF document that user gets on the UI so he can download it over download link. Reports that take over an hour to finish are never completed and returned to the user on UI. I think the problem is in AM-Polling because we are using default AM-Polling settings:
    <AM-Pooling jbo.ampool.maxinactiveage="600000" jbo.ampool.monitorsleepinterval="600000" jbo.ampool.timetolive="3600000"/>
    The AM is destroyed or returned to pool before reports finishes. How to properly configure those settings that even long running threads will do there jobs to the end.
    We also modified web.xml as follows:
      <session-config>
        <session-timeout>300</session-timeout>
      </session-config>
    Any help appreciated.
    Regards, Tadej

    Your problem is not related to ADF ApplicationModules. AMs are returned to the pool no earlier than the end of request, so for sure they are not destroyed by the framework while the report is running. The AM timeout settings you are referring to are applicable only to idle AMs in the pool but not to AMs that have been checked out and used by some active request.
    If you are using MS Internet Explorer, then most probably your problem is related to the IE's ReceiveTimeout setting, which defines a timeout for receiving a response from the server. I have had such problems with long running requests (involving DB processing running for more than 1 hour) and solved my problem by increasing this timeout. By default this timeout is as follows:
    IE4 - 5 minutes
    IE5, 6, 7, 8 - 60 minutes
    I cannot find what the default value is for IE9 and IE10, but some people claim it is only 10 seconds, although this information does not sound reasonable and reliable! Anyway, the real value is hardly greater than 60 minutes.
    You should increase the ReceiveTimeout registry value to an appropriate value (greater than the time necessary for your report to complete). Follow the instructions of MS Support here:
    Internet Explorer error &quot;connection timed out&quot; when server does not respond
    I have searched Internet for similar timeout settings for Google Chrome and Mozilla Firefox, but I have not found anything, so I instructed my customers (who execute long-running DB processing) to configure and use IE for these requests.
    Dimitar

  • Problem in developing jasper report in BEA workspace studio version 1.1 with weblogic server 10.0

    Hi! all,
    Myself developing a jasperReport in BEA workspace studio 1.1 and always getting the below mentioned exception, though i have run the same code in NetBeans successfully with the same jar file.
    Even i have added weblogic.jar, wllog4j.jar, classes12.jar, commons-beanutils-1.8.0.jar, commons-collections-2.1.1.jar, commons-digester-1.7.jar, commons-javaflow-20060411.jar, commons-logging-1.0.4.jar, iText-2.1.7.jar, jasperreports-3.7.1.jar, jasperreports.jar, jasper-jdt-6.0.13.jar, jasper-compiler-jdt.jar, jasper-compiler.jar, jasper-runtime.jar, jasperreports-3.5.1.jar, jasperreports-2.0.5.jar in the WEB-INF/lib directory as well as build path. please help me.Thanks in advance.
    ==============================================================
    Exception in thread "Main Thread" java.lang.NoClassDefFoundError: weblogic/logging/WLLogRecord : weblogic/logging/LogEntry
         at java.lang.ClassLoader.findBootstrapClass(Native Method)
         at java.lang.ClassLoader.findBootstrapClass0(ClassLoader.java:891)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:301)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at weblogic.logging.commons.LogFactoryImpl.getInstance(LogFactoryImpl.java:21)
         at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370)
         at org.apache.commons.digester.Digester.<init>(Digester.java:304)
         at net.sf.jasperreports.engine.xml.JRXmlDigester.<init>(JRXmlDigester.java:62)
         at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createDigester(JRXmlDigesterFactory.java:980)
         at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:203)
         at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:168)
         at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:152)
         at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:150)
         at com.generateJasperReport.test.GasperReportNew.main(GasperReportNew.java:38)
    ==============================================================================
    My Code is..........................
    ============================
    package com.generateJasperReport.test;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.util.HashMap;
    import java.util.Map;
    //import weblogic.logging.LogEntry;
    import net.sf.jasperreports.engine.JRException;
    import net.sf.jasperreports.engine.JRResultSetDataSource;
    import net.sf.jasperreports.engine.JasperCompileManager;
    import net.sf.jasperreports.engine.JasperExportManager;
    import net.sf.jasperreports.engine.JasperFillManager;
    import net.sf.jasperreports.engine.JasperPrint;
    import net.sf.jasperreports.engine.JasperReport;
    import net.sf.jasperreports.view.JasperViewer;
    public class GenerateJasperReport {
         static JRResultSetDataSource jrds = null;
         static ResultSet rs = null;
         public static Connection connectDB() {
              Connection jdbcConnection = null;
              try {
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                   jdbcConnection = DriverManager.getConnection(
                             "jdbc:oracle:thin:@192.161.5.35:1521:abc",
                             "xyz", "pqr");
              } catch (Exception ex) {
                   String connectMsg = "Could not connect to the database: "
                             + ex.getMessage() + " " + ex.getLocalizedMessage();
                   System.out.println(connectMsg);
              return jdbcConnection;
         public static void main(String[] args) throws JRException {
              Connection con = connectDB();
              JasperReport jasperReport=null;
              System.out.println("666666666666666666");
              String reportSource = "E:\\Pintu\\Project\\Bea Project\\workspace\\GenerateJasperReport\\src\\com\\generateJasperReport\\jrxmlFile\\JasperReportGeneration.jrxml";
              String reportDest = "E:\\Pintu\\Project\\Bea Project\\workspace\\GenerateJasperReport\\src\\com\\generateJasperReport\\output\\JasperReportGeneration.pdf";
              System.out.println("555555555555555");
              Map <String,String>parammap = new HashMap<String,String>();
              parammap.put("ReportTitle", "PDF JasperReport");
              System.out.println("444444444444444");
              try {
                   try{
                        jasperReport = JasperCompileManager
                             .compileReport(reportSource);
                   }catch(JRException e){e.printStackTrace();}
                   System.out.println("ssssssssssssss");
                   JasperPrint jasperPrint = JasperFillManager.fillReport(
                             jasperReport, parammap, con);
                   System.out.println("vvvvvvvvvvvvvvv");
                   JasperExportManager.exportReportToPdfFile(jasperPrint, reportDest);
                   System.out.println("kkkkkkkkkkkkkkkkkkk");
                   JasperViewer.viewReport(jasperPrint);
                   System.out.println("gfrfrrrertfewrw");
              } catch (Exception ex) {
                   ex.printStackTrace();
    ===========================================================

    Thanks for the information. It makes so much more sense to do the configuration from within PFR instead of WLS but the engineer insisted I could just do everything from within the WLS config wizard. I'm very relieved that someone has had success with this.
    Am I supposed to do the configuration wizard in WLS before doing the Configure Classic Interface from PFR?
    Since we're only going to be using the PC for the developer, I wasn't sure how much of the Web Logic Server needed to be configured.
    The Oracle engineer said to choose 'Oracle Ent. Mgr' and 'Oracle Classic 11g' from the WLS Config Wizard which I did - but now I have a choice on the 'Optional Configuration' page to choose 'Administration Server', 'Managed Servers', 'Deployments and Services' and 'RDMBS Security Store'. I'm not sure if I'm supposed to choose any of these. I want to be able to talk to the Solaris server that is going to be my application server via WLS and I'm not sure if I need any of these.
    In your environment, are you developing 11g forms on a PC but hosting on another platform? I have a Windows 7 64 bit machine but was told I had to set up a 32bit XP VM on my Win7 machine to use Forms and Reports for development.

  • Problem in filling jasper report with XML Data source

    Hello!
    I am trying to build a report uxing xml data source..Please verify following code:
    String outFileName = "c:/Report1.pdf";
    File xmlFileName = new File("C:/Program Files/JasperSoft/iReport-1.2.5/report.jrxml");
    String recordPath = "/SiteDetails/Site";
    JasperDesign jasperDesign = JRXmlLoader.load(xmlFileName);
    JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
    JRXmlDataSource jrxmlds = new JRXmlDataSource(new File("c:/NewSite.xml"),recordPath);
    HashMap hm = new HashMap();
    try
    JasperPrint print = JasperFillManager.fillReport(jasperReport,hm,jrxmlds);
    JRExporter exporter = new net.sf.jasperreports.engine.export.JRPdfExporter();
    exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,outFileName);
    exporter.setParameter(JRExporterParameter.JASPER_PRINT,print);
    exporter.exportReport();
    catch (JRException jre)
    jre.printStackTrace();
    catch (Exception e)
    e.printStackTrace();
    My Xml file is:
    <?xml version="1.0" encoding="UTF-8"?>
    <SiteDetails>
    <Site>
    <Name>Site1</Name>
    <Addr>Bangalore</Addr>
    <supersiteid>null</supersiteid>
    </Site>
    <Site>
    <Name> Site2</Name>
    <Addr> Madras</Addr>
    <supersiteid>Site1</supersiteid>
    </Site>
    </SiteDetails>
    I want to display details of Siteand Address..My program works fine but displays only 1 (first) record...What should i do to display the full file..do i need to navigate thru the file and give that as an input to fillReport ()method...

    Hi,
    Have a look at below URL.
    http://ireport.sourceforge.net/cap7.html#7.4
    Regards
    VInK

  • Jasper report in Jdev adf

    dear all,
    i'm now trying to integrate jasper report in ADF..
    and i'm try to code this code at bean..but its error..
    public void runOracleReport(ActionEvent actionEvent) {
    JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(PopulateBean.createBeanCollection());
    Map parameters = new HashMap();
    parameters.put("branchval", getBranchId());
    try
    InputStream input = new FileInputStream(new File("C:\\Users\\user\\.ireport\\4.7.0\\config\\Templates\\Report\\GenerateOfferLetter.jrxml"));
    OutputStream os = new FileOutputStream(new File("C:\\Users\\user\\Desktop\\ICEMS\\Report\\offerLetter.pdf"));
    JasperDesign jasperDesign = JRXmlLoader.load(input);
    JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
    JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, conn);
    JasperExportManager.exportReportToPdfStream(jasperPrint, os);
    JasperViewer.viewReport(jasperPrint, false);
    catch (JRException e) {e.printStackTrace();}
    catch (Exception e) {e.printStackTrace();}
    is it any connection code that i have to write..
    Thank you

    thank you very2 much..it helps me al lot..
    2 questions taht i confused:
    1: Is it query at adf must be same at query jasper?
    2: Is it this code is valid code when i want to call more than parameters:
    Map parameters = new HashMap();
    parameters.put("branchval", getBranchId());
    parameters.put("degreeVal", getDegreeId());
    parameters.put("intakeVal", getIntakeId());
    parameters.put("typeOfferVal", getTypeOfferId());
    parameters.put("jasperParamenterName", "ParameterValue"); Used if you want to pass a parameter to a jasper report
    JasperPrint print = JasperFillManager.fillReport(report, parameters, conn);
    Thank you

  • Facing Problem while Debugging a custom report using LDB

    Hi Gurus,
    I have requirement to modify a custom report program related to FI. This program used Logical database ZDF ( Copied original DDF) for data fetching.
    when i am trying to see the data in debugging mode, its not allowing to check in start-of-selection event. only in the initialization & end-of-selection i could able to debug.
    when i put breakpoint in initialization, it is allowing to see the flow till a Get Event occurs in the code, once a Get event occur the debugger is coming out and displaying the report.
    If anybody faced this kind of problem when debugging a report using LDB, please share how you resolved it. If there are any other ways to debug a program of this kind please help me.
    Thanks,
    Nanda

    Hi Amith,
    I checked that way also, i put break point in database program of the copied LDB, but its not allowing to check the flow in that program also.
    Please suggest any other ways.
    Thanks,
    Nanda

Maybe you are looking for