0 Replies Latest reply on Jun 22, 2016 12:19 PM by Sean Jensen

    Table exists locally but not on production server

    Sean Jensen Newbie

      Wildfly 10

      JBoss 9

      Java8

      MySQL

       

      I'm running a local version and a production version of Wildfly 10.  I have created an app that uploads files to the database then using Jasper Reports I create PDF which I display to the user.  This all works just fine on my local server.  The problem is when I run the same code on the production server I am getting an error message in the Jasper Reports library and my PDFs aren't rendering.  Can anyone tell me what I need to fix so that I can avoid this issue?

      This is the error message:

          net.sf.jasperreports.engine.JRException: Error executing SQL statement for: IdEqual.

      which comes from:

          Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'aaa.extendeddata' doesn't exist

       

      I know the table exists because I can go to another page and see all the entries so I'm sure it's there.

      I create the datasource and connection like this:

       

      // Access datasource and create connection

              InitialContext context = new InitialContext();

              DataSource datasource = (DataSource) context.lookup("java:/MySqlDS");

       

      // Create populated report

      try (final Connection connection = datasource.getConnection()) {

      JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, connection);


      // Export to browser

      HttpServletResponse res = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext() .getResponse(); ServletOutputStream os = res.getOutputStream();

      JasperExportManager.exportReportToPdfStream(jasperPrint, os);

           }

       

       

      So the question is: Why does it work so well locally but fails so badly on my production server and how do I get them to behave the same?