Jump to content
We've recently updated our Privacy Statement, available here ×

JasperReport


jiwlee.gatech
Go to solution Solved by jiwlee.gatech,

Recommended Posts

Hi, I'm getting this error. The weird thing is I don't get this error when I run it on intellij on my local environment but not when I run it in a remote environment.

Please help me!

java.lang.NullPointerException: null

at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller (JRFiller.java:196)

at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:82)

at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:456)

at net.sf.jasperreports.engine.JasperFillManager.fillReport (JasperFillManager.java:863)

Thanks!

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Dear Sir,

Regarding to the error above:

Thats right when calling the report from iReport ide nothings goes wrong, but when calling it from your application like(ADF application, Java Desktop Application) this error appears and the caus is:

When calling .jasper report from java application you should use (Jasper FillManager) as below:

 

JasperPrint print = JasperFillManager.fillReport(template, param, conn);

 

this line of code is responsible for filling the report.

 

Thanks,

Ghassan Nafash.

 

Link to comment
Share on other sites

I believe you misunderstood the problem.  I do not use the iReport IDE.

I use Intellij and run my code.

The difference between when it works is not whether it's code or not but it depends on which environment I am running it on.

If I run it in my local environment and use intellij, which I used to write my code, to run it. It works fine. No errors.

However, when I use a unix box to run my application through a shell script, it doesn't work and gives me a null pointer exception.

The following is part of my code:

jp = JasperFillManager.fillReport(compiledReport, new HashMap<>(), con);[/code]
Link to comment
Share on other sites

Hi,

The thing that is caused by is exactly the same:

Caused by: java.lang.NullPointerException: null

at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller (JRFiller.java:196)

at net.sf.jasperreports.engine.fill.JRFiller.fill (JRFiller.java:82)

at net.sf.jasperreports.engine.JasperFillManager.fill (JasperFillManager.java: 456)

at net.sf.jasperreports.engine.JasperFillManager.fillReport (JasperFillManager.java: 863)

at FilledReport.fillReport (FilledReport.java:100)

 

The last line is my code, which is the following line:

jp = JasperFillManager.fillReport(compiledReport, new HashMap<>(), con);[/code]

 

In the remote environment, I am trying to use as less jars as possible and do not have certain jars that jasperreports included in it's pom.xml like common-beanuitls etc. Would that ever cause this kind of an issue? 

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