Where is a Servlet instance stored in Tomcat?

Hi,
We know that servlet container generates ONLY ONE servlet instance which will handle all the client requests for the servlet. This makes big inconvenionce in debug phase using Tomcat server. Unless restarting the server, you will not be able to see the changes you made in the servlet class.
My question is where the servlet instance is stored in Tomcat. I think it should be in [TOMCAT_HOME]/work/ directory but actually not. My approach is deleting the instance before sending request to the servlet. In this way, servlet container will generate an instance of new version of the servlet class.
Is there any other way to work around that?
Thanks,

We know that servlet container generates ONLY ONE
servlet instance which will handle all the client
requests for the servlet. My Tomcat instance will pool servlet instances. It might look like only one instance to you, but that doesn't mean that Tomcat does it that way.
This makes big inconvenionce in debug phase using Tomcat server. This makes no sense to me. Are you talking about load testing?
Unless restarting the server, you will not be able to see the changes you made in the servlet class.This has nothing to do with debugging. And Tomcat has hot deployment now if you do it correctly with WAR files.
My question is where the servlet instance is stored in Tomcat. I think it should be in
[TOMCAT_HOME]/work/ directory but actually not. My approach is deleting the instance before sending
request to the servlet. In this way, servlet container will generate an instance of new version of the
servlet class.Sounds like you don't know how to deploy to Tomcat properly. Servlet .class files are stored where you put them: in the WEB-INF/classes directory for your Web app, in a JAR in the WEB-INF/lib directory for your Web app. These are either in the TOMCAT_HOME/webapps context directory that you create or, better yet, in the WAR file that you deploy to TOMCAT_HOME/webapps.
The /work directory that you refer to is where Tomcat puts generated Java code for JSPs.
Is there any other way to work around that?There's no way to change it, and there's no reason that I can think of to explain why you'd want to. What is the real problem here?

Similar Messages

  • Where the converted servlet is stored?

    Hi,
    when a JSP page is requested by a client, it is internally converted into a servlet. So i would like to know where that servlet is stored....
    I am using Tomcat server as web server.
    thx,
    -Soni.

    It should be inside your web-inf (most probably in a temp directory) directory under your tomcat server directory... probably you could search for _jspfilename.class in your server directory...you would find the same
    If you want to have a look at the source for the servlet generated with Tomcat 3.0 you need to change the isWorkDirPersistent attribute from false to true in the server.xml file found in your Tomcat directory.
    after that you can load the jsp and then source would be available in the tomcatDirectory/work/port-number directory
    Regards
    G

  • Where are the UIViewRoot instances stored??

    Hello,
    I have a basic question about JSF: I would like to know where the UIViewRoot instances are stored (for a given app with several UIViewRoots). Is it in some sort of java.util collection or in a specific class?
    Thanks in advance for your replies,
    Julien.

    It depends on the state saving method. If it is server-side, the view is serialized and stored into the session. If it is client-side the view is serialized, compressed and encoded to ascii with base64 encoding and sent to the client as hidden filed in the form.

  • Where the servlet information stored?

    where the servlet information stored if I overriding the function getServletInfo? I am using Tomcat 4.1.12

    It is stored in the servlet instance as a String variable. getServletInfo by default returns an empty String. When you over ride the method all of the information is stored in the servlet just like any other variable data.

  • Error allocating a servlet instance

    i have a problem with the migration de aplication
    the aplication it�s mountage in HP with Unix, with containner iPlanet, with data bases SyBASE; and migrated in mac os x with data bases in MySQL, container TomCat;
    show the next error:
    javax.servlet.ServletException: Error allocating a servlet instance
         at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:625)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:163)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         at java.lang.Thread.run(Thread.java:552)
    root cause
    java.lang.NoClassDefFoundError: ServletVerifyPsswd (wrong name: SCI/ServletVerifyPsswd)
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
         at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1649)
         at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:931)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1373)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1252)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:838)
         at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:621)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:163)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         at java.lang.Thread.run(Thread.java:552)
    configuration of the archive server.xml
    <Context path="/sci" docBase="sci"
    debug="5" reloadable="true" crossContext="true">
    <Logger className="org.apache.catalina.logger.FileLogger"
    prefix="localhost_sci_log." suffix=".txt"
    timestamp="true"/>
    <Resource name="jdbc/dbSCI"
    auth="Container"
    type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/dbSCI">
    <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <!-- Maximum number of dB connections in pool. Make sure you
    configure your mysqld max_connections large enough to handle
    all of your db connections. Set to 0 for no limit.
    -->
    <parameter>
    <name>maxActive</name>
    <value>100</value>
    </parameter>
    <!-- Maximum number of idle dB connections to retain in pool.
    Set to 0 for no limit.
    -->
    <parameter>
    <name>maxIdle</name>
    <value>30</value>
    </parameter>
    <!-- Maximum time to wait for a dB connection to become available
    in ms, in this example 10 seconds. An Exception is thrown if
    this timeout is exceeded. Set to -1 to wait indefinitely.
    -->
    <parameter>
    <name>maxWait</name>
    <value>10000</value>
    </parameter>
    <!-- MySQL dB username and password for dB connections -->
    <parameter>
    <name>username</name>
    <value>usersif</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>sifsci</value>
    </parameter>
    <!-- Class name for mm.mysql JDBC driver -->
    <parameter>
    <name>driverClassName</name>
    <value>com.mysql.jdbc.Driver</value>
    </parameter>
    <!-- The JDBC connection url for connecting to your MySQL dB.
    The autoReconnect=true argument to the url makes sure that the
    mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
    connection. mysqld by default closes idle connections after 8 hours.
    -->
    <parameter>
    <name>url</name>
    <value>jdbc:mysql://localhost:3306/bdsif?autoReconnect=true</value>
    </parameter>
    </ResourceParams>
    </Context>
    and the archive web.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <description>Sistema de Consultas Integrales</description>
    <display-name>Sistema de Consultas Integrales</display-name>
    <servlet>
    <servlet-name>Connect</servlet-name>
    <servlet-class>Connect</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Connect</servlet-name>
    <url-pattern>/servlet/Connect</url-pattern>
    </servlet-mapping>
    <servlet>
    <servlet-name>ServletAcuOperacionSIF</servlet-name>
    <servlet-class>ServletAcuOperacionSIFeClase</servlet-class>
    </servlet>
    mapping the servlet
    <resource-ref>
    <description>DB Coneccion</description>
    <res-ref-name>jdbc/dbSCI</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>

    package SCI;
    import javax.servlet.http.*;
    import javax.servlet.*;
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    import java.math.*;
    import java.text.*;
    public class ServletAcumuladoOp extends HttpServlet{
         private ServletOutputStream out = null;          
         private ResultSet resultado = null;
         private Statement query = null;
         private String tv;
         private String liq;
         public ServletAcumuladoOp(){
              super();
         public void init(){
         //System.out.println("Inicie el servicio del ServletAcumuladoOp...");
         try{
              Class.forName("com.mysql.jdbc.Driver");
                   //System.out.println("Carge el Driver Sybase...");
              }catch(java.lang.ClassNotFoundException e){
                   System.out.println("Imposible cargar la clase : "+e.getMessage()+" ,,,Verifique la Ruta");
         public boolean datosOk(HttpServletRequest req){
              //System.out.println(req.getRemoteUser());
              Enumeration e = req.getParameterNames();
              Hashtable ht = new Hashtable();          
              while (e.hasMoreElements()) {
                   String cad= (String) e.nextElement();
                   ht.put(cad," ");          
              //     System.out.println(cad);     
              if ( ht.containsKey("TV_AS") && ht.containsKey("Liq") ){
                   tv = "";
                   liq = "";
                   liq = req.getParameter("Liq");
                   tv = req.getParameter("TV_AS");
              }else{
                   return false;
              return true;
         protected synchronized void doPost(HttpServletRequest req, HttpServletResponse res)
         throws IOException, ServletException{
              res.setContentType("text/html");
    out = res.getOutputStream();          
              out.println("<html>\n<head>\n<title>Acumulado de operaciones</title>\n</head>\n<body background='../../../../../SCI/GRA/fondo.jpg'><center>");
              if (datosOk(req)){
                   out.println("<TABLE BORDER=0 width=740 cellspacing=0 cellpadding=0>\n");
                   out.println("<tr>\n");
                   out.println("<td valign='top'><font face='Verdana,Arial' size=2 color='black'><b>");               
                   out.println("Acumulado de operaciones");
                   out.println("</b></TD>\n");
                   out.println("<td ALIGN=RIGHT valign='top'><font face='Verdana,Arial' size=1 color='black'>"+getFechaLocal()+"</FONT></TD>\n");
                   out.println("</tr>\n");
                   out.println("<tr>\n");
                   out.println("<TD colspan=2 align='left' valign='top'>\n");
                   out.println("<font face='Verdana,Arial' size=2 color='black'>\n");
                   if (tv.equals("") || tv.equals("*"))
                        out.println("Tipo de valor: <B>Todos</B>");
                   else
                        out.println("Tipo de valor: <B>"+tv+"</B>");
                   if (liq.equals("") || liq.equals("*"))
                        out.println(", Liquidaci&oacute;n: <B>Todas</B>");
                   else
                        out.println(", Liquidaci&oacute;n: <B>"+liq+"</B>");
                   out.println("</font></TD>\n");
                   out.println("</TR>\n");
                   out.println("</table>\n");
                   out.println("<br>\n");
                   if (getConsulta())                    
                        out.println("</TABLE>\n<HR color=Black width=740>\n</center></BODY>\n</HTML>");
                   else
                        out.println("<br><center><font face='Verdana,Arial' size=4 color=Red>No existen datos para este rango de fechas</font></center>\n</BODY>\n</HTML>");
              }else{
                   out.println("<BR><font face='Verdana,Arial' size=4 color=Red> Se ha producido un error interno... Los par�metros de este Servlet son incorrectos \n</font>\n</BODY>\n</HTML>");
              out.close();          
         public void setHead()throws IOException{
              out.println("<table border=0 width=740 height=30 cellspacing=0 cellpadding=0>\n<tr>\n");
              out.println("<td width=60 align=center ><font face='Verdana,Arial' size=-1><b>Inst</td>\n");
              out.println("<td width=60 align=center ><font face='Verdana,Arial' size=-1><b>Emisora</td>\n");
              out.println("<td width=40 align=center><font face='Verdana,Arial' size=-1><b>Liq</td>\n");
              out.println("<td width=50 align=center><font face='Verdana,Arial' size=-1><b>Oper</td>\n");
              out.println("<td width=70 align=center><font face='Verdana,Arial' size=-1><b>N Series</td>\n");
              out.println("<td width=70 align=center><font face='Verdana,Arial' size=-1><b>N Oper</td>\n");
              out.println("<td width=150 align=center><font face='Verdana,Arial' size=-1><b>Vol�men</td>\n");
              out.println("<td width=150 align=center><font face='Verdana,Arial' size=-1><b>Importe</td>\n");
              out.println("<td width=90 align=center><font face='Verdana,Arial' size=-1><b>% Part.</td>\n");
              out.println("</tr>");
         public boolean getConsulta() throws IOException{
              Connection conexion = getConexion();
              try{
                   DecimalFormat df = new DecimalFormat("###,###,###,###,###.00");
                   String cadTV = "";
                   String cadLiq = "";
                   int cont = 0;
                   double operaciones_total = 0;
                   double volumen_total = 0;
                   double importe_total = 0;
                   double operaciones_subtot = 0;
                   double volumen_subtot = 0;
                   double importe_subtot = 0;
                   double suma_total_importe = 0;
                   double porcentaje = 0;
                   boolean ok = false;
                   int cent = 0;
                   boolean bandera = true;
                   int col = 0;
                   String color = "";
                   //Determina si ya cerr� el mercado
                   query=conexion.createStatement();
                   String sql = "select ctr_estado from ctrlre";
                   resultado=query.executeQuery(sql);
                   while (resultado.next())
                        cadTV = resultado.getString(1);
                   out.println("<table border=0 width=740 height=30 cellspacing=0 cellpadding=0 >");
                   out.println("<TR>");
                   out.println("<TD bgcolor='#FFFFBB' align=right><FONT face='Verdana,Arial'><b>");
                   if ( cadTV.equals("NO") )
                        out.println("DEFINITIVO</b></FONT> </TD> </TR> </table>\n");
                   else
                        out.println("PRELIMINAR</b></FONT> </TD> </TR> </table>\n");
                   out.println("<BR>");
                   cadTV="";
                   sql = getSql();
                   query = conexion.createStatement();
                   resultado = query.executeQuery(sql);
                   //out.println(sql);
                   while(resultado.next()){
                        if (bandera){
                             setHead();
                             bandera = false;
                        String tvalor = resultado.getString(1); //thp_tipo_valor
                        String emisora = resultado.getString(2); //thp_emisora
                        String liquidacion = resultado.getString(3); //thp_liquidacion
                        String toperacion = resultado.getString(4); //thp_tipo_operacion
                        int series = resultado.getInt(5); //series
                        int operaciones = resultado.getInt(6); //operaciones
                        double volumen = resultado.getDouble(7);; //thp_volumen
                        double importe = resultado.getDouble(8);; //thp_importe
                        // Salida al browser
                        if (cont == 0){
                             cadTV = tvalor.trim();
                             cadLiq = liquidacion.trim();
                             suma_total_importe = getTotalImporte(tvalor, liquidacion);
                        if (col == 1){                         
                             color = "#E1E1E1";
                             col = -1;
                        if (col == 0)
                             color = "#FFFFFF";
                        col++;
                        if ( (!cadTV.equals(tvalor.trim()) || !cadLiq.equals(liquidacion.trim()) )&& cont != 0){
                             setSubTotal(cadLiq, operaciones_subtot, volumen_subtot, importe_subtot, df);
                             suma_total_importe = getTotalImporte(tvalor, liquidacion);
                             // Agrega a sumas totales               
                             operaciones_total = operaciones_total + operaciones_subtot;
                             volumen_total = volumen_total + volumen_subtot;
                             importe_total = importe_total + importe_subtot;
                             operaciones_subtot = 0;
                             volumen_subtot = 0;
                             importe_subtot = 0;
                             cadTV = tvalor.trim();
                             cadLiq = liquidacion.trim();
                             cont=0;
                             out.flush();
                        operaciones_subtot = operaciones_subtot + operaciones;
                        volumen_subtot = volumen_subtot + volumen;
                        importe_subtot = importe_subtot + importe;
                        if (suma_total_importe == 0)
                             porcentaje = 0;
                        else
                             porcentaje = ( importe * 100 ) / suma_total_importe;
                        setRow(color,
                        " "+tvalor,
                        " "+emisora,
                        " "+liquidacion,
                        " "+toperacion,
                        " "+series,
                        " "+operaciones,
                        " "+df.format(volumen),
                        " "+df.format(importe),
                        " "+getScala(porcentaje,2));
                        cont++;
                        cent++;
                   conexion.close();
                   if (cent==0){ // No hubo registros
                        return false;
                   if (cont!=0){
                        setSubTotal(cadLiq, operaciones_subtot, volumen_subtot, importe_subtot, df);
                        // Agrega a sumas totales               
                        operaciones_total = operaciones_total + operaciones_subtot;
                        volumen_total = volumen_total + volumen_subtot;
                        importe_total = importe_total + importe_subtot;
                   setTotal(operaciones_total, volumen_total, importe_total, df);
              }catch(SQLException e){
                   System.out.println("Codigo de Error :"+e.getErrorCode());
                   System.out.println("Descripci�n del error :"+e.getMessage());
                   System.out.println("Estado del SQL :"+e.getSQLState());                    
              return true;
         public String getSql(){
              String sql1="select thp_tipo_valor, thp_emisora, thp_liquidacion, thp_tipo_operacion, "+
         "count(distinct(thp_emision)), count(thp_folio), sum(thp_volumen), sum(thp_importe) "+
                   "from thecprod "+
                   "where ( thp_tipo_valor = '"+tv+"' or '"+tv+"'='*') and "+
                   " ( thp_liquidacion = '"+liq+"' or '"+liq+"'='*') "+
                   "group by thp_tipo_valor, thp_emisora, thp_liquidacion, thp_tipo_operacion";
              return sql1;
         public void setRow(String a1,String a2,String a3,String a4,String a5,String a6,String a7,String a8,
                                  String a9, String a10) throws IOException{
                   out.println("<tr bgcolor='"+a1+"'"+" align=center bordercolor='"+a1+"' bordercolorlight='"+a1+"' bordercolordark='"+a1+"'>\n");
                   out.println("<td width=60 align=center><font face='Verdana,Arial' size=-1>"+a2+"</td>\n");
                   out.println("<td width=60 align=center><font face='Verdana,Arial' size=-1>"+a3+"</td>\n");
                   out.println("<td width=40 align=center><font face='Verdana,Arial' size=-1>"+a4+"</td>\n");
                   out.println("<td width=50 align=center><font face='Verdana,Arial' size=-1>"+a5+"</td>\n");
                   out.println("<td width=70 align=center><font face='Verdana,Arial' size=-1>"+a6+"</td>\n");
                   out.println("<td width=70 align=center><font face='Verdana,Arial' size=-1>"+a7+"</td>\n");
                   out.println("<td width=150 align=right><font face='Verdana,Arial' size=-1>"+a8+"</td>\n");
                   out.println("<td width=150 align=right><font face='Verdana,Arial' size=-1>"+a9+"</td>\n");
                   out.println("<td width=90 align=right><font face='Verdana,Arial' size=-1>"+a10+"%</td>\n");
                   out.println("</tr>\n");
         public void setSubTotal(String liquidacion, double operaciones_sub, double volumen_sub, double importe_sub, DecimalFormat df)throws IOException {
              out.println("<tr>\n");
                   out.println("<td width=60 align=center bgcolor=#FFFFFF><font face='Verdana,Arial' size=-1> </td>\n");
                   out.println("<td width=60 align=center bgcolor=#FFFFFF><font face='Verdana,Arial' size=-1> </td>\n");
                   out.println("<td width=40 align=center bgcolor=#ffffbb><font face='Verdana,Arial' size=-1>"+liquidacion+"</td>\n");
                   out.println("<td width=50 align=center bgcolor=#ffffbb><font face='Verdana,Arial' size=-1>Total</td>\n");
                   out.println("<td width=70 align=center bgcolor=#ffffbb><font face='Verdana,Arial' size=-1> </td>\n");
                   out.println("<td width=70 align=center bgcolor=#ffffbb><font face='Verdana,Arial' size=-1>"+getScala(operaciones_sub,0)+"</td>\n");
                   out.println("<td width=150 align=right bgcolor=#ffffbb><font face='Verdana,Arial' size=-1>"+df.format(volumen_sub)+"</td>\n");
                   out.println("<td width=150 align=right bgcolor=#ffffbb><font face='Verdana,Arial' size=-1>"+df.format(importe_sub)+"</td>\n");
                   out.println("<td width=90 align=right bgcolor=#ffffbb><font face='Verdana,Arial' size=-1>100.00%</td>\n");
                   out.println("</tr>\n");
         public void setTotal(double operaciones_total, double volumen_total, double importe_total, DecimalFormat df)throws IOException {
              out.println("<tr>\n");
                   out.println("<td width=60 align=center bgcolor=#FFFFFF><font face='Verdana,Arial' size=-1> </td>\n");
                   out.println("<td width=60 align=center bgcolor=#FFFFFF><font face='Verdana,Arial' size=-1> </td>\n");
                   out.println("<td width=40 align=center bgcolor=#FFFFFF><font face='Verdana,Arial' size=-1> </td>\n");
                   out.println("<td width=50 align=center bgcolor=#FFFFFF><font face='Verdana,Arial' size=-1> </td>\n");
                   out.println("<td width=70 align=center bgcolor=#FFFFFF><font face='Verdana,Arial' size=-1> </td>\n");
                   out.println("<td width=70 align=center bgcolor=#b5cffb><font face='Verdana,Arial' size=-1>"+getScala(operaciones_total,0)+"</td>\n");
                   out.println("<td width=150 align=right bgcolor=#b5cffb><font face='Verdana,Arial' size=-1><b>"+df.format(volumen_total)+"</td>\n");
                   out.println("<td width=150 align=right bgcolor=#b5cffb><font face='Verdana,Arial' size=-1><b>"+df.format(importe_total)+"</td>\n");
                   out.println("<td width=90 align=right bgcolor=#b5cffb><font face='Verdana,Arial' size=-1><b> </td>\n");
                   out.println("</tr>\n");
         public String getScala(double val, int uno){
              BigDecimal bd = new BigDecimal(val);
              return " "+bd.setScale(uno,5);
         protected synchronized double getTotalImporte(String tipovalor, String liquidacion){          
              double total = 0;
              try{
                   Connection conexion1 = getConexion();
                   Statement q = conexion1.createStatement();
                   String sql ="";
                   sql = "select sum(thp_importe) from thecprod where thp_tipo_valor = '"+tipovalor+"' and thp_liquidacion = '"+liquidacion+"'";
                   ResultSet res = q.executeQuery(sql);
                   while(res.next()){
                        total = res.getDouble(1);
                   res.close();
                   conexion1.close();               
              }catch(SQLException e){
                   System.out.println("Codigo de Error :"+e.getErrorCode());
                   System.out.println("Descripci�n del error :"+e.getMessage());
                   System.out.println("Estado del SQL :"+e.getSQLState());
              return total;
         public Connection getConexion(){
              String url ="jdbc:mysql//localhost:3306/bdsif";
              Connection conexion = null;
              try{
                   conexion = DriverManager.getConnection(url, "usersif", "password");
              }catch(SQLException e){
                   System.out.println("Codigo de Error :"+e.getErrorCode());
                   System.out.println("Descripci�n del error :"+e.getMessage());
                   System.out.println("Estado del SQL :"+e.getSQLState());
              return conexion;
         public String getFechaLocal(){
              java.util.Date today;
              String output;
              java.text.SimpleDateFormat formatter;
              formatter = new java.text.SimpleDateFormat("EEEEEEEEE dd 'de' MMMMMMMMMM 'del' yyyy", new Locale("es", "Spanish"));
              today = new java.util.Date();
              return " "+formatter.format(today);          
         public void destroy(){
    //     System.out.println("Destrui el ServletAcumuladoOp...");
    }

  • Where is the port information stored in HSS for HSS mode Essbase servers?

    In order to test .sec file validity, I started up a temporary server on port 1426. The .sec file was copied from an existing SS mode Essbase server. This worked fine and I stopped the temporary server. However, now in Shared Services, the Global "Analytical Server" instance inside the "Analytical Servers" project now points to port 1426. I can no longer manage the real server on port 1423 in HSS. Can somebody tell me where this port information is stored so I can change it?
    I don't want to have to re-externalise and mess about like that because I tried this on a test box and got into a horrible mess because externalising creates new analytical server instances in HSS with a new index number which doesn't match the original one etc. Horribly mess.
    This port number must be stored somewhere in HSS? It's not in OpenLDAP I think as I exported the whole server as LDIF and the string "1426" does not occur in the export. Couldn't find it in the HS9_HSS database either but perhaps I missed it.

    For reference, I found out how to fix this:
    Look in the Repository HS9_HSS for the table VERSION_CONTENT
    in the HUGEBLOBS (which are XML fragments), you'll find the the settings. Export, alter, import.
    Restart HSS and Admin services.

  • Trying to make oracle-xsql-servlet to work under tomcat

    I am trying setup Setup "oracle-xsql-servlet" to work under tomcat.
    #1. I have installed the xdk from orcale at "C:\xdk_nt_10_1_0_2_0_production"
    #2. I have installed "Apache Tomcat Version 6.0.14"
    #3.
    I have made the following changes to "catalina.bat"
    REM Added for Oracle XSQL Servlet
    REM -----------------------------
    set CLASSPATH=%CLASSPATH%;C:\xdk_nt_10_1_0_2_0_production\lib\xsu12.jar
    set CLASSPATH=%CLASSPATH%;C:\xdk_nt_10_1_0_2_0_production\lib\oraclexsql.jar
    set CLASSPATH=%CLASSPATH%;C:\xdk_nt_10_1_0_2_0_production\lib\xmlparserv2.jar
    set CLASSPATH=%CLASSPATH%;C:\xdk_nt_10_1_0_2_0_production\lib\classes111.zip
    set CLASSPATH=%CLASSPATH%;C:\xdk_nt_10_1_0_2_0_production\xdk\admin
    echo %CLASSPATH%
    #4 created a new folder under "C:\apache-tomcat-6.0.14\apache-tomcat-6.0.14\webapps" xdk
    and created a web.xml in it. Following are the entries is the web.xml:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
         <description>
    XDK Examples.
    </description>
         <display-name>XDK Examples</display-name>
         <servlet>
              <servlet-name>oracle-xsql-servlet</servlet-name>
              <servlet-class>oracle.xml.xsql.XSQLServlet</servlet-class>
              <load-on-startup>1</load-on-startup>
         </servlet>
         <servlet-mapping>
              <servlet-name>oracle-xsql-servlet</servlet-name>
              <url-pattern> *.xsql </url-pattern>
         </servlet-mapping>
    </web-app>
    PROBLEM. When I start up tomcat, I keep getting the following errors.
    SEVERE: Error deploying web application directory xdk
    java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)     
    OTHER APPLICATIONS such as Examples (provided by apache) work fine.
    Any ideas ?

    XSQL may be used with Tomcat 3.1 and 3.2.
    Refer to section Jakarta Tomcat 3.1 or 3.2
    http://www.oracle.com/technology/tech/xml/xdk/doc/production10g/doc/java/xsql/xsql_userguide.html#ID3386

  • Servlet instance problem

    Hi
    I am have a web application that does a lot of processing. when 2 users submit the form.. i noticed that one instance of the servlet is running and the other request waits for some time for
    processor and just dies off.. Servlets are suppose to be thread safe and 'n' number of intances can be created . why only one
    instance running at a given time.. My servlet is not a single instance servlet and i have not placed an restrictions of that sort..
    can anyone help me with this ??
    rgds
    satish

    I have written the processing part in dopost method.. which takes a few seconds to finish for each instance (creatting a huge array of objects ). Then i keep the reference of this in session. While the objects are being generated, if i send another request the first servlets dies and the second one proceeds , sometimes second one dies off after waiting for something..
    yes i am testing by 2 users from 2 different machines.its not the connection problem.. the systems.outs show that both the servlet instances are running at one point of time then suddenly one dies.. i have allocated 1000m to tomcat... so memory is not a problem i suppose..
    Any helping tips ?
    rgds
    satish

  • Where is javax.servlet.http.HttpSessionBindingListener;?

    hello
    where is javax.servlet.http.HttpSessionBindingListener
    what do i ened in my classpath under jakarta/tomcat to make thi available?

    so i have this in my autoexec.bat
    set CLASSPATH=C:\j2sdk1.4.0\jre\lib\ext;c:\j2sdk1.4.0\lib\comm.jar;C:\jakarta-tomcat-4.0.1\webapps\ROOT\WEB-INF\classes\;C:\jakarta-tomcat-4.0.1\common\lib\;and still it does not see the package i need.
    am i missing something here?
    --jN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • HELP!!!! -- Error allocating a servlet instance

    Please help me...
    The deathline for my schoolproject is getting close!!!
    - 2 weeks ago everything worked fine
    - now i wanted to start at making the last changes...
    but...the only thing a get is this...
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Error allocating a servlet instance
         at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:670)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
         at java.lang.Thread.run(Thread.java:536)
    root cause
    java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:502)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:292)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1274)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:884)
         at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:666)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
         at java.lang.Thread.run(Thread.java:536)

    The actual bizare thing in all this is that everything worked fine 2 weeks ago and that i touched nothing in the meanwhile...
    Important to note is also that the examples of tomcat still work fine so that i know that servlet.jar is at his place and in fact still being used correctly, at least in those examples.
    What the servlet itself consernes, by putting a println-statement at the beginning of the init-method i can conclude that he doesn't seems to be able to reach the servlet at all. (compilation of all my files works still without any problems)
    Could it be possible that my problem has something to do with the web.xml file? Ok, he worked alright...but maybe something isn't quite as it should be...
    Thx for the responses!!!
    Maybe you guys can help me further with this information...I at least hope so!
    greetings
    steven

  • Servlet Instances

    How can we differentiate between Servlet instances and threads.
    Actuaaly i want to know how a servlet handles multiple client requests at the same time.
    what i know is like:::
    a client sends a request to the server.
    A new thread is generated which will call the instance of the serlvlet on the server for processing..
    Is this flow is correct???
    am bit confused between threads and instances.
    Please help!!!!

    If you make that your servlets implement the
    SingleThreadModel interface (definition below), then
    you can configure Tomcat with the size of the pool. I
    think that even you can have only one instance, but
    this is not very advisable, unless you want your users
    to wait...Thnx for reply, Do you know how I can tell Tomcat to start multiple instances or alway stick with single instance. I cannot find this.
    "public interface SingleThreadModel
    Ensures that servlets handle only one request at a
    time. This interface has no methods. Yes I am aware of this.
    If a servlet implements this interface, you are
    guaranteed that no two threads will execute
    concurrently in the servlet's service method. The
    servlet container can make this guarantee by
    synchronizing access to a single instance of the
    servlet, or by maintaining a pool of servlet instances
    and dispatching each new request to a free servlet.
    This interface does not prevent synchronization
    problems that result from servlets accessing shared
    resources such as static class variables or classes
    outside the scope of the servlet."If only one user can access the servlet using this interface then why would you want syncrhonization??? There shouldn't be synchornization issues with a servlet that implements SingleThreadModel right??

  • Where does a servlet reside?

    I am using NetBeans 5.5,
    Tomcat folder is located at C:\jakarta-tomcat-5.0.25
    Suppose the code.
    // Fig. 26.6: WelcomeServlet.java
    // A simple servlet to process get requests.
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import java.io.IOException;
    import java.io.PrintWriter;
    public class WelcomeServlet extends HttpServlet
       // process "get" requests from clients
       protected void doGet( HttpServletRequest request,
          HttpServletResponse response )
             throws ServletException, IOException
          response.setContentType( "text/html" );
          PrintWriter out = response.getWriter(); 
          // send XHTML page to client
          // start XHTML document
          out.println( "<?xml version = \"1.0\"?>" );
    //      out.printf( "%s%s%s", "<!DOCTYPE html PUBLIC",
    //         " \"-//W3C//DTD XHTML 1.0 Strict//EN\"",
    //         " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n" );
          out.println( "<html xmlns = \"http://www.w3.org/1999/xhtml\">" );
          // head section of document
          out.println( "<head>" );
          out.println( "<title>A Simple Servlet Example</title>" );
          out.println( "</head>" );
          // body section of document
          out.println( "<body>" );
          out.println( "<h1>Welcome to Servlets!</h1>" );
          out.println( "</body>" );
          // end XHTML document
          out.println( "</html>" );
          out.close();  // close stream to complete the page
       } // end method doGet
    } // end class WelcomeServletand index.jsp is
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%--
    The taglib directive below imports the JSTL library. If you uncomment it,
    you must also add the JSTL library to the project. The Add Library... action
    on Libraries node in Projects view can be used to add the JSTL 1.1 library.
    --%>
    <%--
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    --%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
        </head>
        <body>
        <form action="/jhtp6/WelcomeServlet" method="get">
            <p><label>Click the button to invoke the servlet
                <input type="submit" value = "Get HTML Document" /></label></p>
        </form>
        <%--
        This example uses JSTL, uncomment the taglib directive above.
        To test, display the page like this: index.jsp?sayHello=true&name=Murphy
        --%>
        <%--
        <c:if test="${param.sayHello}">
            <!-- Let's welcome the user ${param.name} -->
            Hello ${param.name}!
        </c:if>
        --%>
        </body>
    </html>My question is where is the physical location of the file "WelcomeServlet" ?
    Do I need create a subdirectory "jhtp6" manually somewhere?
    I get the error message:
    HTTP Status 404 - /jhtp6/WelcomeServlet
    type Status report
    message /jhtp6/WelcomeServlet
    description The requested resource (/jhtp6/WelcomeServlet) is not available.
    Apache Tomcat/5.5.17Thanks for your advice!

    hi,
    common things... do it upto well known
    store your servlet in C:\jakarta-tomcat-5.0.25\webapps\root\WEB-INF\classes
    if no classes folder create there and store
    store your jsp in C:\jakarta-tomcat-5.0.25\webapps\root\
    run your jsp file
    http://localhost:8080/filename.jsp

  • Table where the Delivery date is stored in Confirmation tab on Me23n

    Hello ABAB Gurus,
                               Can anyone give me the table name where the Delivery date is stored in Confirmation tab in Item in ME23n.
                                  If anyone is aware of it then please let me know .
    Sagar

    Hi,
    Check the table EKES and field name is EINDT..
    Thanks,
    Naren

  • How can I run two instances of apache tomcat in the same machine.

    Hi
    Can I run 2 instances of apache tomcat in the same machine.If yes then how.?

    Yes, you can. Just run 2 instances. Make sure that they run on different ports.

  • Where is iTunes Match content stored on apple TV? I recently joined itunes match and it is working on my ios devices, but I can't find my music on Apple TV

    Where is iTunes Match content stored on apple TV? I recently joined itunes match and it is working on my ios devices, but I can't find my uploaded music on Apple TV

    It isn't actually stored anywhere, it needs to be downloaded from the internet before any content can be played.
    iTunes Match content is accessed through the 'Music' icon on the main screen though, it needs turning on though in settings first.

Maybe you are looking for