aspose file tools*
The moose likes Other Open Source Projects and the fly likes JasperReport problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "JasperReport problem" Watch "JasperReport problem" New topic
Author

JasperReport problem

andree surya
Greenhorn

Joined: Jun 13, 2009
Posts: 29
Hi all. I have a problem in setting up jasperreport.

It is mentioned here that I have to put these files in my classpath.

  • dist/jasperreports-X.jar
  • lib/commons-*.jar (all the commons - except maybe for commons-logging)
  • lib/itext-X.jar
  • lib/jdt-compiler.jar


  • I've done that. However, instead of pointing my classpath to each of these files, I extracted them, put them into one folder, and have my classpath points to this folder.
    It works, as I can compile my project successfully.

    But I got the following errors when I try to run my program :



    Class org/apache/commons/digester/Digester not found, which is funny because if I import org.apache.commons.digester.Digester in my code, the compiler gives me no error.

    Any clues ? Any helps will be appreciated.

    This is my code :

    andree surya
    Greenhorn

    Joined: Jun 13, 2009
    Posts: 29
    Never mind. Mine works already .
    Instead of compiling the JRXML on the fly like the code above, I use a pre-compiled jasper template instead.
    andree surya
    Greenhorn

    Joined: Jun 13, 2009
    Posts: 29
    No it's not working. I run my program and now the error message :

    Class not found. The same problem like the one I mentioned in the first post.
    andree surya
    Greenhorn

    Joined: Jun 13, 2009
    Posts: 29
    Now i set my classpath to point to each of the JAR files under jasperreport-xxx/lib (using batch script off course).
    No luck. Still the same error.

    Anyone please?
    Desperately need help.
    Martijn Verburg
    author
    Bartender

    Joined: Jun 24, 2003
    Posts: 3274
        
        5

    You need the log4j.jar in your classpath (log4j-1.2.15.jar probably)


    Cheers, Martijn - Blog,
    Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
    My start-up.
    andree surya
    Greenhorn

    Joined: Jun 13, 2009
    Posts: 29
    Martijn Verburg wrote:You need the log4j.jar in your classpath (log4j-1.2.15.jar probably)

    Hi Martijn, thanks for the reply. I include log4j-1.2.9.jar to the classpath, but it's not working either.
    The packages contained inside log4j.jar is com.apache.log4j, anyway.
    The one that is missing is com.apache.commons.logging.Log. It is contained within commons-logging, but it's also already in the classpath.

    Hm . . . . Any ideas?
    Martijn Verburg
    author
    Bartender

    Joined: Jun 24, 2003
    Posts: 3274
        
        5

    The only thing that I can think of is that it's not picking up the commons logging in your CLASSPATH for some reason or you have multiple copies of commons-logging in the CLASSPATH
    andree surya
    Greenhorn

    Joined: Jun 13, 2009
    Posts: 29
    Martijn Verburg wrote:The only thing that I can think of is that it's not picking up the commons logging in your CLASSPATH for some reason or you have multiple copies of commons-logging in the CLASSPATH

    Hey you're right ! I have another jasperreports-xxx.jar in my JRE\ext\lib. I delete it, and now it works !
    Million Thanks, Martijn
    Martijn Verburg
    author
    Bartender

    Joined: Jun 24, 2003
    Posts: 3274
        
        5

    You're welcome
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: JasperReport problem