2005 IR Help Posted August 26, 2006 Share Posted August 26, 2006 By: Besunta - besunta Jbuilder executable builder with jasper 2004-07-27 15:52 Hello!! Thanks for helping me. I have a project running perfectly on jbuilder with jasper reports but when i create a executable archive the report doesn't open i push the button and nothing no report no error and everything else is ok it works with database (select,insert,etc) and other thirdparty classes... Anyone knows what's the problem? By: Mykel Alvis - evilarchitect RE: Jbuilder executable builder with jasper 2004-07-27 16:19 If the application runs inside of JBuilder, then it's probably a library location problem. An executable application (run a jar from the command line) must have all the required classes inside it or made available on the command line CLASSPATH By: Jonathan Buckland - salessiab RE: Jbuilder executable builder with jasper 2004-07-28 01:37 As it turns out I just built a jar in Jbuilder today too. I mught have some pointers for you. Try including the tools.jar in the project "Required Libraries". I add all my libraries there. Do this by going to: Project->Project Properties->Required Libraries (Tab)->Add->new->(name it)->(add the tools.jar). I keep my jars in ./lib/ Also make sure you have added all the libraries that are listed on the japserreports website here:http://jasperreports.sourceforge.net/requirements.html regards jonathan By: Besunta - besunta RE: Jbuilder executable builder with jasper 2004-07-28 12:57 I tried and nothing... I already have added the libraries to the project. JasperReports Mysql JDataStore Digester Collections Logging Beanutils Tools And still doesn't work... i think it is a library but i already add all it must be someone that jbuilder automactly includes... I open the jar i there is all dirs from the libraries that i added... By: Mykel Alvis - evilarchitect RE: Jbuilder executable builder with jasper 2004-07-28 13:02 Try generating some logging info and posting that. There's very little to work with without seeing the code. You might also post code where you generate your JRPrint and where you export the output. Basically, given no exposure to your problem, we're guessing. By: Besunta - besunta RE: Jbuilder executable builder with jasper 2004-07-28 15:18 I created a batch file with the line that jbuilder executes and it works just fine. The executable doesn't work Here is the batch: F:JBuilderXjdk1.4binjavaw -classpath "C:Documents and SettingsBesuntajbprojectTeste11classes;F:JBuilderXthirdpartyjasperReportsjasperreports-0.6.0.jar;F:JBuilderXthirdpartymysql-connector-java-3.0.14-productionmysql-connector-java-3.0.14-production-bin.jar;F:JBuilderXlibjds.jar;F:JBuilderXlibdx.jar;F:JBuilderXlibbeandt.jar;F:JBuilderXthirdpartydigester-1.5commons-digester.jar;F:JBuilderXthirdpartycollections-3.0commons-collections-3.0.jar;F:JBuilderXthirdpartycollections-3.0commons-collections-testframework-3.0.jar;F:JBuilderXthirdpartylogging-1.0.4commons-logging.jar;F:JBuilderXthirdpartylogging-1.0.4commons-logging-api.jar;F:JBuilderXthirdpartybeanutils-1.6.1commons-beanutils.jar;F:JBuilderXjdk1.4libtools.jar;F:JBuilderXjdk1.4demojfcJava2DJava2Demo.jar;F:JBuilderXjdk1.4demopluginjfcJava2DJava2Demo.jar;F:JBuilderXjdk1.4jrejavawsjavaws.jar;F:JBuilderXjdk1.4jrelibcharsets.jar;F:JBuilderXjdk1.4jrelibextdnsns.jar;F:JBuilderXjdk1.4jrelibextldapsec.jar;F:JBuilderXjdk1.4jrelibextlocaledata.jar;F:JBuilderXjdk1.4jrelibextsunjce_provider.jar;F:JBuilderXjdk1.4jrelibimindicim.jar;F:JBuilderXjdk1.4jrelibimthaiim.jar;F:JBuilderXjdk1.4jrelibjce.jar;F:JBuilderXjdk1.4jrelibjsse.jar;F:JBuilderXjdk1.4jrelibplugin.jar;F:JBuilderXjdk1.4jrelibrt.jar;F:JBuilderXjdk1.4jrelibsunrsasign.jar;F:JBuilderXjdk1.4libdt.jar;F:JBuilderXjdk1.4libhtmlconverter.jar" teste11.Application1 By: Besunta - besunta RE: Jbuilder executable builder with jasper 2004-07-28 15:20 Here is the code of the frame. It is very simple just one button to the report. package teste11; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.io.File; import java.util.*; import net.sf.jasperreports.engine.*; import net.sf.jasperreports.view.*; import java.sql.*; import net.sf.jasperreports.engine.design.JasperDesign; import java.lang.Object; import com.borland.dx.dataset.*; import com.borland.dx.sql.dataset.*; /** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright © 2004</p> * <p>Company: </p> * @author not attributable * @version 1.0 */ public class Frame1 extends JFrame { JPanel contentPane; JButton jButton1 = new JButton(); File f1 = new File("C://rpt//printCommission.jrxml");//"c://teste.xml");//C://Documents and Settings//Besunta//jbproject//FarXpress// Map parameters = new HashMap(); JRDataSource ds = new JREmptyDataSource(); Database db = new Database(); String query = new String(); JasperExportManager jem = new JasperExportManager(); //Construct the frame public Frame1() { enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { contentPane = (JPanel) this.getContentPane(); jButton1.setBounds(new Rectangle(116, 99, 172, 49)); jButton1.setText("report"); jButton1.addActionListener(new Frame1_jButton1_actionAdapter(this)); contentPane.setLayout(null); this.setSize(new Dimension(400, 300)); this.setTitle("Frame Title"); contentPane.add(jButton1, null); } //Overridden so we can exit when window is closed protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { System.exit(0); } } void jButton1_actionPerformed(ActionEvent e) { // parameters.put("dataIni",this.textAnoIni.getText() + "-" + this.textMesIni.getText()+ "-" + this.textDiaIni.getText()); // parameters.put("dataFim",this.textAnoEnd.getText() + "-" + this.textMesEnd.getText() + "-" + this.textDiaEnd.getText()); db.setConnection(new com.borland.dx.sql.dataset.ConnectionDescriptor("jdbc:mysql://192.168.0.1:3306/predistdb", "dev", "euro2004", false, "com.mysql.jdbc.Driver")); JasperDesign jasperDesign = null; try { JasperDesign jd = JasperManager.loadXmlDesign(f1.getAbsolutePath()); JasperReport jasperReport = JasperManager.compileReport(jd); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, db.getJdbcConnection()); JasperViewer.viewReport(jasperPrint); } catch (JRException ex) { } } } class Frame1_jButton1_actionAdapter implements java.awt.event.ActionListener { Frame1 adaptee; Frame1_jButton1_actionAdapter(Frame1 adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButton1_actionPerformed(e); } } By: Besunta - besunta RE: Jbuilder executable builder with jasper 2004-07-28 15:24 Now it worked on this teste... I'm going to see whats wrong with main application... thx for helping Link to comment Share on other sites More sharing options...
brusuillis Posted October 13, 2006 Share Posted October 13, 2006 Go to the properties of the executable jar archive you created, Dependencies, put INCLUDE ALL and rebuild. 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