cnesbit Posted August 2, 2011 Share Posted August 2, 2011 I've got a report that uses a scriptlet I wrote to run several functions. non of them seem to work all of a sudden. here's an example of one I call from the report, it takes a string in 1 date format and returns the same date in a different format. Error evaluating expression $P{REPORT_SCRIPTLET}.format_date( $F{lunchdate} ) It does work, in ireport, and it does work from the command line when I call it like a normal class file. But it does not work when I deploy it in a *.war file.here's the line in my webapp's code that it "dies" on, though this has never broken before: JasperRunManager.runReportToPdfFile(reportFile.getPath(), rptOutputName, parameters, conn);here's the actual stacktrace: SEVERE: Servlet.service() for servlet pdf threw exception net.sf.jasperreports.engine.JRRuntimeException: Error loading report v2/lunch_orders_monthly. Please contact your school administrator if this error persists. ERROR: Error evaluating expression : Source text : $P{REPORT_SCRIPTLET}.format_date( $F{lunchdate} ) at servlets.pdf.service(pdf.java:145) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:679) Any help would be appreciated. This problem could prevent me from meeting a deadline for a customer at the end of the week.-cnesbit Link to comment Share on other sites More sharing options...
dtiwan Posted August 2, 2011 Share Posted August 2, 2011 Sorry dude, but it looks like a application specific issue. You said "all of a sudden", does that mean it use to work? If yes, what changed? Looks like you have missing code in your application or older jar or class sitting in web-app. I would compare it against a version control. Link to comment Share on other sites More sharing options...
cnesbit Posted August 2, 2011 Author Share Posted August 2, 2011 dtiwanWrote: Sorry dude, but it looks like a application specific issue. You said "all of a sudden", does that mean it use to work? If yes, what changed? Looks like you have missing code in your application or older jar or class sitting in web-app. I would compare it against a version control. yes, it used to work. Changes are mainly related to adding additional *.jar files to my project, which I needed for some of the code I was adding. You say, it looks like an application specific issue, and I was thinking the same thing. I guess my question is this:When you're adding a scriptlet to a report and it works in ireport, on the commandline, but not in the web-app what sort of specific things do I need to look for to fix this inconsistancy? I've been at this for a few days now, and maybe I'm just overlooking something unknowingly.This project is one of my first, in the area of Java and web-apps. So keep that in mind when you're about to leave out "something obvious". :) Thanks!cnesbit Post Edited by cnesbit at 08/02/2011 17:16Post Edited by cnesbit at 08/02/2011 17:16 Link to comment Share on other sites More sharing options...
cnesbit Posted August 2, 2011 Author Share Posted August 2, 2011 [FIXED]: I'm not sure what code went "missing", but apparently there was something lying around in my war file that shouldn't've been (or was missing, and shoulda been there). When I added the "clean" step to the beginning of my ant build script, my reports magically started working again. Now, after effectively wasting 2 days, I know why I don't make a habit of programming in Java. It's so picky, it's not enough to write flawless code and have a flawless build script, you also have to "start over" everytime you recompile. 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