segfault Posted March 24, 2012 Share Posted March 24, 2012 Hello! I'm trying to compile and run a slightly modified sample code that came with jasperreports, namely the datasource one. The difference is the addition of a new class, so that the compilation, filling and exporting can be incorporated into another program, without having to run ant fill, ant compile and ant pdf etc. The error I'm getting says: Exception in thread "main" java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/JRDataSource Caused by: java.lang.ClassNotFoundException: net.sf.jasperreports.engine.JRDataSourceEven though I've included in my lib folder every .jar file found in jasperreports. (silly, but it still doesn't work) And here's the code I've added to the datasource sample (after deleting DataSourceApp.java, of course): http://pastebin.com/7eYMcwnzAny idea would be appreciated. Thanks!LE: the original datasource sample code compiles and runs perfectly. Code: Post Edited by expireddreams at 03/24/2012 13:18Post Edited by expireddreams at 03/24/2012 13:52 Link to comment Share on other sites More sharing options...
segfault Posted March 24, 2012 Author Share Posted March 24, 2012 Follow-up: I've tried JREmptyDataSource() as well, but to no avail. It raises the same exception. Code: JasperFillManager.fillReportToFile("build/reports/DataSourceReport.jasper", parameters, new JREmptyDataSource()); Link to comment Share on other sites More sharing options...
kashkoa Posted March 26, 2012 Share Posted March 26, 2012 1. Search and find which jar file has this class. 2. Check your ant class path Hope this helps Link to comment Share on other sites More sharing options...
segfault Posted March 27, 2012 Author Share Posted March 27, 2012 But the sample code (datasource) works fine. No exceptions and it generates what it has to. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now