Re: ClassCastException when it should work anyway
- From: Ross Bamford <ross@xxxxxxxxxxxx>
- Date: Sun, 29 May 2005 12:03:13 +0100
On Sun, 2005-05-29 at 00:32 +0200, Jimi Hullegård wrote:
> Chris Smith wrote:
> > Short answer: no.
> >
> > A class in Java is identified by two pieces of information, a fully
> > qualified class name and a class loader. Each class loader
> > effectively defines its own class namespace, so that even if two
> > classes have
> > exactly the same fully qualified name ("community.login.User") for
> > example, if they were loaded by different class loaders then they are
> > still not the same.
>
> Thank your for that clear and straight answer. I think I understand now.
>
> > Is changing servlet containers an option? What container are you
> > using now?
>
> I'm using Orion (www.orionserver.com). And though changing servlet container
> is possible, I would prefer not to have to go thr through that hassle.
>
> But I'm starting to think that I should focus on the main problem, and maybe
> you can help me with that?
> Because the thing is, I'm having problems registering logouts on a community
> I'm building (a test site, at the moment). Everything works when the logged
> in user clicks on logout, and when when a regular time out happens. But if I
> for instance recompile the servlet when orion is running, or make some
> changes in some xml-file, then then _some_ users get logged out completely
> (which is OK), while others not get logged out completely (logout time not
> written to the database).
> So I would like to write a function that runs every five minutes (or
> whatever) and goes thrue all active sessions, retrieves the corresponding
> user object, and compares the the ones who is logged in according to the
> database.
> But the thing is I can't find any way to get hold of all active sessions. I
> have looked everywhere... Any ideas?
You're confusing your container with running changes. Do this with a
development machine in particular circumstances *if you must* but not
ever with a production machine.
Imagine you write a program that includes all kinds of complex class
manipulation stuff to make sure that the right classes are available at
the right time. You have multiple boxes for your classes, and use clever
stuff like lazy init and bytecode caching. It'll all work transparently,
since the bytecode will be the same no matter which box loads it,
right?
Until someone changes the bytecode after the caches have started to fill
up.
--
[Ross A. Bamford] [ross AT the.website.domain]
Roscopeco Open Tech ++ Open Source + Java + Apache + CMF
http://www.roscopec0.f9.co.uk/ + info@xxxxxxxxxxxxxxxxxx
.
- Follow-Ups:
- Re: ClassCastException when it should work anyway
- From: Jimi Hullegård
- Re: ClassCastException when it should work anyway
- Prev by Date: Help with this JMF problem needed!
- Next by Date: Re: Modification of output
- Previous by thread: Help with this JMF problem needed!
- Next by thread: Re: ClassCastException when it should work anyway
- Index(es):