jeenajeena Posted March 22, 2008 Share Posted March 22, 2008 I wrote this class public class MyUtil { public static int getLastDayOfMonthXXX() { return 10; } public static int getLastDayOfMonth() { return 10; } } I compiled it and added it's directory to classpath, throu iReport. If I use this expression in a field new Integer(MyUtil.getLastDayOfMonth()) everything is OK. But if I use new Integer(MyUtil.getLastDayOfMonthXXX()) I obtain the error: Error filling print...Error evaluating expression : source text : new Integer(MyUtil.getLastDayOfMonthXXX())java.lang.NoSuchMethodError : MyUtil.getLastDayOfMonthXXX()I Why?What I'm trying to do is define a bunch of static methods to be used in fields' expressions. May be I'm using the wrong approach.. Any help will be very appreciated Link to comment Share on other sites More sharing options...
lucianc Posted March 24, 2008 Share Posted March 24, 2008 Are you sure the compiled class contains the getLastDayOfMonthXXX() method? If so, try to restart iReport, maybe it caches classloaders (I'm not an iReport expert, you might want to try posting on the iReport forum). Regards,Lucian Link to comment Share on other sites More sharing options...
jeenajeena Posted March 25, 2008 Author Share Posted March 25, 2008 You were right: everytime I change my Java code I have to restart iReport. It's a bit annoying but it works. Thank you! 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