Below is the code I am trying to use to connect to a database and view reports in the JasperViewer.
 private void jButton1ActionPerformed(ActionEvent evt) {
     try {
         String dbURL = "jdbc:oracle:thin:@localhost:1521:xe";
         String username = "user";
         String password = "pwd";
         Connection con = DriverManager.getConnection(dbURL, username, password);
         String reportPath = "C:\\path\\extention.jrxml";
         JasperReport jr = JasperCompileManager.compileReport(reportPath);
         JasperPrint jp = JasperFillManager.fillReport(jr, null, con);
         JasperViewer.viewReport(jp);
         con.close();
     } catch (Exception ex) {
         System.out.println(ex.getMessage());
     }
 }
I got the following error:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
 
     
    