aspose file tools*
The moose likes JavaFX and the fly likes java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JavaFX
Bookmark "java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V" Watch "java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V" New topic
Author

java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V

kokyeong yong
Greenhorn

Joined: Mar 21, 2013
Posts: 2
i'm using netbeans to create java to call jaspersevrer to print out the report but i have some error
i ady use "cglib-2.1.3.jar" and "asm-1.5.1.jar" lib

Exception in thread "main" java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V
at org.codehaus.groovy.runtime.callsite.CallSiteGenerator.compilePojoMethod(CallSiteGenerator.java:219)
at org.codehaus.groovy.reflection.CachedMethod.createPojoMetaMethodSite(CachedMethod.java:244)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.createCachedMethodSite(PojoMetaMethodSite.java:158)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.createPojoMetaMethodSite(PojoMetaMethodSite.java:147)
at groovy.lang.MetaClassImpl.createPojoCallSite(MetaClassImpl.java:2987)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createPojoSite(CallSiteArray.java:114)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:148)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:121)
at org.codehaus.groovy.ast.builder.AstBuilderTransformation.visit(AstBuilderTransformation.groovy:46)
at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:303)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:831)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:519)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:495)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:472)
at net.sf.jasperreports.compilers.JRGroovyCompiler.compileUnits(JRGroovyCompiler.java:88)
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:192)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:219)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:152)
at JasperReportsIntro.main(JasperReportsIntro.java:23)


and this is my java code

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author cis
*/
import java.io.File;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import net.sf.jasperreports.view.JasperViewer;
import net.sf.jasperreports.engine.xml.JRXmlLoader;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.design.JasperDesign;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.JRException;
import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.sf.jasperreports.engine.JREmptyDataSource;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JRExporterParameter;
import net.sf.jasperreports.engine.JasperPrintManager;
import javax.print.attribute.PrintRequestAttributeSet;
import net.sf.jasperreports.engine.export.JRPdfExporterParameter;
import net.sf.jasperreports.engine.export.JRPrintServiceExporter;
import net.sf.jasperreports.engine.export.JRPrintServiceExporterParameter;


public class JasperReportTryPrint {

public static void main(String[] args) throws ClassNotFoundException, SQLException
{
JasperReport jasperReport;
JasperPrint jasperPrint;
JasperDesign JasDes;
try
{
Connection con;
String url="jdbc:mysql://localhost/solucisv3_galaxy";
Class.forName("com.mysql.jdbc.Driver").newInstance();
con=(Connection) DriverManager.getConnection(url,"root","");


File reprt = new File("c:/Users/cis/Documents/report/testing_print.jrxml");
JasDes = JRXmlLoader.load(reprt);
jasperReport = JasperCompileManager.compileReport(JasDes);



HashMap parameters = new HashMap();
System.out.println("Filling report...");

parameters.put("PCondition","SELECT * FROM v_doc_ticketing");
parameters.put("Plb_Company", "Company");
parameters.put("Plb_Address", "Address");
parameters.put("Plb_Title", "Title");


System.out.println(parameters);


jasperPrint = JasperFillManager.fillReport(jasperReport,parameters);
JasperExportManager.exportReportToPdfFile(jasperPrint,"c:/Users/cis/Documents/report/sample.pdf");

JasperViewer.viewReport(jasperPrint, false);

JRPrintServiceExporter exporter;
exporter = new JRPrintServiceExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PAGE_DIALOG, Boolean.FALSE);
exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG, Boolean.TRUE);
exporter.setParameter(JRPdfExporterParameter.PDF_JAVASCRIPT,"this.print({bUI: false,bSilent: true,bShrinkToFit: true});");
exporter.exportReport();
}
catch (JRException e)
{
} catch (InstantiationException ex) {
Logger.getLogger(JasperReportTryPrint.class.getName()).log(Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
Logger.getLogger(JasperReportTryPrint.class.getName()).log(Level.SEVERE, null, ex);
}
}

}

somebody please help mi to fix it..pleass..@@
kokyeong yong
Greenhorn

Joined: Mar 21, 2013
Posts: 2
kokyeong yong wrote:i'm using netbeans to create java to call jaspersevrer to print out the report but i have some error
i ady use "cglib-2.1.3.jar" and "asm-1.5.1.jar" lib

Exception in thread "main" java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V
at org.codehaus.groovy.runtime.callsite.CallSiteGenerator.compilePojoMethod(CallSiteGenerator.java:219)
at org.codehaus.groovy.reflection.CachedMethod.createPojoMetaMethodSite(CachedMethod.java:244)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.createCachedMethodSite(PojoMetaMethodSite.java:158)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.createPojoMetaMethodSite(PojoMetaMethodSite.java:147)
at groovy.lang.MetaClassImpl.createPojoCallSite(MetaClassImpl.java:2987)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createPojoSite(CallSiteArray.java:114)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:148)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:121)
at org.codehaus.groovy.ast.builder.AstBuilderTransformation.visit(AstBuilderTransformation.groovy:46)
at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:303)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:831)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:519)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:495)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:472)
at net.sf.jasperreports.compilers.JRGroovyCompiler.compileUnits(JRGroovyCompiler.java:88)
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:192)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:219)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:152)
at JasperReportsIntro.main(JasperReportsIntro.java:23)


and this is my java code

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

/**
*
* @author cis
*/
import java.io.File;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import net.sf.jasperreports.view.JasperViewer;
import net.sf.jasperreports.engine.xml.JRXmlLoader;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.design.JasperDesign;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.JRException;
import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.sf.jasperreports.engine.JREmptyDataSource;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JRExporterParameter;
import net.sf.jasperreports.engine.JasperPrintManager;
import javax.print.attribute.PrintRequestAttributeSet;
import net.sf.jasperreports.engine.export.JRPdfExporterParameter;
import net.sf.jasperreports.engine.export.JRPrintServiceExporter;
import net.sf.jasperreports.engine.export.JRPrintServiceExporterParameter;


public class JasperReportTryPrint {

public static void main(String[] args) throws ClassNotFoundException, SQLException
{
JasperReport jasperReport;
JasperPrint jasperPrint;
JasperDesign JasDes;
try
{
Connection con;
String url="jdbc:mysql://localhost/db";
Class.forName("com.mysql.jdbc.Driver").newInstance();
con=(Connection) DriverManager.getConnection(url,"root","");


File reprt = new File("c:/Users/cis/Documents/report/testing_print.jrxml");
JasDes = JRXmlLoader.load(reprt);
jasperReport = JasperCompileManager.compileReport(JasDes);



HashMap parameters = new HashMap();
System.out.println("Filling report...");

parameters.put("PCondition","SELECT * FROM v_doc");
parameters.put("Plb_Company", "Company");
parameters.put("Plb_Address", "Address");
parameters.put("Plb_Title", "Title");


System.out.println(parameters);


jasperPrint = JasperFillManager.fillReport(jasperReport,parameters);
JasperExportManager.exportReportToPdfFile(jasperPrint,"c:/Users/cis/Documents/report/sample.pdf");

JasperViewer.viewReport(jasperPrint, false);

JRPrintServiceExporter exporter;
exporter = new JRPrintServiceExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PAGE_DIALOG, Boolean.FALSE);
exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG, Boolean.TRUE);
exporter.setParameter(JRPdfExporterParameter.PDF_JAVASCRIPT,"this.print({bUI: false,bSilent: true,bShrinkToFit: true});");
exporter.exportReport();
}
catch (JRException e)
{
} catch (InstantiationException ex) {
Logger.getLogger(JasperReportTryPrint.class.getName()).log(Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
Logger.getLogger(JasperReportTryPrint.class.getName()).log(Level.SEVERE, null, ex);
}
}

}

somebody please help mi to fix it..pleass..@@
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V
 
Similar Threads
Jasper Report blank
Jasper Report Issue
jasperreports does not work in executable jar file
Exception in thread "main" java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V
Jasper Reports Excel Output