jkratz Posted September 24, 2008 Share Posted September 24, 2008 On Windows I'm getting the follow stack trace when trying to load a compiled .jasper file (happens with any report...even very simple ones) java.lang.NullPointerException at net.sf.jasperreports.engine.JRPropertiesMap.readObject(JRPropertiesMap.java:185) 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:585) Truncated. see log file for complete stacktrace I've seen this before when trying to load a compiled version of a report on a different version of JasperReports but in this case the library i'm using on Weblogic is jasperreports-3.0.1-javaflow.jar and the report was written/comiled with iReport 3.0.0. I have not set older compatibility, etc.The report actually runs fine in iReport as well. It also runs fine in the web environment when run on Linux or Mac OS X. I am having the issue on Windows XP and Vista. Java 1.5.0_16 running both the app server and iReport. I do not have any older versions of Jasper on my system .... everything is version 3. Doesn't make a difference whether I'm exporting to HTML, PDF, whatever. It simply can't load the compiled report.I've almost lost all my hair due to tearing it out over not being able to get around this NPE. I'm hoping someone here has an idea of what is going on.I've tried searching the bug tracker but, quite frankly, that tracker doesnt work worth a damn and I couldn't find anything. Why an open source java project isn't using JIRA is beyond me but thats another post.Thanks,Jason Link to comment Share on other sites More sharing options...
lucianc Posted September 25, 2008 Share Posted September 25, 2008 Are you sure you don't have an older JR version on your application's classpath?Because the stacktrace you posted does not correspond to JR 3.0.1 sources - in JR 3.0.1 JRPropertiesMap.java:185 does not fall in the readObject method.You can check the JR version at runtime by doing something likeSystem.out.println(JRPropertiesMap.class.getPackage().getImplementationVersion());somewhere in your code.You can also do something likeSystem.out.println(JRPropertiesMap.class.getResource("/net/sf/jasperreports/engine/JRPropertiesMap.class"));to find out where the JRPropertiesMap class is loaded from.Regards,Lucian Link to comment Share on other sites More sharing options...
jkratz Posted September 25, 2008 Author Share Posted September 25, 2008 Thanks Lucian. I'll give that a try. Pretty sure there arent older copies anywhere since I deleted even the copy of jasper 2.x that I had in a download directory :) But none of this makes sense so I'll follow your suggestion and see if somehow I missed something. Thanks,Jason Link to comment Share on other sites More sharing options...
jkratz Posted September 26, 2008 Author Share Posted September 26, 2008 Lucian-You were right :) Somehow an old copy made its way into the deployment dir in a cache location and the system was loading stuff from there. Very odd but thanks a lot! I'll stop losing my hair now :)Jason Link to comment Share on other sites More sharing options...
jkratz Posted September 26, 2008 Author Share Posted September 26, 2008 OK. This is really odd and I'm posting this just in case someone might find themselves in the same situation with the same software. I'm running MyEclipse 6.5 with Weblogic 9.2 on Windows XP. We have been using JasperReports 3.0 for several releases of one of our web applications. I started with Jasper 2.0.5.Weblogic, when it runs, keeps a cache of items in your domain directory in a location similar to:C:optbeauser_projectsdomainsf58_domainserversAdminServertmp_WL_user_appsdir_rocketscienceApp_dirr6vnzfAPP-INFlibFor some reason all 4 versions of the JasperReports library are in there when we only deploy one version to APP-INF/lib. The odd thing is that its not even the javaflow version we switched to when we moved to version 3 of the library. We now have versions 2.0.5, 3.0 (javaflow), 3.0.1 (javaflow), 3.1.0 (javaflow). (I had tried 3.1.0 in desperation).So not only did Lucian solve my problem but I also learned something new about the Class class and how to find out where resources are loading from. Link to comment Share on other sites More sharing options...
dnvsrikanth Posted June 2, 2009 Share Posted June 2, 2009 Hi I am also facing the same problem. When I use the newer version of iReport(3.5.1) to generate the report i am getting this exception. But when I use the older version of iReport(2.0.5) to generate the report I am not getting this exception. Is this a bug in iReport or JasperReport? The following is the exception I am getting when I use iReport 3.5.1 I am in the urgent need of the fix for this issue. Any help in this regard will be appreciated. DNV Srikanth Code: Post Edited by dnvsrikanth at 06/02/2009 11:11Post Edited by dnvsrikanth at 06/02/2009 11:29 Link to comment Share on other sites More sharing options...
dnvsrikanth Posted June 3, 2009 Share Posted June 3, 2009 any idea about this issue..... Post Edited by dnvsrikanth at 06/03/2009 12:25 Link to comment Share on other sites More sharing options...
Teodor Danciu Posted June 3, 2009 Share Posted June 3, 2009 Hi, If you have the same problem, why is that the solution that was provided does not work for you?As you can see from the discussion above, it worked for Jason.I think you just need to try harder. Thank you,Teodor Link to comment Share on other sites More sharing options...
jagankoka Posted December 16, 2010 Share Posted December 16, 2010 Hi I have done that what u told to see the version it is showing 2.0.5 but now i am using 3.0.0 what to do do change the version Link to comment Share on other sites More sharing options...
jagankoka Posted December 16, 2010 Share Posted December 16, 2010 please reply me its very urgent please Link to comment Share on other sites More sharing options...
lpeel Posted August 18, 2011 Share Posted August 18, 2011 Old post but still very helpful. It was working on Windows under SpringSource toolkit but when i went to deploy it on Linux Fedora, it failed with the same error. In my case, it was picking up an old jasper 2.x jar that came with SpringSource. Getting rid of that old jar fixed the problem. I had to add a few other Apache jar dependencies as documented under Maven, but that was trivial. SpringSource had been able to resolve those dependencies under Windows. 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