title: java.lang.NoClassDefFoundError: org/apache/commons/collections/ReferenceMap
body: <p>Really newbie in java, Spanish-speaker, so, ill do my best for you to understand me :). I made a program which manages a mysql database for storing clientes, information about clients, etc. And generates (or trying too...) reports. I installed JasperReports from Eclipse Market (BTW, using Eclipse Kepler). Following some tutorials, i made my way into creating a report by parameters. Its just one parameter to identify one client. Thats not the problem. The problem comes when i click my button to generate the report, which contains the code below:</p>
  
  <pre><code>JButton btnOk = new JButton("OK");
      btnOk.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent arg0) {
              String doc = jftxtDni.getText();
              String sql;
              boolean respuesta = false;
              ConexionBaseDatos cc = new ConexionBaseDatos();
  
              sql = "SELECT * FROM clientes WHERE DNI = '"+doc+"'";
  
              rs = cc.Consultar(sql);
  
                  try 
                  {
                      while (rs.next())
                      {
                      respuesta = true;
                      }
                  }
                  catch (SQLException e) 
                  {
                      JOptionPane.showMessageDialog(null, "error sql: "+e.getMessage());
                  }    
  
                  if (respuesta)
                  {
                      ConexionBaseDatos cd = new ConexionBaseDatos();
                      Connection cn = cd.Conectar();
                      JasperReport jr = null;
                      String archivo = "src/reportes/Tree.jasper";
                      try
                      {
                          HashMap&lt;String, Object&gt; parametro = new HashMap&lt;String, Object&gt;();
                          parametro.put("dni", doc);
                          jr = (JasperReport) JRLoader.loadObjectFromFile(archivo);
                          JasperPrint jp = JasperFillManager.fillReport(jr,parametro,cn);
                          JasperViewer jv = new JasperViewer(jp);
                          jv.setVisible(true);
                          jv.setTitle("Informe de cliente");
  
                      } 
                      catch (JRException e)
                      {
                          JOptionPane.showMessageDialog(null, "error Jasper: "+e.getMessage());;
                      }
  
                  }   
                  else
                  {
                      JOptionPane.showMessageDialog(null, "No existe el cliente en la base de datos, verifique.");
                  }
  
                  }
              }
          )
  </code></pre>
  
  <p>which despite spanish names of variables, catchs a variable typed by user, connects to database, check the existence of such a user through its "dni", if exists, generates the report, otherway, a message error.
     When i executed it first time, apache.commons.logging not found appeared, wich i solved importing apache commons libraries. But after that, the error was the one i titled this topic. I said: easy cake, downloaded apache commons collections, imported jars... and that is it! I thought... but no way.. i get:</p>
  
  <pre><code>Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/apache/commons/collections/ReferenceMap
  at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.&lt;init&gt;(DefaultExtensionsRegistry.java:97)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
  at java.lang.reflect.Constructor.newInstance(Unknown Source)
  at java.lang.Class.newInstance(Unknown Source)
  at net.sf.jasperreports.engine.util.ClassUtils.instantiateClass(ClassUtils.java:59)
  at net.sf.jasperreports.extensions.ExtensionsEnvironment.createDefaultRegistry(ExtensionsEnvironment.java:82)
  at net.sf.jasperreports.extensions.ExtensionsEnvironment.&lt;clinit&gt;(ExtensionsEnvironment.java:69)
  at net.sf.jasperreports.engine.util.JRStyledTextParser.&lt;clinit&gt;(JRStyledTextParser.java:83)
  at net.sf.jasperreports.engine.fill.JRBaseFiller.&lt;init&gt;(JRBaseFiller.java:123)
  at net.sf.jasperreports.engine.fill.JRVerticalFiller.&lt;init&gt;(JRVerticalFiller.java:88)
  at net.sf.jasperreports.engine.fill.JRVerticalFiller.&lt;init&gt;(JRVerticalFiller.java:103)
  at net.sf.jasperreports.engine.fill.JRVerticalFiller.&lt;init&gt;(JRVerticalFiller.java:61)
  at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:179)
  at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:81)
  at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:446)
  at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:849)
  at formularios.ImprimirCliente$2.actionPerformed(ImprimirCliente.java:143)
  at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
  at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
  at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
  at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
  at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
  at java.awt.Component.processMouseEvent(Unknown Source)
  at javax.swing.JComponent.processMouseEvent(Unknown Source)
  at java.awt.Component.processEvent(Unknown Source)
  at java.awt.Container.processEvent(Unknown Source)
  at java.awt.Component.dispatchEventImpl(Unknown Source)
  at java.awt.Container.dispatchEventImpl(Unknown Source)
  at java.awt.Component.dispatchEvent(Unknown Source)
  at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
  at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
  at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
  at java.awt.Container.dispatchEventImpl(Unknown Source)
  at java.awt.Window.dispatchEventImpl(Unknown Source)
  at java.awt.Component.dispatchEvent(Unknown Source)
  at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
  at java.awt.EventQueue.access$200(Unknown Source)
  at java.awt.EventQueue$3.run(Unknown Source)
  at java.awt.EventQueue$3.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
  at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue$4.run(Unknown Source)
  at java.awt.EventQueue$4.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
  at java.awt.EventQueue.dispatchEvent(Unknown Source)
  at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
  at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
  at java.awt.EventDispatchThread.run(Unknown Source)
  Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.ReferenceMap
  at java.net.URLClassLoader$1.run(Unknown Source)
  at java.net.URLClassLoader$1.run(Unknown Source)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(Unknown Source)
  at java.lang.ClassLoader.loadClass(Unknown Source)
  at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
  at java.lang.ClassLoader.loadClass(Unknown Source)
  ... 55 more
  </code></pre>
  
  <p>...sooooo... i double checked the library is ok, and its there, but for some reason, it looks like eclipse or java, or some kind of alien, doesnt find it.. anyway, i did research all over the internet, and found this error, wich was mostly solved by importing commons collections... not my case. Eclipse kepler, java 7, and apache commons 4.0. Any vague idea..? Thank you very much for taking time to read it, sorry for my english and waiting for some light.. :D</p>