Note that there are some explanatory texts on larger screens.

plurals
  1. POservlet has to be reloaded everyday
    primarykey
    data
    text
    <p>I have created a servlet to access a database and giving response to a BB application...it was running fine during development...but after loading it on a tomcat server 6.0 after goining live the servlet has to be reloaded every morning on the tomcat server....after that it works fine during the whole day..but the next morning when i request something it gives a blank page as response and my server admin tells the servlet has to be reloaded ... other application hosted on the server are working fine and do not need a restart...</p> <p>what might be the problem....</p> <p>adding the code ..if it helps</p> <pre><code> package com.ams.servlets; import java.io.*; import javax.servlet.*; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.sql.*; import com.cms.dbaccess.DataAccess; import com.cms.utils.ApplicationConstants; import com.cms.utils.ApplicationHelper; import java.sql.ResultSet; public class BBRequestProcessorServlet extends HttpServlet { /** * */String userString; private static final long serialVersionUID = 1L; String jsonString = ""; ResultSet rs = null; Connection connection = null; Statement statement=null; public enum db_name { //Test resource_management_db,osms_inventory_db; } public void init(ServletConfig config)throws ServletException { super.init(config); System.out.println("Inside init"); } public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException { try{ connection = DataAccess.connectToDatabase("xxx", connection); statement = DataAccess.createStatement(connection); statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); rs = statement.executeQuery("query is here"); } catch(SQLException e) { e.printStackTrace(); } String db =request.getParameter("db"); System.out.println("DATABASE NAME :"+ db); if(db.equalsIgnoreCase("xxx")){ //Call to populate JSONArray with the fetch ResultSet data jsonString = ApplicationHelper.populateJSONArray(rs); } response.setContentType(ApplicationConstants.JSON_CONTENT_TYPE); PrintWriter out = response.getWriter(); out.print(jsonString); out.flush(); out.close(); System.out.println("json object sent"); try { rs.close(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } </code></pre> <p>the only errors i could find was Jul 20, 2012 9:57:24 AM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(/usr/local/tomcat/apache-tomcat-6.0.20/webapps/MobileServlet /WEB-INF/lib/servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload