Failure to compile as a java class in Struts

By: Joanne Corless - jocorless
Failure to compile as a java class in Struts
2003-12-10 09:58
Hi,

I've read all the samples and documentation and think I must be a bit thick but I am having trouble getting my ReportManager class to compile reports.

The error I am getting is :

2003-12-10 12:33:20,928 DEBUG [org.apache.tomcat.util.threads.ThreadPool] Getting new thread data
2003-12-10 12:33:36,661 ERROR [STDERR] D:jboss-3.2.2RC4inaudit_trail.java:4: package dori.jasper.engine does not exist
2003-12-10 12:33:36,801 ERROR [STDERR] import dori.jasper.engine.*;
2003-12-10 12:33:36,801 ERROR [STDERR] ^
2003-12-10 12:33:36,811 ERROR [STDERR] D:jboss-3.2.2RC4inaudit_trail.java:5: package dori.jasper.engine.fill does not exist
2003-12-10 12:33:36,811 ERROR [STDERR] import dori.jasper.engine.fill.*;
2003-12-10 12:33:36,811 ERROR [STDERR] ^
2003-12-10 12:33:36,881 ERROR [STDERR] D:jboss-3.2.2RC4inaudit_trail.java:17: cannot resolve symbol
2003-12-10 12:33:36,881 ERROR [STDERR] symbol : class JRCalculator
2003-12-10 12:33:36,881 ERROR [STDERR] location: class audit_trail
2003-12-10 12:33:36,881 ERROR [STDERR] public class audit_trail extends JRCalculator
2003-12-10 12:33:36,881 ERROR [STDERR] ^
2003-12-10 12:33:36,881 ERROR [STDERR] D:jboss-3.2.2RC4inaudit_trail.java:24: cannot resolve symbol
2003-12-10 12:33:36,881 ERROR [STDERR] symbol : class JRFillParameter
2003-12-10 12:33:36,881 ERROR [STDERR] location: class audit_trail
2003-12-10 12:33:36,881 ERROR [STDERR] private JRFillParameter parameter_REPORT_CONNECTION = null;
2003-12-10 12:33:36,881 ERROR [STDERR] ^
2003-12-10 12:33:36,891 ERROR [STDERR] D:jboss-3.2.2RC4inaudit_trail.java:25: cannot resolve symbol
2003-12-10 12:33:36,891 ERROR [STDERR] symbol : class JRFillParameter
2003-12-10 12:33:36,921 ERROR [STDERR] location: class audit_trail
2003-12-10 12:33:36,921 ERROR [STDERR] private JRFillParameter parameter_REPORT_PARAMETERS_MAP = null;
2003-12-10 12:33:36,921 ERROR [STDERR] ^
2003-12-10 12:33:36,921 ERROR [STDERR] D:jboss-3.2.2RC4inaudit_trail.java:26: cannot resolve symbol
2003-12-10 12:33:36,921 ERROR [STDERR] symbol : class JRFillParameter
2003-12-10 12:33:36,921 ERROR [STDERR] location: class audit_trail
2003-12-10 12:33:36,921 ERROR [STDERR] private JRFillParameter parameter_REPORT_DATA_SOURCE = null;
2003-12-10 12:33:36,921 ERROR [STDERR] ^

I simply just don't understand why I should get this problem as the jasper jar is in the WEB-INFlib directory of the webapp as well as being in the lib directory of the server in JBOSS.

The code I am using is :

String pathToFile = getFilePath(reportName);

System.setProperty("jasper.reports.compile.temp", ApplicationProperties.getProperty("compiledReportDir"));
JasperCompileManager.compileReportToFile(pathToFile);

The path to the file is on my local drive as this is similar to how the report xml files are loaded within the production system.

The idea is to allow users to be able to upload, compile and publish reports to other users based on user privileges. This will be run from within a workflow application built on struts. Therefore I need a java class that can have a struts action wrapper.

Any clues as to my problem will be much appreciated

Regards

Jo Corless




By: Honghai Zhang - haroldzhang
RE: Failure to compile as a java class in Struts
2003-12-10 10:26
I have the same problem when I try to compile reports in a struts app deployed on Weblogic Server v6.1




By: Tom - tomage
RE: Failure to compile as a java class in Struts
2003-12-10 15:29
Hi,

Be sure to also set the classpath for the compilation:

System.setProperty("jasper.reports.compile.class.path", reportClasspath);

Tom




By: Joanne Corless - jocorless
RE: Failure to compile as a java class in Struts
2003-12-11 03:08
I've tried adding the classpath using an absolute reference but this doesn't seem to make any difference.

Does it have anything to do with application context? I've noticed that both the relevant examples I've looked at (the Servlet and the JSP) both run the compile from within an application context whereas I will be compiling reports located in an external (to the Server) directory.

Regards

Jo Corless




By: Tom - tomage
RE: Failure to compile as a java class in Struts
2003-12-11 08:25
Hi Jo,

I have been using an absolute reference. Here is the entry from my properties file:

jasper.reports.compile.class.path=Q:\SIMPLETRADE2\lib\jasperreports-0.5.0.jar

Tom





By: Joanne Corless - jocorless
RE: Failure to compile as a java class in Struts
2003-12-12 08:13
Thanks Guys for all your help, typically it was a stupid mistake that was causing my problem, I wasn't referencing the jar file correctly, I was only pointing to its directory rather than the file itself

Jo Corless
2002 JI Open Discussion's picture
Joined: Aug 10 2006 - 3:28am
Last seen: 16 years 7 months ago

0 Answers:

No answers yet
Feedback
randomness