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

Similar Messages

  • Servlet Loading problem

    Hello!
    I have been working with servlets for about 2 years now and have never encountered such a nasty problem before. I just created a test hello.java servlet and I keep getting this error:
    avax.servlet.ServletException: Cannot allocate servlet instance for path /servlet/hello
         org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:388)
         org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:133)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.doFilter(VirtualHostFilter.java:169)
    root cause
    java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
         java.lang.ClassLoader.defineClass1(Native Method)
         java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
         java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         java.security.AccessController.doPrivileged(Native Method)
         java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
         java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1267)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1198)
         org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:369)
         org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:133)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.doFilter(VirtualHostFilter.java:169)
    1. I've uncommented web.xml in /conf for custom servlet invoker and servlet-mapping for /servlet
    2. I've added custom hello servlet configuration into web.xml in WEB-INF
    3. I've bee googling around and the setclasspath.sh looks fine
    4. when I type 'which java" I get: /usr/java/jdk1.5.0_11/
    5. when I run tomcat I get:
    Using CATALINA_BASE: /home/victor/liferay42
    Using CATALINA_HOME: /home/victor/liferay42
    Using CATALINA_TMPDIR: /home/victor/liferay42/temp
    Using JRE_HOME: /usr/java/jdk1.5.0_11/
    We use liferay4.2 portal but it's Tomcat-based so the same configurations apply.
    Please help, I did all the usual configurations but I still keep getting this error. Weird thing is that I have EXACTLY the same configuration in our production server and servlets get loaded fine there.
    Thank you,
    Victor.

    Problem solved.
    1. Added JAVA_HOME=/usr/java/jdk1.5.0_11/ into my startup.sh (just like on production server)
    2. Made my servlet class 'public' - now this one I should have gotten ... so embarassing :-(
    Victor.

  • Restricting Thread Pool for Servlet instances

    I am using WebLogic5.1.0 version wherein I am registering a Servlet which
    would be called by all the clients connecting
    to my aplication. The servlet's service methods is taking some time to
    execute. Since the servlet is following a SingleThreadModel, when there are
    a large number of Clients connected, the number instances of Servlets
    created are very high and the number of thread in the Application Server
    process becomes very high affecting the performance of the other
    applications.
    Is it possible to restrict the number of instances of the servlets that get
    created in the Application server ?
    What are the setting required to achieve this ?
    Sandeep

    Hi.
    I'm not aware of a property setting that allows you to restrict the number of
    servlet instances in WLS for the SingleThreadModel. The number of execute
    threads is fixed - it does not grow depending on load. You can set this value
    in the weblogic.properties file by setting weblogic.system.executeThreadCount.
    This value is 15 by default.
    It does sound like you are reaching the max capability of your
    server/hardware. You should try tuning WLS.
    Here are a couple of suggestions:
    1. Try adjusting the executeThreadCount value to a higher value. Start by
    setting it to 30 - see if that makes any difference.
    2. Check out the following tuning guide:
    http://www.weblogic.com/docs51/admindocs/tuning.html
    3. Here is a list of admin properties that might aid in tuning:
    http://www.weblogic.com/docs51/adminhelp/AdminPropertyHelp.html
    4. If you are still having problems you might do better by posting this issue
    to the performance newsgroup.
    Regards,
    Michael
    Sandeep Rajpathak wrote:
    I am using WebLogic5.1.0 version wherein I am registering a Servlet which
    would be called by all the clients connecting
    to my aplication. The servlet's service methods is taking some time to
    execute. Since the servlet is following a SingleThreadModel, when there are
    a large number of Clients connected, the number instances of Servlets
    created are very high and the number of thread in the Application Server
    process becomes very high affecting the performance of the other
    applications.
    Is it possible to restrict the number of instances of the servlets that get
    created in the Application server ?
    What are the setting required to achieve this ?
    Sandeep--
    Michael Young
    Developer Relations Engineer
    BEA Support

  • 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 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?

  • Servlet cluster problem

    I am having trouble with a wls6.1 cluster. I am trying write a pdf out
              via a servlet. When I run the following code with the cluster turned
              off I have no problems. If I turn it on the servlet is returning no
              data. I am including the servlet and the stack trace in case someone
              can help. GenericFileObject.getTheFile returns a byte array.
              Jeff
              public void service(HttpServletRequest request, HttpServletResponse
              response) throws ServletException, IOException {
              DataOutputStream activityreportOut = new
              DataOutputStream(response.getOutputStream());
                        try {
                        HttpSession session=request.getSession(true);
                        response.setContentType("application/pdf");
                   String fileid = request.getParameter("fileid");
              String type=request.getParameter("type");
                        byte[] buffer;
                   ClientFacadeHome cfhome = (ClientFacadeHome)
                   EJBHomeFactory.getInstance().getBeanHome(Constants.CLASS_CLIENT_FACADE,
              Constants.JNDI_CLIENT_FACADE);
                   ClientFacade cf= cfhome.create();
                        GenericFileObject file =(GenericFileObject)
              cf.getFile(fileid,type);
                   buffer =(byte[]) file.getThefile();
                   activityreportOut.write(buffer);
              catch (Exception e){
                   e.printStackTrace();
              activityreportOut.flush();
              java.io.IOException: Broken pipe
              at java.net.SocketOutputStream.socketWrite(Native Method)
              at java.net.SocketOutputStream.write(Unknown Source)
              at weblogic.servlet.internal.ChunkUtils.writeChunkTransfer(ChunkUtils.java:189)
              at weblogic.servlet.internal.ChunkUtils.writeChunks(ChunkUtils.java:165)
              at weblogic.servlet.internal.ChunkOutput.flush(ChunkOutput.java:248)
              at weblogic.servlet.internal.ChunkOutput.checkForFlush(ChunkOutput.java:306)
              at weblogic.servlet.internal.ChunkOutput.write(ChunkOutput.java:197)
              at weblogic.servlet.internal.ChunkOutputWrapper.write(ChunkOutputWrapper.java:121)
              at weblogic.servlet.internal.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:155)
              at java.io.DataOutputStream.write(Unknown Source)
              at java.io.FilterOutputStream.write(Unknown Source)
              at com.bi.micardis.security.clientaction.ActivityAndScriptServlet.service(ActivityAndScriptServlet.java:41)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2456)
              at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2039)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              

              "Subir Das" <[email protected]> wrote:
              >So, Applet#1 will always talk to the servlet hosted by WLInstance#1 and
              >Applet#2
              >will always talk to the servlet hosted by WLInstance#2.
              This statement is not entirely true.
              Suppose WLInstance#1 were to be brought down (for whatever reason), Applet#1 will
              then talk to servlet hosted by WLInstance#2.
              Server pinning could be modified by different load balancing algorithms, configurable
              via containers (or hardware).
              So don't count on which servlet instance your applet is going to be served by.
              Instead consider to give a second look into the design of the servlet data structure
              (object):
              1.Read from data store, if it has been persisted.
              2.If the data is client related then consider sticking the data into session, which
              would then replicate to other WL instances.
              3.Stateless EJB in a cluster ? Don' know much about this(yet).
              My 2 cents..Good luck.
              Rama
              

  • 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??

  • OC4J / more servlet instances on startup

    Runninng SingleThreadModel-Servlet on OC4J want to initialize 10 servlet-instances on startup of my container. Can somebody tell me how should I configure OC4J to get it ???
    best regards
    Stan

    I've solved the said problem. I need to add load-on-startup to <default-web-app application="default" name="defaultWebApp" root="/j2ee" load-on-startup="true"/>.
    James Thanks for sending the solution James.
    -steve-

  • Servlet Compilation Problem !

    Hi,
    I am just starting to learn servlets and I got problem in compiling them. I got compilation error in
    import javax.servlet.*;statement. Seems that the compiler cannot find the servlet package. I got J2EE 1.4 beta installed on my machine but there is no servlet.jar package. I am using J2SDK 1.4.1_02, J2EE 1.4 beta and Tomcat 4.1.24.
    Can anyone help me with my servlet compilation problem?
    Thanks in advance!
    Josh

    servlet.jar is here :
    <tomcatdir>\common\lib
    add it to your compiler classpath

  • Servlet chaining problem..

    import java.io.*;
        import javax.servlet.*;
        import javax.servlet.http.*;
        public class Deblink extends HttpServlet {
          public void doGet(HttpServletRequest req, HttpServletResponse res)
                                       throws ServletException, IOException {
            String contentType = req.getContentType();  // get the incoming type
            if (contentType == null) return;  // nothing incoming, nothing to do
            res.setContentType(contentType);  // set outgoing type to be incoming type
            PrintWriter out = res.getWriter();
            BufferedReader in = req.getReader();
            String line = null;
            while ((line = in.readLine()) != null) {
              line = replace(line, "<BLINK>", "");
              line = replace(line, "</BLINK>", "");
              out.println(line);
          public void doPost(HttpServletRequest req, HttpServletResponse res)
                                        throws ServletException, IOException {
            doGet(req, res);
          private String replace(String line, String oldString, String newString) {
            int index = 0;
            while ((index = line.indexOf(oldString, index)) >= 0) {
              // Replace the old string with the new string (inefficiently)
              line = line.substring(0, index) +
                     newString +
                     line.substring(index + oldString.length());
              index += newString.length();
            return line;
    What is pre request fo above code to work.
    I had tried this many time but it is not working, what will be calling servlet look like

    And can you explain why your title is "Servlet chaining problem"?

  • What if i give -1 as a Servlet instance in pool in web.xml

    What if i give -1 as a no of Servlet instance, in pool, in web.xml

    Try it and them get back to us and let us know if it works.

  • SingleThreadModel and amount of servlet instances ??

    Hi !
              Is there anybody who knows how to determine amount of servlet instances in
              wl5.1 if the servlet is implemented in SingleThreadModel ?
              P.asi
              

    Yup, I remember somebody mentioned that initial size is hardcoded to 5 and
              max size to 20.
              Robert Patrick <[email protected]> wrote:
              > I am not sure if a recent Service Pack has changed this or not but the
              > original implementation in WLS 5.x was that the SingleThreadModel always used
              > a fixed number of servlet instances (5, I think...).
              > Pasi Lukkarinen wrote:
              >> Hi !
              >>
              >> Is there anybody who knows how to determine amount of servlet instances in
              >> wl5.1 if the servlet is implemented in SingleThreadModel ?
              >>
              >> P.asi
              Dimitri
              

  • Servlet run problem..plz help

    hi
    i have made a simple servlet..compile it and put the .class file into web INF's classes folder..set the classpath to servlet. jar file ..the servlets java code is in root folder..i had also put jar file into web inf's lib folder..all the enviroment variables are setted ok.. but still when i am running it, it gives error 404..the url ,i am using for browser is ..http://localhost:8080/servlet/HelloServlet..
    please help me to resolve this problem.
    thanx
    gyan

    web xml file is..
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    - <!-- Copyright 2004 The Apache Software Foundation
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    -->
    - <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
    <display-name>Welcome to Tomcat</display-name>
    <description>Welcome to Tomcat</description>
    - <!-- JSPC servlet mappings start
    -->
    - <servlet>
    <servlet-name>org.apache.jsp.index_jsp</servlet-name>
    <servlet-class>org.apache.jsp.index_jsp</servlet-class>
    </servlet>
    - <servlet-mapping>
    <servlet-name>org.apache.jsp.index_jsp</servlet-name>
    <url-pattern>/index.jsp</url-pattern>
    </servlet-mapping>
    - <!-- JSPC servlet mappings end
    -->
    </web-app>

  • Servlet instances being destroyed?

    Hi,
              I converted my web app from 5.1 to 6.0 and tried hitting a jsp page. All of
              a sudden, I get the following:
              <[WebAppServletContext kiko] *.html: destroy>
              ####<Nov 7, 2000 4:44:37 PM PST> <Info> <HTTP> <> <myserver> <main> <guest>
              <> <101142>
              <Error unregistering servlet runtime
              mydomain:Name=myserver_kiko_kiko_weblogic.servlet.FileServlet_170,Location=m
              yserver,Type=ServletRuntime>
              javax.management.InstanceNotFoundException:
              mydomain:Name=myserver_kiko_kiko_weblogic.servlet.FileServlet_170,Location=m
              yserver,Type=ServletRuntime
              at
              javax.management.MBeanServer.unregisterMBean(MBeanServer.java:866)
              at
              weblogic.management.internal.RemoteMBeanServerImpl.unregisterMBean(RemoteMBe
              anServerImpl.java:106)
              at
              weblogic.management.runtime.RuntimeMBeanDelegate.unregister(RuntimeMBeanDele
              gate.java:96)
              at
              weblogic.servlet.internal.ServletStubImpl.destroyServlet(ServletStubImpl.jav
              a:442)
              at
              weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.jav
              a:526)
              at
              weblogic.servlet.internal.ServletStubImpl.checkForReload(ServletStubImpl.jav
              a:464)
              at
              weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:29
              8)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              :201)
              at
              weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
              ntext.java:1114)
              at
              weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
              :1388)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:133)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:116)
              --------------- nested within: ------------------
              weblogic.management.ManagementException: - with nested exception:
              [javax.management.InstanceNotFoundException:
              mydomain:Name=myserver_kiko_kiko_weblogic.servlet.FileServlet_170,Location=m
              yserver,Type=ServletRuntime]
              at
              weblogic.management.runtime.RuntimeMBeanDelegate.unregister(RuntimeMBeanDele
              gate.java:98)
              at
              weblogic.servlet.internal.ServletStubImpl.destroyServlet(ServletStubImpl.jav
              a:442)
              at
              weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.jav
              a:526)
              at
              weblogic.servlet.internal.ServletStubImpl.checkForReload(ServletStubImpl.jav
              a:464)
              at
              weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:29
              8)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              :201)
              at
              weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
              ntext.java:1114)
              at
              weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
              :1388)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:133)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:116)
              Why is the FileServlet instance being destroyed by WL?
              Gene Chuang
              Join Kiko.com!
              

    I suspect that what is happening here is that when the jsp gets compiled, the
              code that detects changes in the applications directory notices that the app
              has changed and tries to reload it. This seems like a bug to me. I have
              entered CR038194 to track this problem.
              mark
              Gene Chuang wrote:
              > Hi,
              >
              > I converted my web app from 5.1 to 6.0 and tried hitting a jsp page. All of
              > a sudden, I get the following:
              >
              > <[WebAppServletContext kiko] *.html: destroy>
              > ####<Nov 7, 2000 4:44:37 PM PST> <Info> <HTTP> <> <myserver> <main> <guest>
              > <> <101142>
              > <Error unregistering servlet runtime
              > mydomain:Name=myserver_kiko_kiko_weblogic.servlet.FileServlet_170,Location=m
              > yserver,Type=ServletRuntime>
              > javax.management.InstanceNotFoundException:
              > mydomain:Name=myserver_kiko_kiko_weblogic.servlet.FileServlet_170,Location=m
              > yserver,Type=ServletRuntime
              > at
              > javax.management.MBeanServer.unregisterMBean(MBeanServer.java:866)
              > at
              > weblogic.management.internal.RemoteMBeanServerImpl.unregisterMBean(RemoteMBe
              > anServerImpl.java:106)
              > at
              > weblogic.management.runtime.RuntimeMBeanDelegate.unregister(RuntimeMBeanDele
              > gate.java:96)
              > at
              > weblogic.servlet.internal.ServletStubImpl.destroyServlet(ServletStubImpl.jav
              > a:442)
              > at
              > weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.jav
              > a:526)
              > at
              > weblogic.servlet.internal.ServletStubImpl.checkForReload(ServletStubImpl.jav
              > a:464)
              > at
              > weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:29
              > 8)
              > at
              > weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              > :201)
              > at
              > weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
              > ntext.java:1114)
              > at
              > weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
              > :1388)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:133)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:116)
              > --------------- nested within: ------------------
              > weblogic.management.ManagementException: - with nested exception:
              > [javax.management.InstanceNotFoundException:
              > mydomain:Name=myserver_kiko_kiko_weblogic.servlet.FileServlet_170,Location=m
              > yserver,Type=ServletRuntime]
              > at
              > weblogic.management.runtime.RuntimeMBeanDelegate.unregister(RuntimeMBeanDele
              > gate.java:98)
              > at
              > weblogic.servlet.internal.ServletStubImpl.destroyServlet(ServletStubImpl.jav
              > a:442)
              > at
              > weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.jav
              > a:526)
              > at
              > weblogic.servlet.internal.ServletStubImpl.checkForReload(ServletStubImpl.jav
              > a:464)
              > at
              > weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:29
              > 8)
              > at
              > weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              > :201)
              > at
              > weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
              > ntext.java:1114)
              > at
              > weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
              > :1388)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:133)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:116)
              >
              > Why is the FileServlet instance being destroyed by WL?
              >
              > --
              > Gene Chuang
              > Join Kiko.com!
              

Maybe you are looking for

  • Query data in a row

    Hi All, I have a sql query "select x from tmp", which gives result as follows - X X1 X2 X3 X4 I want this result in 1 row comma seperated, as X1, X2, X3, X4 Is it possible to get this result using any sql query or pl/sql functions? Regards VJ

  • Mac Pro DVD drive door sticking problems...

    Hi all... The aluminum drive door on one of my Mac Pro's 2 DVD drives sticks in the open ("down") position about 9 times out of 10 when in use. It has done this since I received it from Apple. Not a functional issue at all, so I didn't even think abo

  • Shadow on scanned image

    HP Photosmart C6180 All-in-One. When scanning or copying, the output image has a soft-edged, grey shadow, about one inch wide and three inches long, running from the top edge of the page and centered about 2.5 inches from the right-hand edge of the p

  • Is there a site where I can share my Photoshop, Premiere and FinalCut teaching resources?

    I am a former art teacher and compiled many tutorials of Photoshop, Premiere and FinalCut. Does anyone know of an established website that I could share to? I am not looking to start my own but share with a community of art teachers already looking f

  • IBook 14" - 10.5.7 update - can't repair permissions

    My spare computer - an iBook 14" - 1.33 PPC - running 10.5.6 Did Software Update to 10.5.7. No peripherals connected. First restarts - 3 Kernel Panics in a row - then normal start up, and several more normal starts since. Using Disk Utility - can Ver