title: why my java web application doesn't send print in tomcat 7
body: <p>I developed a web application with JSP and Spring MVC in eclipse. When i run the application in eclipse works perfectly but when i loaded the war file in tomcat 7 when the application has to print a ticket it doesn't, and it doesn't throw a error. the next log is from localhost access</p>
  
  <pre><code>&gt; 127.0.0.1 - - [23/Jul/2012:11:41:29 -0600] "GET /LilyStore/ HTTP/1.1" 200 2866
  &gt; 127.0.0.1 - - [23/Jul/2012:11:41:29 -0600] "GET /LilyStore/Css//LiliStyle.css HTTP/1.1" 304 -
  &gt; 127.0.0.1 - - [23/Jul/2012:11:41:29 -0600] "GET /LilyStore/JS//funciones.js HTTP/1.1" 304 -
  &gt; 127.0.0.1 - - [23/Jul/2012:11:41:33 -0600] "POST /LilyStore/forms/validateLogin.html?parametro=jav&amp;param2=123 HTTP/1.1"
  &gt; 200 6606
  &gt; 127.0.0.1 - - [23/Jul/2012:11:41:33 -0600] "GET /LilyStore//Css//LiliStyle.css HTTP/1.1" 304 -
  &gt; 127.0.0.1 - - [23/Jul/2012:11:41:33 -0600] "GET /LilyStore//JS//funciones.js HTTP/1.1" 304 -
  &gt; 127.0.0.1 - - [23/Jul/2012:11:41:38 -0600] "GET /LilyStore/forms/showVentasPorRango HTTP/1.1" 200 9581
  &gt; 127.0.0.1 - - [23/Jul/2012:11:41:38 -0600] "GET /LilyStore//JS//calendar_eu.js HTTP/1.1" 304 -
  &gt; 127.0.0.1 - - [23/Jul/2012:11:41:39 -0600] "GET /LilyStore/forms/makeCorte.html HTTP/1.1" 200 9581
  </code></pre>
  
  <p>Catalina log its ok without errors the next part is the final lines of catalina log.jul </p>
  
  <pre><code>23, 2012 11:41:10 AM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
  INFO: Mapped URL path [/showVentasPorRangoMostrar.*] onto handler 'ventasControllerImpl'
  jul 23, 2012 11:41:10 AM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
  INFO: Mapped URL path [/showVentasPorRangoMostrar/] onto handler 'ventasControllerImpl'
  jul 23, 2012 11:41:10 AM org.springframework.web.servlet.FrameworkServlet initServletBean
  INFO: FrameworkServlet 'dispatcher': initialization completed in 5980 ms
  jul 23, 2012 11:41:10 AM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\docs
  jul 23, 2012 11:41:10 AM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\manager
  jul 23, 2012 11:41:10 AM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\ROOT
  jul 23, 2012 11:41:10 AM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["http-bio-8080"]
  jul 23, 2012 11:41:10 AM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["ajp-bio-8009"]
  jul 23, 2012 11:41:10 AM org.apache.catalina.startup.Catalina start
  INFO: Server startup in 9738 ms
  jul 23, 2012 11:52:47 AM org.apache.jasper.compiler.TldLocationsCache tldScanJar
  INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
  </code></pre>
  
  <p>In the program a file is created to print it. the method who print that file is as follows:</p>
  
  <pre><code>public void imprimir(String ticketName){
      DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
      //use the default printer
      PrintService service = PrintServiceLookup.lookupDefaultPrintService();
      if (service != null) {
          try {
              //create a print job
              DocPrintJob job = service.createPrintJob();
              //attributes of the job
              DocAttributeSet das = new HashDocAttributeSet();
              FileInputStream fis = new FileInputStream(ticket+".txt");
              Doc doc = new SimpleDoc(fis,flavor,das);
              try {
                  //the job is send it to the printer
                  job.print(doc,null);
              }
              catch(Exception e){
                  e.printStackTrace();
              }
          }
          catch(Exception e){
              e.printStackTrace();
          }
      }
  } 
  </code></pre>