Hello Kevin,
Kevin Duffey wrote:
> Hi,
>
> I am using the development mode (true) and set up the source directory to
> point to my source. When I save a change, and refresh the page, I am always
> getting a Class Cast Exception error. I store a bean called HtmlBean as
> application scope. In the .java generated, I see that the
> syncronized(application) { } code is where the exception is occuring. It
> looks something like this:
>
> com.bm.ui.beans.HtmlBean htmlBean;
> synchronized(application)
> {
> htmlBean = (com.bm.ui.beans.HtmlBean)application.getAttribute("htmlBean");
> if(htmlBean == null)
> {
> htmlBean = new com.bm.ui.beans.HtmlBean();
> application.setAttribute("htmlBean", htmlBean);
> }
> }
>
Note that you're storing the bean as an application scope variable. This means
that the bean scope is tied to lifetime of your web-application, not the
session. In your case, as the class is modified you will still have the "old"
bean stored in the ServletContext and you try to cast it to the "new" bean.
Normally Orion should restart the web-application in such a case and serialize
the application scope contents across the restart (but of course, if your bean
isn't serializable with a serialVersionUID set, the values will be lost between
restarts, as usual).
We will look into if this is due to something wrong in Orion's behaviour or if
it can be something else. Possibly the old application hasn't died and
serialized the application contents.
Regards,
Karl Avedal