title: GeneratePDF with JasperReport Library and MongoDB
body: <p>So mongoDB is running on 27017 and my collection name is test.</p>
  
  <pre><code>  try {
              // - Connection to base
              String mongoURI = "mongodb://localhost:27017/test";
              MongoDbConnection connection = null;
  
          Map&lt;String, Object&gt; parameters = new HashMap&lt;String, Object&gt;();
          try {
  line35      connection = new MongoDbConnection(mongoURI, null, null);
                  parameters.put(MongoDbDataSource.CONNECTION, connection);
                  JasperDesign jasperDesign = JRXmlLoader.load("/home/gocoffee.jrxml");
                  JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
                  File jasperFile;
                  jasperFile = new File("/home/MongoDbReport.jasper");
                  JasperCompileManager.compileReportToFile("/home/gocoffee.jrxml", "MongoDbReport.jasper");
                  JasperFillManager.fillReportToFile("/home/MongoDbReport.jasper", parameters);               
                  JasperExportManager.exportReportToPdfFile("/home/MongoDbReport.jrprint");
              }
  </code></pre>
  
  <p>And I have this error, I don't understand why :</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
      at com.jaspersoft.mongodb.MongoDbConnection.&lt;init&gt;(MongoDbConnection.java:62)
      at Generate.main(Generate.java:35)
  Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
  </code></pre>
  
  <p>The MongoURI seems fine and i think i don't have any login or password </p>