Forums Register Login

bean not found within scope

+Pie Number of slices to send: Send
Hi,
I have a weird problem. I know 'bean xxx not found within scope' has occured before for a lot of people and have been answered before. But my problem is, the code is in production environment and the error has occured NOW.
It doesn't happen in the development environment. The JSP is trying to access a session variable using
<bean:define id="entity" name="legalEntity" type="java.lang.String"/>

and it gives out this error. The value was put in session by a servlet during initialization of the application. And all the JSPs access this session variable.
I am not sure if it happens all the time or sometimes. Not much details have come out yet. I see this error in the System log file..

Only thing I can thik of is that the variable is removed from session somehow. but again, it doesn't hapen in the dev environment.

Any thoughts?

Thanks in advance.

Cheers,
Jay.
+Pie Number of slices to send: Send
 

The value was put in session by a servlet during initialization of the application. And all the JSPs access this session variable.



How is it possible? At the time of application initialization the session will not get created . it will get created at the time of user log in.


When the session timesout or destroys the user should again log in to access the pages. This will not affect other user's session variables.
+Pie Number of slices to send: Send
Thanks for the response Vijaya.
I am sorry that I didnt put my question properly.

It was not during the application initialization that it is put in session. It is during when the user submits the url of the first page.
e.g: myapp.com/en
myapp.com/fr

the servlet gets the url; gets the language from the url and puts it in session along with few other things..

The subsequent pages access the session variables put by the servlet in the jsp pages and this is where i get this error.

Hope it is clear now.

Can you guess what the problem would be..

Thanks for your help.

Regards,
Jay.
+Pie Number of slices to send: Send
Well if the server says it is not in session, then it must be one of two things

- the value was never put in session. Are you certain the variable was set? Maybe the user somehow sidestepped the section where you set this session variable? You never can tell what those wacky users will try next.

- the value was set, but the session is being lost. Either through timeouts, or cookies not being supported... - do a few basic tests with sessions to see if that might be the case.

Can you easily duplicate the error on production?
What would the differences be between your development and production environments?
+Pie Number of slices to send: Send
Thanks for the response Stefan.
Looks like it is happening when the session times out..
I am trying to put a try and catch statements so that the nasty error msgs dont clog the log file.

Thanks,
Jaya.
Those cherries would go best on cherry cheesecake. Don't put those cherries on this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 5302 times.
Similar Threads
How do I read a session variable inside a Managed Bean?
WS 5.0 and session variables
J2EE Application Configuration
Servlet --> Jsp with beans
Do I understand scope, redirects and JSPs correctly?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 09:07:35.