Jump to content
Changes to the Jaspersoft community edition download ×

unexplainable Prob in JasperFillManager.fillReport


bentins

Recommended Posts

I have a jsf application. The user can press a button which opens up a dialog screen. I intercept the call with a phase listener, invoke a jasper report and send the report into the servlet output stream.

 

This works on my Development environment (which is JDeveloper, running on the embedded oc4j). When I deploy this application to production the same thing simply does not work!!!

 

After long hours I'm able to say that my problem is in the line

Code:

jasperPrint = JasperFillManager.fillReport(report, parameters, conn);

 

Since I cannot run in remote debug on production and this does not happen on test I could only use sysouts.

The sysout before this line prints, the sysout after it does not. I catch every possible exception but none are thrown!! This method simply does not return. I checked all the parameters and they were fine. I'm looking for suggestions on what can be causing this.

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Try checking the timing of the report query against your production database. If that checks out, then is their a lot of data you may need to virtualize the report generation (memory). Is it possible to connect your development server to the production database and execute the report? (Apples to Apples???)
Link to comment
Share on other sites

Thanks, I was able to do that but got the same result.

 

I now have some more information I was able to find in the log. It seems I get a SocketTimeOut here is the error:

 

Code:
RMIServer.logError RMIServer acceptNewConnection() exception: java.net.SocketTimeoutException: Accept timed out

 

Has anyone experience such a thing with OC4J?

 

I'm now thinking this has to do with a Firewall (That's a difference between dev environment and production). The only thing I don't understand is why I have this problem. I get the connection from the DataSource I received from JNDI. Apart from that there is nothing else, just a query with some params and the report. Why would it requier a socket Connection? and if it does, why does it differ then any other RMI call I use on the application?

Link to comment
Share on other sites

  • 4 months later...

We might have the same problem. In JDeveloper, the report may run for a very long time but we are able to view the report. The problem with the production server is the time out. We have a two minute window to get the response back or it will time out. This problem is our biggest hurdle right now.

 

Using the iReport, I can see that JasperFillManager.fillReport takes up the majority of time to create the report. For 6 minutes to create a 4,000 pages report, 5 minutes were spent on filling. I am sure it is not the database query or the complexity of the report that is causing the slowness. I get the same result when I tested a report that used only one database table without any formatting at all. No grouping. No order by. Just 10 fields, tabular. I even removed the date and the page x of x that was automatically generated by the wizard.

 

Who would use or read a 4,000 or 18,000+ pages report? It is not up to me to decide. Our users requires that it needs to be done, plus the system that we are modernizing can handle this requirement.

 

I hate to go away from real time processing but if there is no solution to the JasperFillManager.fillReport performance then we will be forced to go back in the old days and generate the reports at night and view it the next day.

 

Virtualizer does not fix this problem. Any suggestions on how to trick the web server so it does not time out?

Link to comment
Share on other sites

I don't think we have the same problem because our problem turned out to be duplicate classes in two different jasper jars that were included in the server classpath and not in JDeveloper.

As for your problem. You say it takes a long time independent of where you run it, but in JDeveloper there is no timeout.

 

One suggestion I have is to create a PDF file on the server and used ajax to retrieve it once it was ready. For the user it would seem as if he got the document upon request (although he does have to wait (you can even show a progress bar or something)

Link to comment
Share on other sites

Your suggestion is definitely the solution that I am looking for. From the time I got your post, I been reading on ajax but unfortunately I have not progress any further to make it work. I'm a novice java programmer.

 

Do you have any simple sample that you can share? It doesn't need to have a progress bar although it would be nice to have one. We are using JSPs. Thanks for all your help.

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...