Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

JasperReport problem

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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.
     
    author
    Posts: 3285
    13
    Mac OS X Eclipse IDE Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
    Posts: 3285
    13
    Mac OS X Eclipse IDE Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
    Posts: 3285
    13
    Mac OS X Eclipse IDE Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    You're welcome
     
    reply
      Bookmark Topic Watch Topic
    • New Topic