jiwlee.gatech Posted July 10, 2017 Share Posted July 10, 2017 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: nullat 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 More sharing options...
hozawa Posted July 11, 2017 Share Posted July 11, 2017 There should be a caused by clause a little bit further down in the log. The problem seems to be that some element is null. Link to comment Share on other sites More sharing options...
Ghassan1993 Posted July 11, 2017 Share Posted July 11, 2017 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 More sharing options...
jiwlee.gatech Posted July 11, 2017 Author Share Posted July 11, 2017 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 More sharing options...
jiwlee.gatech Posted July 11, 2017 Author Share Posted July 11, 2017 Hi,The thing that is caused by is exactly the same:Caused by: java.lang.NullPointerException: nullat 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 More sharing options...
Solution jiwlee.gatech Posted July 11, 2017 Author Solution Share Posted July 11, 2017 I realized the problem was with compiling and unix not being able to do javac. The problem is resolved. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now