Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JasperReport problem

 
andree surya
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
    Posts: 29
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 29
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 29
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 3275
    5
    Eclipse IDE Java Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    You need the log4j.jar in your classpath (log4j-1.2.15.jar probably)
     
    andree surya
    Greenhorn
    Posts: 29
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 3275
    5
    Eclipse IDE Java Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 29
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 3275
    5
    Eclipse IDE Java Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    You're welcome
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic