You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Peter Choe <ch...@mindspring.com> on 2000/12/06 16:52:47 UTC

scope of a bean

i am trying to write an jsp where a bean is instaniated and has it data
initialized on one jsp page.  and then another page should be able to
read the data from the bean.  i have set the scope of the bean to
request, but when it goes to the other page, i noticed that it is
creating a new bean rather using the bean that was instaniated from the
previous page.

am i misunderstanding the scope of the bean?  how can i get bean to be
recognized by two jsp files without using session scope?

peter choe

Re: scope of a bean

Posted by Matt Goss <mg...@rtci.com>.
set the scope to session or application.... request scope is just while the
page is loading

Peter Choe wrote:

> i am trying to write an jsp where a bean is instaniated and has it data
> initialized on one jsp page.  and then another page should be able to
> read the data from the bean.  i have set the scope of the bean to
> request, but when it goes to the other page, i noticed that it is
> creating a new bean rather using the bean that was instaniated from the
> previous page.
>
> am i misunderstanding the scope of the bean?  how can i get bean to be
> recognized by two jsp files without using session scope?
>
> peter choe

Re: scope of a bean

Posted by Pascal Mainini <pm...@raptus.com>.
Hi Peter

try setting scope to session instead of request, so the bean should
only be instantiated once a session and your project should work.

Pascal Mainini
pmainini@raptus.com
Web Developer
Raptus AG/SA
Burgweg 1
CH-2563 Ipsach
Tel/Fax: +41 32 331 29 03
http://www.raptus.com

>>>>>>>>>>>>>>>>>> Ursprüngliche Nachricht <<<<<<<<<<<<<<<<<<

Am 12/6/00, 4:52:47 PM, schrieb Peter Choe <ch...@mindspring.com> zum 
Thema scope of a bean:


> i am trying to write an jsp where a bean is instaniated and has it data
> initialized on one jsp page.  and then another page should be able to
> read the data from the bean.  i have set the scope of the bean to
> request, but when it goes to the other page, i noticed that it is
> creating a new bean rather using the bean that was instaniated from the
> previous page.

> am i misunderstanding the scope of the bean?  how can i get bean to be
> recognized by two jsp files without using session scope?

> peter choe-- 


Re: "Too many open files" error?

Posted by Marcus Crafter <cr...@dresdnerbank.de>.
Hi Ivan,

	What platform are you using ?

	If you're using Linux and have a recent kernel, you can check the
	file and inode limits like this:

	$> cat /proc/sys/fs/file-max
	$> cat /proc/sys/fs/inode-max

	and can change them similarly (as root) with

	$> echo "8192" > /proc/sys/fs/file-max
	$> echo "24576" > /proc/sys/fs/inode-max

	(this info came from the linux kernel mailing list archives, they note
	there that the inode number should be 3 times the file numder)

	Under other Unix's there should be something similar.

	HTH,

	Cheers,

	Marcus

On Wed, 6 Dec 2000, Ivan E. Markovic wrote:

> I am running a stress test on my Servlet based system; there are 
> about 30 users being tested simultaneously. It works well for about 5 
> 10 mins or so and then I get the error listed below and then after 
> about another minute the whole system locks up! I cannot hit any of 
> the servlets. Apache is still running but Tomcat is hung.
> 
> I have checked my code and I don't leave any files open. Am I 
> restricted as to the number of users that I have on the system? Can I 
> increase the no. of open files? How can I check the number of open 
> files that I have?
> 
> Thank you for your time.
> 
> 
> java.net.SocketException: Too many open files
> 	at java.net.PlainSocketImpl.accept(Compiled Code)
> 	at java.net.ServerSocket.implAccept(Compiled Code)
> 	at java.net.ServerSocket.accept(Compiled Code)
> 	at 
> org.apache.tomcat.service.PoolTcpEndpoint.acceptSocket(Compiled Code)
> 	at org.apache.tomcat.service.TcpWorkerThread.run(Compiled Code)
> 	at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
> 	at java.lang.Thread.run(Compiled Code)
> Endpoint ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8007] 
> shutdown due to exception: java.net.SocketException: Too many open 
> files
> 
> 
> I v a n ...
> Ivan Markovic
> SculptLight
> http://www.sculptlight.com
> (+353) 87 2939256
> (+353) 1 2982205
> 
> 114 Lower Churchtown Rd,
> Dublin 14,
> Ireland.
> 
> 

-- 
        .....
     ,,$$$$$$$$$,      Marcus Crafter
    ;$'      '$$$$:    Computer Systems Engineer
    $:         $$$$:   Open Software Associates GmbH
     $       o_)$$$:   82-84 Mainzer Landstrasse
     ;$,    _/\ &&:'   60327 Frankfurt Germany
       '     /( &&&
           \_&&&&'     Email : Marcus.Crafter@osa.de
          &&&&.        Business Hours : +49 69 9757 200
    &&&&&&&:           After Hours    : +49 69 49086750


"Too many open files" error?

Posted by "Ivan E. Markovic" <iv...@sculptlight.com>.
I am running a stress test on my Servlet based system; there are 
about 30 users being tested simultaneously. It works well for about 5 
10 mins or so and then I get the error listed below and then after 
about another minute the whole system locks up! I cannot hit any of 
the servlets. Apache is still running but Tomcat is hung.

I have checked my code and I don't leave any files open. Am I 
restricted as to the number of users that I have on the system? Can I 
increase the no. of open files? How can I check the number of open 
files that I have?

Thank you for your time.


java.net.SocketException: Too many open files
	at java.net.PlainSocketImpl.accept(Compiled Code)
	at java.net.ServerSocket.implAccept(Compiled Code)
	at java.net.ServerSocket.accept(Compiled Code)
	at 
org.apache.tomcat.service.PoolTcpEndpoint.acceptSocket(Compiled Code)
	at org.apache.tomcat.service.TcpWorkerThread.run(Compiled Code)
	at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled Code)
	at java.lang.Thread.run(Compiled Code)
Endpoint ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8007] 
shutdown due to exception: java.net.SocketException: Too many open 
files


I v a n ...
Ivan Markovic
SculptLight
http://www.sculptlight.com
(+353) 87 2939256
(+353) 1 2982205

114 Lower Churchtown Rd,
Dublin 14,
Ireland.