title: Error compiling report java source files
body: <p>my probleme is: i can't compile my report from java.
  well i create my page in iReport and i load it from my java code.</p>
  
  <p>here is some of my error:</p>
  
  <pre><code>    5 juin 2011 19:45:47 org.apache.commons.digester.Digester error
  GRAVE: Parse Error at line 3 column 408: Attribute "xmlns" must be declared for element type "jasperReport".
  org.xml.sax.SAXParseException: Attribute "xmlns" must be declared for element type "jasperReport".
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
      at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(XMLDTDValidator.java:1275)
      at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1940)
      at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:764)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1363)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.scanRootElementHook(XMLDocumentScannerImpl.java:1318)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3103)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
      at org.apache.commons.digester.Digester.parse(Digester.java:1647)
      at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:238)
      at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:225)
      at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:213)
      at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:167)
      at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:151)
      at gestionstock.Recherche_commande.jButton2ActionPerformed(Recherche_commande.java:258)
      at gestionstock.Recherche_commande.access$300(Recherche_commande.java:36)
      at gestionstock.Recherche_commande$4.actionPerformed(Recherche_commande.java:151)
      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
      at java.awt.Component.processMouseEvent(Component.java:6263)
      at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
      at java.awt.Component.processEvent(Component.java:6028)
      at java.awt.Container.processEvent(Container.java:2041)
      at java.awt.Component.dispatchEventImpl(Component.java:4630)
      at java.awt.Container.dispatchEventImpl(Container.java:2099)
      at java.awt.Component.dispatchEvent(Component.java:4460)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
      at java.awt.Container.dispatchEventImpl(Container.java:2085)
      at java.awt.Window.dispatchEventImpl(Window.java:2478)
      at java.awt.Component.dispatchEvent(Component.java:4460)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
  5 juin 2011 19:45:47 gestionstock.Recherche_commande jButton2ActionPerformed
  </code></pre>
  
  <p>and here is my java code:</p>
  
  <pre><code>String url = "jdbc:oracle:thin:@localhost:1521:gpsi";
      String user = "gestion";
      String passwd = "password";
      Connection conn = null;
  
      String reference = this.commande_reference.getText();
  
      try {
          Class.forName("oracle.jdbc.driver.OracleDriver");
          conn = DriverManager.getConnection(url, user, passwd);
          Statement stmt = conn.createStatement();
  
          JasperDesign jasperDesign = JRXmlLoader.load("./lib/report.jrxml");
          JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
          Map parameters = new HashMap();
  
          parameters.put("ref",reference);        
  
           JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, conn);
  
          net.sf.jasperreports.view.JasperViewer.viewReport(jasperPrint,false);
          // - Création du rapport au format PDF
          //JasperExportManager.exportReportToPdfFile(jasperPrint, "./lib/report.pdf");
  
          JOptionPane.showMessageDialog(this , "Opération éffectuée avec succès!", "Terminé" , JOptionPane.INFORMATION_MESSAGE)  ;
  
      } catch (JRException ex) {
          Logger.getLogger(Recherche_commande.class.getName()).log(Level.SEVERE, null, ex);
      } catch (SQLException ex) {
          JOptionPane.showMessageDialog(this, "erreur : Opération non effectuées " +
                  ex.getMessage()  , "Avertissement", JOptionPane.ERROR_MESSAGE);
      } catch (ClassNotFoundException ex) {
          JOptionPane.showMessageDialog(this, "erreur : Opération non effectuées " +
                  ex.getMessage()  , "Avertissement", JOptionPane.ERROR_MESSAGE);
      }finally {
          try {
               conn.close();
              } catch (SQLException e) {
  
                      e.printStackTrace();
              }
      }
  </code></pre>
  
  <p>and finaly here is my jrxml file called report.jrxml:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"&gt;
  &lt;jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report2" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"&gt;
      &lt;property name="ireport.zoom" value="1.0"/&gt;
      &lt;property name="ireport.x" value="0"/&gt;
      &lt;property name="ireport.y" value="0"/&gt;
      &lt;parameter name="ref" class="java.lang.String"/&gt;
      &lt;queryString&gt;
          &lt;![CDATA[SELECT
                  ASSOCIER."QUANTITE",
                  CLIENTS."CLIENTNOM",
                  PRODUITS."PRODUITNOM",
                  COMMANDES."REFERENCE",
                  COMMANDES."COMMANDEDATE",
                  CLIENTS."CLIENTPRENOM" AS CLIENTS_CLIENTPRENOM,
                  sum(PRODUITS.produitprix*ASSOCIER.quantite)
          FROM
                  "COMMANDES" COMMANDES,
                  "EMPLOYES" EMPLOYES,
                  "CLIENTS" CLIENTS,
                  "PAIEMENTS" PAIEMENTS,
                  "ASSOCIER" ASSOCIER,
                  "PRODUITS" PRODUITS
          WHERE
                  COMMANDES.employeid = EMPLOYES.employeid
                  and CLIENTS.clientid = COMMANDES.clientid
                  and COMMANDES.commandeid = PAIEMENTS.commandeid
                  and COMMANDES.commandeid = ASSOCIER.commandeid
                  and PRODUITS.produitid = ASSOCIER.produitid
                  and COMMANDES.reference = '$P!{ref}'
          GROUP BY
                  PRODUITS.produitnom,
                  COMMANDES.reference,
                  CLIENTS.clientnom,
                  CLIENTS.clientprenom,
                  EMPLOYES.employenom,
                  COMMANDES.commandedate,
                  PAIEMENTS.paiementdate,
                  ASSOCIER.quantite]]&gt;
      &lt;/queryString&gt;
      &lt;field name="QUANTITE" class="java.math.BigDecimal"/&gt;
      &lt;field name="CLIENTNOM" class="java.lang.String"/&gt;
      &lt;field name="PRODUITNOM" class="java.lang.String"/&gt;
      &lt;field name="REFERENCE" class="java.lang.String"/&gt;
      &lt;field name="COMMANDEDATE" class="java.sql.Timestamp"/&gt;
      &lt;field name="CLIENTS_CLIENTPRENOM" class="java.lang.String"/&gt;
      &lt;field name="SUM(PRODUITS.PRODUITPRIX*ASSOCIER.QUANTITE)" class="java.math.BigDecimal"/&gt;
      &lt;group name="REFERENCE"&gt;
          &lt;groupExpression&gt;&lt;![CDATA[$F{REFERENCE}]]&gt;&lt;/groupExpression&gt;
      &lt;/group&gt;
      &lt;background&gt;
          &lt;band splitType="Stretch"/&gt;
      &lt;/background&gt;
      &lt;title&gt;
          &lt;band height="143" splitType="Stretch"&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="183" y="25" width="222" height="92"/&gt;
                  &lt;textElement&gt;
                      &lt;font fontName="Andalus" size="60"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[Facture]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;line&gt;
                  &lt;reportElement x="15" y="121" width="527" height="1"/&gt;
                  &lt;graphicElement&gt;
                      &lt;pen lineWidth="2.0" lineStyle="Double"/&gt;
                  &lt;/graphicElement&gt;
              &lt;/line&gt;
          &lt;/band&gt;
      &lt;/title&gt;
      &lt;pageHeader&gt;
          &lt;band height="35" splitType="Stretch"&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="17" y="7" width="100" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;text&gt;&lt;![CDATA[Reference :]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="310" y="9" width="100" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;text&gt;&lt;![CDATA[Date :]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;textField&gt;
                  &lt;reportElement mode="Transparent" x="127" y="7" width="100" height="20" backcolor="#FFFFFF"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression class="java.lang.String"&gt;&lt;![CDATA[$F{REFERENCE}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement x="423" y="7" width="100" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression class="java.sql.Timestamp"&gt;&lt;![CDATA[$F{COMMANDEDATE}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
          &lt;/band&gt;
      &lt;/pageHeader&gt;
      &lt;columnHeader&gt;
          &lt;band height="61" splitType="Stretch"&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="17" y="10" width="100" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;text&gt;&lt;![CDATA[Nom de client :]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;textField&gt;
                  &lt;reportElement x="127" y="10" width="100" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression class="java.lang.String"&gt;&lt;![CDATA[$F{CLIENTNOM}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="307" y="10" width="100" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;text&gt;&lt;![CDATA[Prenom de  client :]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;textField&gt;
                  &lt;reportElement x="423" y="10" width="100" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression class="java.lang.String"&gt;&lt;![CDATA[$F{CLIENTS_CLIENTPRENOM}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;line&gt;
                  &lt;reportElement x="-19" y="30" width="595" height="1" forecolor="#666666"/&gt;
              &lt;/line&gt;
              &lt;staticText&gt;
                  &lt;reportElement mode="Opaque" x="323" y="41" width="143" height="20" forecolor="#006699" backcolor="#E6E6E6"/&gt;
                  &lt;textElement textAlignment="Center"&gt;
                      &lt;font size="12" isBold="true"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[SUM(PRODUITS.PRODUITPRIX*ASSOCIER.QUANTITE)]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;staticText&gt;
                  &lt;reportElement mode="Opaque" x="204" y="41" width="119" height="20" forecolor="#006699" backcolor="#E6E6E6"/&gt;
                  &lt;textElement textAlignment="Center"&gt;
                      &lt;font size="12" isBold="true"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[QUANTITE]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;staticText&gt;
                  &lt;reportElement mode="Opaque" x="73" y="41" width="131" height="20" forecolor="#006699" backcolor="#E6E6E6"/&gt;
                  &lt;textElement textAlignment="Center"&gt;
                      &lt;font size="12" isBold="true"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[PRODUITNOM]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
          &lt;/band&gt;
      &lt;/columnHeader&gt;
      &lt;detail&gt;
          &lt;band height="49" splitType="Stretch"&gt;
              &lt;textField&gt;
                  &lt;reportElement mode="Transparent" x="73" y="0" width="131" height="20" backcolor="#9999FF"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression class="java.lang.String"&gt;&lt;![CDATA[$F{PRODUITNOM}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement x="324" y="0" width="142" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression class="java.math.BigDecimal"&gt;&lt;![CDATA[$F{SUM(PRODUITS.PRODUITPRIX*ASSOCIER.QUANTITE)}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement x="204" y="0" width="120" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression class="java.math.BigDecimal"&gt;&lt;![CDATA[$F{QUANTITE}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;line&gt;
                  &lt;reportElement x="73" y="0" width="393" height="1"/&gt;
              &lt;/line&gt;
              &lt;line&gt;
                  &lt;reportElement x="204" y="1" width="1" height="19"/&gt;
              &lt;/line&gt;
          &lt;/band&gt;
      &lt;/detail&gt;
      &lt;pageFooter&gt;
          &lt;band height="30" splitType="Stretch"&gt;
              &lt;textField&gt;
                  &lt;reportElement mode="Opaque" x="0" y="15" width="515" height="13" backcolor="#E6E6E6"/&gt;
                  &lt;textElement textAlignment="Right"/&gt;
                  &lt;textFieldExpression class="java.lang.String"&gt;&lt;![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField evaluationTime="Report"&gt;
                  &lt;reportElement mode="Opaque" x="515" y="15" width="40" height="13" backcolor="#E6E6E6"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression class="java.lang.String"&gt;&lt;![CDATA[" " + $V{PAGE_NUMBER}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField pattern="EEEEE dd MMMMM yyyy"&gt;
                  &lt;reportElement x="0" y="15" width="100" height="13"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression class="java.util.Date"&gt;&lt;![CDATA[new java.util.Date()]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
          &lt;/band&gt;
      &lt;/pageFooter&gt;
  &lt;/jasperReport&gt;
  </code></pre>
  
  <p>for information im using:</p>
  
  <pre><code>iReport3.4.7
  jasperreports-1.2.1.jar
  iText-2.1.7.jar
  commons-logging-api-1.0.2.jar
  commons-logging-1.0.2.jar
  commons-digester-1.7.jar
  commons-collections-2.1.jar
  commons-beanutils-1.5.jar
  groovy-all-1.5.5.jar
  </code></pre>
  
  <p>I'll be thankfull !!!</p>
  
  <p>after deleting the xmlns, i have that error:</p>
  
  <pre><code>5 juin 2011 21:18:10 org.apache.commons.digester.Digester error
  GRAVE: Parse Error at line 62 column 30: Attribute "splitType" must be declared for element type "band".
  org.xml.sax.SAXParseException: Attribute "splitType" must be declared for element type "band".
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
  </code></pre>