You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by prabahar <pr...@questech.co.in> on 2003/05/01 06:41:34 UTC

Tomcat 4.1 Out of memory exception

Hi,
I am new to this mailing list. I have a problem
I hosting an application with

Tomcat 4.1.24
Apache 2.0.43
Linux 7.3
Mod_jk 2.0.43
Postgresql

My application has jsp files, servlets and beans.

Tomcat throws Out of memory exception after working for sometime. The memory 
usage of the tomcat grows slowly till around 220 MB and then throws the 
error. I am not able to diagonise what is the problem. I will attach my 
server.xml for your reference.

-----------------server.xml-----------------

<Server port="8005" shutdown="SHUTDOWN" debug="0">

  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
            debug="0"/>
  <Listener 
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
            debug="0"/>

  <!-- Global JNDI resources -->
  <GlobalNamingResources>

    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>

    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
       description="User database that can be updated and saved">
    </Resource>
    <ResourceParams name="UserDatabase">
      <parameter>
        <name>factory</name>
        <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
      </parameter>
      <parameter>
        <name>pathname</name>
        <value>conf/tomcat-users.xml</value>
      </parameter>
    </ResourceParams>

  </GlobalNamingResources>


  <!-- Define the Tomcat Stand-Alone Service -->
  <Service name="Tomcat-Standalone">


    <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               port="8009" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8443"
               acceptCount="10" debug="0" connectionTimeout="20000"
               useURIValidationHack="false"
               
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler">
            <Parameter name="max_threads" value="100"/>
            <Parameter name="max_spare_threads" value="20"/>
            <Parameter name="min_spare_threads" value="5"/>

</Connector>
    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Standalone" defaultHost="localhost" debug="0">

      <!-- Global logger unless overridden at lower levels -->
      <Logger className="org.apache.catalina.logger.FileLogger"
              prefix="catalina_log." suffix=".txt"
              timestamp="true"/>

      <!-- This Realm uses the UserDatabase configured in the global JNDI
           resources under the key "UserDatabase".  Any edits
           that are performed against this UserDatabase are immediately
           available for use by the Realm.  -->
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
                 debug="0" resourceName="UserDatabase"/>

      <!-- Define the default virtual host -->
      <Host name="localhost" debug="0" appBase="webapps"
       unpackWARs="true" autoDeploy="true">

        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="logs"  prefix="localhost_log." suffix=".txt"
                timestamp="true"/>

        <!-- Tomcat Examples Context -->
        <Context path="/examples" docBase="examples" debug="0"
                 reloadable="true" crossContext="true">
          <Logger className="org.apache.catalina.logger.FileLogger"
                     prefix="localhost_examples_log." suffix=".txt"
                  timestamp="true"/>
          <Ejb   name="ejb/EmplRecord" type="Entity"
                 home="com.wombat.empl.EmployeeRecordHome"
               remote="com.wombat.empl.EmployeeRecord"/>

          <Environment name="maxExemptions" type="java.lang.Integer"
                      value="15"/>
          <Parameter name="context.param.name" value="context.param.value"
                     override="false"/>
          <Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
                    type="javax.sql.DataSource"/>
          <ResourceParams name="jdbc/EmployeeAppDb">
            <parameter><name>username</name><value>sa</value></parameter>
            <parameter><name>password</name><value></value></parameter>
            <parameter><name>driverClassName</name>
              <value>org.hsql.jdbcDriver</value></parameter>
            <parameter><name>url</name>
              <value>jdbc:HypersonicSQL:database</value></parameter>
          </ResourceParams>
          <Resource name="mail/Session" auth="Container"
                    type="javax.mail.Session"/>
          <ResourceParams name="mail/Session">
            <parameter>
              <name>mail.smtp.host</name>
              <value>localhost</value>
            </parameter>
          </ResourceParams>
          <ResourceLink name="linkToGlobalResource"
                    global="simpleValue"
                    type="java.lang.Integer"/>
        </Context>

      </Host>

    </Engine>

  </Service>


</Server>

----------------------------------------------------
_____________________________________________________________________
Any Opinions, explicit or implied, are solely those of the author and do not necessarily
represent those of Questech. This e-mail may contain confidential and/or privileged
information. If you are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any unauthorized copying,
disclosure or distribution of the material in this e-mail is strictly forbidden.
_____________________________________________________________________



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Tool for loadtesting and profiler

Posted by Kwok Peng Tuck <pe...@makmal.net>.
Here:
http://jakarta.apache.org/jmeter/index.html

Try it first.

prabahar wrote:

>Can anyone help me out which tool is the good to load test applications in 
>tomcat and good profiler.
>Thanks for your replies in advance,
>Prabahar
>_____________________________________________________________________
>Any Opinions, explicit or implied, are solely those of the author and do not necessarily
>represent those of Questech. This e-mail may contain confidential and/or privileged
>information. If you are not the intended recipient (or have received this e-mail in error)
>please notify the sender immediately and destroy this e-mail. Any unauthorized copying,
>disclosure or distribution of the material in this e-mail is strictly forbidden.
>_____________________________________________________________________
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Tool for loadtesting and profiler

Posted by prabahar <pr...@questech.co.in>.
Can anyone help me out which tool is the good to load test applications in 
tomcat and good profiler.
Thanks for your replies in advance,
Prabahar
_____________________________________________________________________
Any Opinions, explicit or implied, are solely those of the author and do not necessarily
represent those of Questech. This e-mail may contain confidential and/or privileged
information. If you are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any unauthorized copying,
disclosure or distribution of the material in this e-mail is strictly forbidden.
_____________________________________________________________________



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Tomcat 4.1 Out of memory exception

Posted by Jacob Kjome <ho...@visi.com>.
Can't help you too much with Linux.  BTW, why do you set -Xmx in the 
JAVA_OPTS.  CATALINA_OPTS is what the tomcat startup scripts read.  Maybe 
they read JAVA_OPTS as well, but I haven't checked to verify this.

So, you say that threads are still running from the JVM that was running 
Tomcat?  That's impossible if the JVM actually shut down....unless I'm just 
missing something?  Sorry, you'll need someone who knows more about Linux 
on this one.

Jake

At 10:32 AM 5/1/2003 +0530, you wrote:
>Thankyou Jake for your reply. I have already added. It goes like this
>
>JAVA_OPTS="-Dfile.encoding=EUC-JP -Xms124m -Xmx256m"
>
>
>When i restart the tomcat the java threads are still occupying the memory so
>i added this when i restart tomcat.
>
>kill -9 `ps -ef | grep "jdk1.3.1" | tr -s " " | cut -d' ' -f2` >/dev/null
>2> /dev/null
>
>This will remove those threads and free up the memory. Am i doing something
>wrong? Please help me out.
>
>Regards,
>Prabahar
>
> > Do something like this...
> >
> > CATALINA_OPTS= -Xmx512m
> >
> > There are lots of other VM switches, but you are simply running out
> > of memory in the VM.  In order to provide more memory to Tomcat, you
> > have to give the VM something larger than it's default max of
> > 64megs.  At that point, you probably want to track down the memory
> > leak (if you have one).
> >
> > Jake
> >
> > At 10:11 AM 5/1/2003 +0530, you wrote:
> > >Hi,
> > >I am new to this mailing list. I have a problem
> > >I hosting an application with
> > >
> > >Tomcat 4.1.24
> > >Apache 2.0.43
> > >Linux 7.3
> > >Mod_jk 2.0.43
> > >Postgresql
> > >
> > >My application has jsp files, servlets and beans.
> > >
> > >Tomcat throws Out of memory exception after working for sometime. The
>memory
> > >usage of the tomcat grows slowly till around 220 MB and then throws the
> > >error. I am not able to diagonise what is the problem. I will attach my
> > >server.xml for your reference.
> > >
> > >-----------------server.xml-----------------
> > >
> > ><Server port="8005" shutdown="SHUTDOWN" debug="0">
> > >
> > >   <Listener 
> className="org.apache.catalina.mbeans.ServerLifecycleListener"
> > >             debug="0"/>
> > >   <Listener
> > >className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
> > >             debug="0"/>
> > >
> > >   <!-- Global JNDI resources -->
> > >   <GlobalNamingResources>
> > >
> > >     <!-- Test entry for demonstration purposes -->
> > >     <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
> > >
> > >     <!-- Editable user database that can also be used by
> > >          UserDatabaseRealm to authenticate users -->
> > >     <Resource name="UserDatabase" auth="Container"
> > >               type="org.apache.catalina.UserDatabase"
> > >        description="User database that can be updated and saved">
> > >     </Resource>
> > >     <ResourceParams name="UserDatabase">
> > >       <parameter>
> > >         <name>factory</name>
> > > 
> <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
> > >       </parameter>
> > >       <parameter>
> > >         <name>pathname</name>
> > >         <value>conf/tomcat-users.xml</value>
> > >       </parameter>
> > >     </ResourceParams>
> > >
> > >   </GlobalNamingResources>
> > >
> > >
> > >   <!-- Define the Tomcat Stand-Alone Service -->
> > >   <Service name="Tomcat-Standalone">
> > >
> > >
> > >     <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
> > >     <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
> > >                port="8009" minProcessors="5" maxProcessors="75"
> > >                enableLookups="true" redirectPort="8443"
> > >                acceptCount="10" debug="0" connectionTimeout="20000"
> > >                useURIValidationHack="false"
> > >
> > >protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler">
> > >             <Parameter name="max_threads" value="100"/>
> > >             <Parameter name="max_spare_threads" value="20"/>
> > >             <Parameter name="min_spare_threads" value="5"/>
> > >
> > ></Connector>
> > >     <!-- Define the top level container in our container hierarchy -->
> > >     <Engine name="Standalone" defaultHost="localhost" debug="0">
> > >
> > >       <!-- Global logger unless overridden at lower levels -->
> > >       <Logger className="org.apache.catalina.logger.FileLogger"
> > >               prefix="catalina_log." suffix=".txt"
> > >               timestamp="true"/>
> > >
> > >       <!-- This Realm uses the UserDatabase configured in the global JNDI
> > >            resources under the key "UserDatabase".  Any edits
> > >            that are performed against this UserDatabase are immediately
> > >            available for use by the Realm.  -->
> > >       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
> > >                  debug="0" resourceName="UserDatabase"/>
> > >
> > >       <!-- Define the default virtual host -->
> > >       <Host name="localhost" debug="0" appBase="webapps"
> > >        unpackWARs="true" autoDeploy="true">
> > >
> > >         <Logger className="org.apache.catalina.logger.FileLogger"
> > >                  directory="logs"  prefix="localhost_log." suffix=".txt"
> > >                 timestamp="true"/>
> > >
> > >         <!-- Tomcat Examples Context -->
> > >         <Context path="/examples" docBase="examples" debug="0"
> > >                  reloadable="true" crossContext="true">
> > >           <Logger className="org.apache.catalina.logger.FileLogger"
> > >                      prefix="localhost_examples_log." suffix=".txt"
> > >                   timestamp="true"/>
> > >           <Ejb   name="ejb/EmplRecord" type="Entity"
> > >                  home="com.wombat.empl.EmployeeRecordHome"
> > >                remote="com.wombat.empl.EmployeeRecord"/>
> > >
> > >           <Environment name="maxExemptions" type="java.lang.Integer"
> > >                       value="15"/>
> > >           <Parameter name="context.param.name" 
> value="context.param.value"
> > >                      override="false"/>
> > >           <Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
> > >                     type="javax.sql.DataSource"/>
> > >           <ResourceParams name="jdbc/EmployeeAppDb">
> > >             <parameter><name>username</name><value>sa</value></parameter>
> > >             <parameter><name>password</name><value></value></parameter>
> > >             <parameter><name>driverClassName</name>
> > >               <value>org.hsql.jdbcDriver</value></parameter>
> > >             <parameter><name>url</name>
> > >               <value>jdbc:HypersonicSQL:database</value></parameter>
> > >           </ResourceParams>
> > >           <Resource name="mail/Session" auth="Container"
> > >                     type="javax.mail.Session"/>
> > >           <ResourceParams name="mail/Session">
> > >             <parameter>
> > >               <name>mail.smtp.host</name>
> > >               <value>localhost</value>
> > >             </parameter>
> > >           </ResourceParams>
> > >           <ResourceLink name="linkToGlobalResource"
> > >                     global="simpleValue"
> > >                     type="java.lang.Integer"/>
> > >         </Context>
> > >
> > >       </Host>
> > >
> > >     </Engine>
> > >
> > >   </Service>
> > >
> > >
> > ></Server>
> > >
> > >----------------------------------------------------
> > >_____________________________________________________________________
> > >Any Opinions, explicit or implied, are solely those of the author and do
> > >not necessarily
> > >represent those of Questech. This e-mail may contain confidential and/or
> > >privileged
> > >information. If you are not the intended recipient (or have received this
> > >e-mail in error)
> > >please notify the sender immediately and destroy this e-mail. Any
> > >unauthorized copying,
> > >disclosure or distribution of the material in this e-mail is strictly
> > >forbidden.
> > >_____________________________________________________________________
> > >
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>_____________________________________________________________________
>Any Opinions, explicit or implied, are solely those of the author and do 
>not necessarily
>represent those of Questech. This e-mail may contain confidential and/or 
>privileged
>information. If you are not the intended recipient (or have received this 
>e-mail in error)
>please notify the sender immediately and destroy this e-mail. Any 
>unauthorized copying,
>disclosure or distribution of the material in this e-mail is strictly 
>forbidden.
>_____________________________________________________________________
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

Re: Tomcat 4.1 Out of memory exception

Posted by prabahar <pr...@questech.co.in>.
Thankyou Jake for your reply. I have already added. It goes like this

JAVA_OPTS="-Dfile.encoding=EUC-JP -Xms124m -Xmx256m"


When i restart the tomcat the java threads are still occupying the memory so 
i added this when i restart tomcat. 

kill -9 `ps -ef | grep "jdk1.3.1" | tr -s " " | cut -d' ' -f2` >/dev/null 
2> /dev/null

This will remove those threads and free up the memory. Am i doing something 
wrong? Please help me out.

Regards,
Prabahar

> Do something like this...
> 
> CATALINA_OPTS= -Xmx512m
> 
> There are lots of other VM switches, but you are simply running out 
> of memory in the VM.  In order to provide more memory to Tomcat, you 
> have to give the VM something larger than it's default max of 
> 64megs.  At that point, you probably want to track down the memory 
> leak (if you have one).
> 
> Jake
> 
> At 10:11 AM 5/1/2003 +0530, you wrote:
> >Hi,
> >I am new to this mailing list. I have a problem
> >I hosting an application with
> >
> >Tomcat 4.1.24
> >Apache 2.0.43
> >Linux 7.3
> >Mod_jk 2.0.43
> >Postgresql
> >
> >My application has jsp files, servlets and beans.
> >
> >Tomcat throws Out of memory exception after working for sometime. The 
memory
> >usage of the tomcat grows slowly till around 220 MB and then throws the
> >error. I am not able to diagonise what is the problem. I will attach my
> >server.xml for your reference.
> >
> >-----------------server.xml-----------------
> >
> ><Server port="8005" shutdown="SHUTDOWN" debug="0">
> >
> >   <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
> >             debug="0"/>
> >   <Listener
> >className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
> >             debug="0"/>
> >
> >   <!-- Global JNDI resources -->
> >   <GlobalNamingResources>
> >
> >     <!-- Test entry for demonstration purposes -->
> >     <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
> >
> >     <!-- Editable user database that can also be used by
> >          UserDatabaseRealm to authenticate users -->
> >     <Resource name="UserDatabase" auth="Container"
> >               type="org.apache.catalina.UserDatabase"
> >        description="User database that can be updated and saved">
> >     </Resource>
> >     <ResourceParams name="UserDatabase">
> >       <parameter>
> >         <name>factory</name>
> >         <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
> >       </parameter>
> >       <parameter>
> >         <name>pathname</name>
> >         <value>conf/tomcat-users.xml</value>
> >       </parameter>
> >     </ResourceParams>
> >
> >   </GlobalNamingResources>
> >
> >
> >   <!-- Define the Tomcat Stand-Alone Service -->
> >   <Service name="Tomcat-Standalone">
> >
> >
> >     <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
> >     <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
> >                port="8009" minProcessors="5" maxProcessors="75"
> >                enableLookups="true" redirectPort="8443"
> >                acceptCount="10" debug="0" connectionTimeout="20000"
> >                useURIValidationHack="false"
> >
> >protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler">
> >             <Parameter name="max_threads" value="100"/>
> >             <Parameter name="max_spare_threads" value="20"/>
> >             <Parameter name="min_spare_threads" value="5"/>
> >
> ></Connector>
> >     <!-- Define the top level container in our container hierarchy -->
> >     <Engine name="Standalone" defaultHost="localhost" debug="0">
> >
> >       <!-- Global logger unless overridden at lower levels -->
> >       <Logger className="org.apache.catalina.logger.FileLogger"
> >               prefix="catalina_log." suffix=".txt"
> >               timestamp="true"/>
> >
> >       <!-- This Realm uses the UserDatabase configured in the global JNDI
> >            resources under the key "UserDatabase".  Any edits
> >            that are performed against this UserDatabase are immediately
> >            available for use by the Realm.  -->
> >       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
> >                  debug="0" resourceName="UserDatabase"/>
> >
> >       <!-- Define the default virtual host -->
> >       <Host name="localhost" debug="0" appBase="webapps"
> >        unpackWARs="true" autoDeploy="true">
> >
> >         <Logger className="org.apache.catalina.logger.FileLogger"
> >                  directory="logs"  prefix="localhost_log." suffix=".txt"
> >                 timestamp="true"/>
> >
> >         <!-- Tomcat Examples Context -->
> >         <Context path="/examples" docBase="examples" debug="0"
> >                  reloadable="true" crossContext="true">
> >           <Logger className="org.apache.catalina.logger.FileLogger"
> >                      prefix="localhost_examples_log." suffix=".txt"
> >                   timestamp="true"/>
> >           <Ejb   name="ejb/EmplRecord" type="Entity"
> >                  home="com.wombat.empl.EmployeeRecordHome"
> >                remote="com.wombat.empl.EmployeeRecord"/>
> >
> >           <Environment name="maxExemptions" type="java.lang.Integer"
> >                       value="15"/>
> >           <Parameter name="context.param.name" value="context.param.value"
> >                      override="false"/>
> >           <Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
> >                     type="javax.sql.DataSource"/>
> >           <ResourceParams name="jdbc/EmployeeAppDb">
> >             <parameter><name>username</name><value>sa</value></parameter>
> >             <parameter><name>password</name><value></value></parameter>
> >             <parameter><name>driverClassName</name>
> >               <value>org.hsql.jdbcDriver</value></parameter>
> >             <parameter><name>url</name>
> >               <value>jdbc:HypersonicSQL:database</value></parameter>
> >           </ResourceParams>
> >           <Resource name="mail/Session" auth="Container"
> >                     type="javax.mail.Session"/>
> >           <ResourceParams name="mail/Session">
> >             <parameter>
> >               <name>mail.smtp.host</name>
> >               <value>localhost</value>
> >             </parameter>
> >           </ResourceParams>
> >           <ResourceLink name="linkToGlobalResource"
> >                     global="simpleValue"
> >                     type="java.lang.Integer"/>
> >         </Context>
> >
> >       </Host>
> >
> >     </Engine>
> >
> >   </Service>
> >
> >
> ></Server>
> >
> >----------------------------------------------------
> >_____________________________________________________________________
> >Any Opinions, explicit or implied, are solely those of the author and do 
> >not necessarily
> >represent those of Questech. This e-mail may contain confidential and/or 
> >privileged
> >information. If you are not the intended recipient (or have received this 
> >e-mail in error)
> >please notify the sender immediately and destroy this e-mail. Any 
> >unauthorized copying,
> >disclosure or distribution of the material in this e-mail is strictly 
> >forbidden.
> >_____________________________________________________________________
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



_____________________________________________________________________
Any Opinions, explicit or implied, are solely those of the author and do not necessarily
represent those of Questech. This e-mail may contain confidential and/or privileged
information. If you are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any unauthorized copying,
disclosure or distribution of the material in this e-mail is strictly forbidden.
_____________________________________________________________________



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Tomcat Error 500 running 2 apps

Posted by "Edward See (magicaLogic)" <fo...@info.com.ph>.
Hi
i am new to this list

environment : W2K sp2, Tomcat 4.0.1, jdk1.3

i have 1st app under webapps\Foxmagic\jsp_A\Login.jsp using bean
webapps\Foxmagic\WEB-INF\classes\com\mybean\bean_A.class

it runs ok

i change address url or start another instance of browser running:

2nd app under webapps\Foxmagic\jsp_B\Login.jsp using bean
webapps\Foxmagic\WEB-INF\classes\com\mybean\bean_B.class

it returns error:
Apache Tomcat/4.0.1 - HTTP Status 500 - Internal Server Error
type Exception report
message Internal Server Error
description The server encountered an internal error (Internal Server Error)
that prevented it from fulfilling this request.
exception
java.lang.ClassCastException: com.mybean.bean_A.class
	at org.apache.jsp.Login$jsp._jspService(Login$jsp.java:279)

if i restart tomcat, 2nd app runs fine.

both jsp_A and jsp_B directory belongs to different applications but under
common Foxmagic directory because they have other common beans in
webapps\Foxmagic\WEB-INF\classes\com\mybean directory.

any idea for a workaround or some setting changes to Tomcat ?

any help is very much appreciated
thank you in advance











---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Tomcat 4.1 Out of memory exception

Posted by Jacob Kjome <ho...@visi.com>.
Do something like this...

CATALINA_OPTS= -Xmx512m

There are lots of other VM switches, but you are simply running out of 
memory in the VM.  In order to provide more memory to Tomcat, you have to 
give the VM something larger than it's default max of 64megs.  At that 
point, you probably want to track down the memory leak (if you have one).

Jake

At 10:11 AM 5/1/2003 +0530, you wrote:
>Hi,
>I am new to this mailing list. I have a problem
>I hosting an application with
>
>Tomcat 4.1.24
>Apache 2.0.43
>Linux 7.3
>Mod_jk 2.0.43
>Postgresql
>
>My application has jsp files, servlets and beans.
>
>Tomcat throws Out of memory exception after working for sometime. The memory
>usage of the tomcat grows slowly till around 220 MB and then throws the
>error. I am not able to diagonise what is the problem. I will attach my
>server.xml for your reference.
>
>-----------------server.xml-----------------
>
><Server port="8005" shutdown="SHUTDOWN" debug="0">
>
>   <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
>             debug="0"/>
>   <Listener
>className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
>             debug="0"/>
>
>   <!-- Global JNDI resources -->
>   <GlobalNamingResources>
>
>     <!-- Test entry for demonstration purposes -->
>     <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
>
>     <!-- Editable user database that can also be used by
>          UserDatabaseRealm to authenticate users -->
>     <Resource name="UserDatabase" auth="Container"
>               type="org.apache.catalina.UserDatabase"
>        description="User database that can be updated and saved">
>     </Resource>
>     <ResourceParams name="UserDatabase">
>       <parameter>
>         <name>factory</name>
>         <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
>       </parameter>
>       <parameter>
>         <name>pathname</name>
>         <value>conf/tomcat-users.xml</value>
>       </parameter>
>     </ResourceParams>
>
>   </GlobalNamingResources>
>
>
>   <!-- Define the Tomcat Stand-Alone Service -->
>   <Service name="Tomcat-Standalone">
>
>
>     <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
>     <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
>                port="8009" minProcessors="5" maxProcessors="75"
>                enableLookups="true" redirectPort="8443"
>                acceptCount="10" debug="0" connectionTimeout="20000"
>                useURIValidationHack="false"
>
>protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler">
>             <Parameter name="max_threads" value="100"/>
>             <Parameter name="max_spare_threads" value="20"/>
>             <Parameter name="min_spare_threads" value="5"/>
>
></Connector>
>     <!-- Define the top level container in our container hierarchy -->
>     <Engine name="Standalone" defaultHost="localhost" debug="0">
>
>       <!-- Global logger unless overridden at lower levels -->
>       <Logger className="org.apache.catalina.logger.FileLogger"
>               prefix="catalina_log." suffix=".txt"
>               timestamp="true"/>
>
>       <!-- This Realm uses the UserDatabase configured in the global JNDI
>            resources under the key "UserDatabase".  Any edits
>            that are performed against this UserDatabase are immediately
>            available for use by the Realm.  -->
>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>                  debug="0" resourceName="UserDatabase"/>
>
>       <!-- Define the default virtual host -->
>       <Host name="localhost" debug="0" appBase="webapps"
>        unpackWARs="true" autoDeploy="true">
>
>         <Logger className="org.apache.catalina.logger.FileLogger"
>                  directory="logs"  prefix="localhost_log." suffix=".txt"
>                 timestamp="true"/>
>
>         <!-- Tomcat Examples Context -->
>         <Context path="/examples" docBase="examples" debug="0"
>                  reloadable="true" crossContext="true">
>           <Logger className="org.apache.catalina.logger.FileLogger"
>                      prefix="localhost_examples_log." suffix=".txt"
>                   timestamp="true"/>
>           <Ejb   name="ejb/EmplRecord" type="Entity"
>                  home="com.wombat.empl.EmployeeRecordHome"
>                remote="com.wombat.empl.EmployeeRecord"/>
>
>           <Environment name="maxExemptions" type="java.lang.Integer"
>                       value="15"/>
>           <Parameter name="context.param.name" value="context.param.value"
>                      override="false"/>
>           <Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
>                     type="javax.sql.DataSource"/>
>           <ResourceParams name="jdbc/EmployeeAppDb">
>             <parameter><name>username</name><value>sa</value></parameter>
>             <parameter><name>password</name><value></value></parameter>
>             <parameter><name>driverClassName</name>
>               <value>org.hsql.jdbcDriver</value></parameter>
>             <parameter><name>url</name>
>               <value>jdbc:HypersonicSQL:database</value></parameter>
>           </ResourceParams>
>           <Resource name="mail/Session" auth="Container"
>                     type="javax.mail.Session"/>
>           <ResourceParams name="mail/Session">
>             <parameter>
>               <name>mail.smtp.host</name>
>               <value>localhost</value>
>             </parameter>
>           </ResourceParams>
>           <ResourceLink name="linkToGlobalResource"
>                     global="simpleValue"
>                     type="java.lang.Integer"/>
>         </Context>
>
>       </Host>
>
>     </Engine>
>
>   </Service>
>
>
></Server>
>
>----------------------------------------------------
>_____________________________________________________________________
>Any Opinions, explicit or implied, are solely those of the author and do 
>not necessarily
>represent those of Questech. This e-mail may contain confidential and/or 
>privileged
>information. If you are not the intended recipient (or have received this 
>e-mail in error)
>please notify the sender immediately and destroy this e-mail. Any 
>unauthorized copying,
>disclosure or distribution of the material in this e-mail is strictly 
>forbidden.
>_____________________________________________________________________
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org