I think you are right.

> You don't have persistent beans in there which are storing old copies
> of the class you are changing, do you?

I have a session bean which is serialised as bean should be.

> It's possible that a class cast exception is being thrown if a new
> version arrives where an old one is expected, or vice versa - but I'm
> guessing now

On changing its version tomcat throws cast exception

Any body else got a similar problem?

Will it be changed in the future version?




> Uthay,
>
> I can't see anything either, unless pageContext is changing
> dynamically.
>
> You don't have persistent beans in there which are storing old copies
> of the class you are changing, do you?
>
> The reason I don't use RMI or anything based on it is because coping
> with newer versions of a class - even if logicaly the same - seems
> really tricky.
>
> It's possible that a class cast exception is being thrown if a new
> version arrives where an old one is expected, or vice versa - but I'm
> guessing now.
>
> Don't think I can be of any further help to you.
>
> Best of luck!
>
> Chris



----- Original Message -----
From: "uthay" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Chris Haynes"
<[EMAIL PROTECTED]>
Sent: Thursday, March 01, 2001 12:06 PM
Subject: Re: Tomcat class loader


>
>  Chris,
> Thanks for your help
>
> I use few beans within a page.
> And if there is any class cast exceptions during the compilaion of  that
jsp
> I will get a that specific class cast exception not necessarily the jsp
file
> class. More over it doesn't happen specific to a jsp page.
> As I said, I am only getting this error occasionally.
> Every time I change my PRContext bean class the tomcat throws this
> exception. And we have to restart it. Some time for nor reason (probably a
> configuration error) tomcat holds onto the older version of the bean
class.
> As you suggested I suspected an application fault at the beginning and
> traced the java file. It looks fine.
> the line number indicates a problem about page forwarding.
>
> if (true) {
>     String __url = (String) "lobCountryView.jsp";
>     // Forward to the above url
>     out.clear();
>     pageContext.forward( __url);
>     return;
>    }
>
> I can't spot anything.
> If there is an error why work in the first place.
>
> At the moment application seems to work fine. (Since I am not modifying
the
> bean class)
> I intend to get into this more detaily soon.
> If you have any thought on this please share it.
>
> Thanks again
> Uthay
>
>
>
>
>
>
>
>
>
>
> ----- Original Message -----
> From: "Chris Haynes" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, March 01, 2001 11:37 AM
> Subject: Re: Tomcat class loader
>
>
> > Uthay,
> >
> > I still think you've got a basic JAVA coding error - a class mismatch
> > in a .jsp called something like CampView.jsp
> >
> >
> > Look carefully at line 103 in the file below in the 'work'
> > subdirectory,
> > paying special attention to any assignments or method calls in *your*
> > code that show up in that line.
> >
> > _0002fjsp_0002fPRJsp_0002flobCampView_0002ejsplobCampView_jsp_5.java
> >
> > The run-time system is finding an instance of PRDashBoard.PRContext
> > at that point when it is expecting something else.
> >
> > Only you can tell:
> > (a) what class your code is actually expecting at that point,
> > (b) Why a PRDashBoard.PRContext is getting there and where it came
> > from,
> > c) Why the class that should there isn't!
> >
> > Chris
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "uthay" <[EMAIL PROTECTED]>
> > To: "Chris Haynes" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Wednesday, February 28, 2001 11:36 AM
> > Subject: Re: Tomcat class loader
> >
> >
> > > Chris
> > > Jasper seems to work fine. It detects the changes and recompiles the
> > java
> > > file.
> > > I have also tried removing all files inside the work directory.
> > >
> > > But my problem seems to persist.
> > > It is to do with a session bean class I have.
> > > It is not reloading at all, even after you change your class file.
> > > We tried it in another linux machine
> > > When restarted (tomcat) some time it seems to throw the following
> > exception
> > >
> > >
> > > Internal Servlet Error:
> > >
> > > javax.servlet.ServletException: PRDashBoard.PRContext
> > >  at
> > >
> > org.apache.jasper.runtime.PageContextImpl.handlePageException(PageCont
> > extImp
> > > l.java:459)
> > >  at
> > >
> > jsp.PRJsp._0002fjsp_0002fPRJsp_0002flobCampView_0002ejsplobCampView_js
> > p_5._j
> > >
> > spService(_0002fjsp_0002fPRJsp_0002flobCampView_0002ejsplobCampView_js
> > p_5.ja
> > > va:436)
> > >  at
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
> > >  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > >  at
> > >
> > org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServ
> > let.ja
> > > va:177)
> > >  at
> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:31
> > 8)
> > >  at
> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
> > >  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > >  at
> > org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:40
> > 4)
> > >  at org.apache.tomcat.core.Handler.service(Handler.java:286)
> > >  at
> > org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> > >  at
> > >
> > org.apache.tomcat.core.ContextManager.internalService(ContextManager.j
> > ava:79
> > > 7)
> > >  at
> > org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> > >  at
> > >
> > org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConn
> > ection
> > > (Ajp12ConnectionHandler.java:166)
> > >  at
> > >
> > org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:4
> > 16)
> > >  at
> > >
> > org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:
> > 498)
> > >  at java.lang.Thread.run(Thread.java:484)
> > >
> > > Root cause:
> > > java.lang.ClassCastException: PRDashBoard.PRContext
> > >  at
> > >
> > jsp.PRJsp._0002fjsp_0002fPRJsp_0002flobCampView_0002ejsplobCampView_js
> > p_5._j
> > >
> > spService(_0002fjsp_0002fPRJsp_0002flobCampView_0002ejsplobCampView_js
> > p_5.ja
> > > va:103)
> > >  at
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
> > >  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > >  at
> > >
> > org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServ
> > let.ja
> > > va:177)
> > >  at
> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:31
> > 8)
> > >  at
> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
> > >  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > >  at
> > org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:40
> > 4)
> > >  at org.apache.tomcat.core.Handler.service(Handler.java:286)
> > >  at
> > org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> > >  at
> > >
> > org.apache.tomcat.core.ContextManager.internalService(ContextManager.j
> > ava:79
> > > 7)
> > >  at
> > org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> > >  at
> > >
> > org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConn
> > ection
> > > (Ajp12ConnectionHandler.java:166)
> > >  at
> > >
> > org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:4
> > 16)
> > >  at
> > >
> > org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:
> > 498)
> > >  at java.lang.Thread.run(Thread.java:484)
> > >
> > >
> > > Uthay
> > >
> > >
> > > ----- Original Message -----
> > > From: "Chris Haynes" <[EMAIL PROTECTED]>
> > > To: "uthay" <[EMAIL PROTECTED]>
> > > Sent: Tuesday, February 27, 2001 6:48 PM
> > > Subject: Re: Tomcat class loader
> > >
> > >
> > > > Uthay,
> > > >
> > > > I had a slightly different problem in mind - having to remember
> > which
> > > > classes will and won't be re-loaded automatically and hence
> > whether or
> > > > not I have to restart tomcat to see the effect of a change in
> > source
> > > > code.
> > > >
> > > > I'm not quite sure what your "stuck" class is all about. If the
> > tomcat
> > > > JSP compiler mechanism (jikes, is it?) has compiled it, I believe
> > > > there will be a .class file in a subdirectory of TOMCAT_HOME/work
> > with
> > > > a name made up of your class name embedded in many, many other
> > > > characters.
> > > >
> > > > Not sure if this is addressing your problem, but this is the place
> > > > where I've found lingering class files lurking before now.
> > > >
> > > >  Chris
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "uthay" <[EMAIL PROTECTED]>
> > > > To: <[EMAIL PROTECTED]>; "Chris Haynes"
> > > > <[EMAIL PROTECTED]>
> > > > Sent: Tuesday, February 27, 2001 4:43 PM
> > > > Subject: Re: Tomcat class loader
> > > >
> > > >
> > > > > Chris,
> > > > > How did you test it?
> > > > >
> > > > >
> > > > > My bean class (happens to be a session bean) is not released
> > even
> > > > after
> > > > > stopping and starting tomcat!!!
> > > > > I have tried removing all the class and java files with that
> > name
> > > > but
> > > > > instead of showing class not found, somehow it finds the old
> > class!
> > > > >
> > > > >
> > > > > ----- Original Message -----
> > > > > From: "Chris Haynes" <[EMAIL PROTECTED]>
> > > > > To: <[EMAIL PROTECTED]>
> > > > > Sent: Tuesday, February 27, 2001 4:13 PM
> > > > > Subject: Re: Tomcat class loader
> > > > >
> > > > >
> > > > > > What I've observed is that it only reloads the classes it
> > > > *directly*
> > > > > > knows about.
> > > > > >
> > > > > > I.E. it will reload amended Servlet classes and JSP files, but
> > if
> > > > they
> > > > > > then refer to other classes, these other classes will NOT be
> > > > reloaded
> > > > > > if they change.
> > > > > >
> > > > > > So you have to keep stopping and starting tomcat unless you
> > use
> > > > ONLY
> > > > > > simple JSP pages (with no other changing classes referred to )
> > and
> > > > > > servlets which use only stable classes.
> > > > > >
> > > > > >
> > > > > > Chris
> > > > > >
> > > > > >
> > > > > > ----- Original Message -----
> > > > > > From: "uthay" <[EMAIL PROTECTED]>
> > > > > > To: <[EMAIL PROTECTED]>
> > > > > > Sent: Tuesday, February 27, 2001 3:35 PM
> > > > > > Subject: Re: Tomcat class loader
> > > > > >
> > > > > >
> > > > > > > Thx Jim
> > > > > > >
> > > > > > > I tried that.
> > > > > > > I also want to bring some other thing I read recently.
> > > > > > > It states that although tomcat supports class reloading on
> > > > updation
> > > > > > it is
> > > > > > > still not supported to those classes that are not servlets.
> > > > > > > What does that supposed to mean?
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > ----- Original Message -----
> > > > > > > From: "Jim Miani" <[EMAIL PROTECTED]>
> > > > > > > To: <[EMAIL PROTECTED]>
> > > > > > > Sent: Tuesday, February 27, 2001 1:40 PM
> > > > > > > Subject: RE: Tomcat class loader
> > > > > > >
> > > > > > >
> > > > > > > >
> > > > > > > > Uthay - I was having the same problem. See my post
> > yesterday
> > > > under
> > > > > > subject
> > > > > > > > JSP caching.
> > > > > > > >
> > > > > > > > The problem is that your WEB-INF directory is probably in
> > your
> > > > > > CLASSPATH
> > > > > > > > when you start Tomcat - see the FAQ - it won't reload
> > classes
> > > > in
> > > > > > your
> > > > > > > > CLASSPATH
> > > > > > > >
> > > > > > > > There is a question/answer in the FAQ re: this - I feel
> > dumb
> > > > about
> > > > > > it. Now
> > > > > > > > you can too :)
> > > > > > > >
> > > > > > > > Good luck.
> > > > > > > >
> > > > > > > > Jim
> > > > > > > >
> > > > > > > >
> > > > > > > > >From: "uthay"
> > > > > > > > >Subject:  Tomcat class loader
> > > > > > > > >Date:  Tue, 27 Feb 2001 13:15:44 -0000
> > > > > > > > >
> > > > > > > > > It was stated in the tomcat installation instructions
> > that
> > > > > > tomcat will
> > > > > > > > > reload any servelet or jsp file if the file is changed.
> > > > > > > > > I am using a package through a servlet. Although I have
> > > > modified
> > > > > > the
> > > > > > > > > package, tomcat is refusing to load the new classes and
> > > > holding
> > > > > > onto the
> > > > > > > > > older ones.
> > > > > > > > > May be its because they are not servlets??????
> > > > > > > > > Is there anyway of solving this.
> > > > > > > > > Does tomcat follow a different class loading mechanism
> > for
> > > > > > classes
> > > > > > > > >that are not servlets. (classes in WEB-INF)?
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > >
> > > --------------------------------------------------------------------
> > > > > > -
> > > > > > > > To unsubscribe, e-mail:
> > > > [EMAIL PROTECTED]
> > > > > > > > For additional commands, email:
> > > > > > [EMAIL PROTECTED]
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > >
> > > --------------------------------------------------------------------
> > > > > > -
> > > > > > > To unsubscribe, e-mail:
> > > > [EMAIL PROTECTED]
> > > > > > > For additional commands, email:
> > > > [EMAIL PROTECTED]
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > > --------------------------------------------------------------------
> > > > -
> > > > > > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > > > > For additional commands, email:
> > > > [EMAIL PROTECTED]
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > > --------------------------------------------------------------------
> > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, email: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, email: [EMAIL PROTECTED]
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to