1

I am sort of new to jasper reports, I'm trying to call a .jrxml I have already created and compiled but I'm getting this record when trying to read the .jrxml Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/codehaus/groovy/control/CompilationFailedException

here is my code:

private void saveAsMenuItemActionPerformed(java.awt.event.ActionEvent evt) {                                               
    JasperPrint jp;
    JasperReport jr;
    try {
        Connection con=DriverManager.getConnection("jdbc:derby://localhost:1527/Database", "user", "password");

        jr=JasperCompileManager.compileReport("Reports/Cierre de Caja.jrxml");

        jp=JasperFillManager.fillReport("Reports/Cierre de Caja.jasper", new HashMap(), con);
        System.out.println("got jasper");
        JasperViewer jv=new JasperViewer(jp);
        jv.setVisible(true);
    }
    catch (JRException e){
        System.out.println("Jasper: "+e.getLocalizedMessage());
    }
    catch (SQLException e){
        System.out.println("SQL: "+e.getLocalizedMessage());
    }
}
Alex K
  • 22,315
  • 19
  • 108
  • 236
Edwin Barahona
  • 189
  • 1
  • 3
  • 13

1 Answers1

1

I'm using maven, so adding groovy as a dependency made the trick

<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>2.4.10</version>
</dependency>
Edwin Barahona
  • 189
  • 1
  • 3
  • 13