Good point, for sure. The way I understand classloading is that if a 
new classloader is used to load a class that may have already been 
loaded by an older classloader instance, any classes that have a 
reference to the old class, and an instance of the new class is 
compared against it, classcast exceptions will happen. A class is 
more like a 'tuple' or Class/Classloader pair.

Avoidance of the ClassCastExceptions might be possible through the use 
of Interfaces and dynamic loading of classes that are going to change 
often, possibly coupled with not keeping the references to classes in 
another jar for long periods of time. But without knowing more about 
the circumstances, it'd be hard to give any design advice.

Cheers.

-Neal

On Friday 25 October 2002 10:07 am, Jim Crossley wrote:
> IMHO, this behavior defeats the purpose of hot deployment.
>
> If I have a dozen web-apps that all depend on one ejb jar file, and
> I redeploy that ejb jar file, I shouldn't have to redeploy the
> other dozen web-apps!
>
> -- Jim
>
> Neal Sanche wrote:
> > You'll probably see that due to the classloading. I'd suggest
> > packaging your servlets and ejbs into an .ear file. That way both
> > your servlets and your EJBs will use the same classloader, and
> > will be restarted at the same time during hot deployment. I do
> > this, and don't have any problems with classloading.
> >
> > Cheers.
> >
> > -Neal
> >
> > On Friday 25 October 2002 11:24 am, Jaydeep Dhar wrote:
> >>Hi,
> >>I am using jboss 3.0.3 integrated with jetty web server.
> >>I am getting following problem during devlepment of simple
> >>application. 1) I have developed a simple staless session bean
> >> and putted the .jar file in deploy directory. It works fine when
> >> i call it from the servlet but once I change anything thing in
> >> EJB and replace into the deploy directory, it give following
> >> error when i call it from the same servlet. 20:48:44,171 INFO 
> >> [STDOUT] GENERAL_EXCEPTIONjava.lang.ClassCastException
> >> 20:48:44,203 WARN [jbossweb] WARNING: Exception for
> >> /test/servlet/Hello
> >>java.lang.NullPointerException
> >>        at Hello.doGet(Hello.java:52)
> >>        at
> >>javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
> >>javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >>
> >>During replacement of jar it is showing Bean deployed properly. 
> >> IS the above problem is due to hot deployement becouse if i
> >> restart the server then everything works fine and the changes in
> >> bean also get reflected.
> >>
> >>2) I have created a application directory which basically contain
> >>the jsp file and servlet and placed it into the deploy
> >>directory.when i try to invoke any of the component, the server
> >>doesn't get it and give error. But if I create the war file of
> >> that application and place into the the deploy directory, than
> >> it works fine. Is it necessary to creat war file to run it.
> >>
> >>
> >>pls respond to above mail as I need it urgently.
> >>
> >>
> >>
> >>
> >>-------------------------------------------------------
> >>This sf.net email is sponsored by: Influence the future
> >>of Java(TM) technology. Join the Java Community
> >>Process(SM) (JCP(SM)) program now.
> >>http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en
> >>_______________________________________________
> >>JBoss-user mailing list
> >>[EMAIL PROTECTED]
> >>https://lists.sourceforge.net/lists/listinfo/jboss-user
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by: Influence the future
> > of Java(TM) technology. Join the Java Community
> > Process(SM) (JCP(SM)) program now.
> > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/jboss-user
>
> -------------------------------------------------------
> This sf.net email is sponsored by: Influence the future
> of Java(TM) technology. Join the Java Community
> Process(SM) (JCP(SM)) program now.
> http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user



-------------------------------------------------------
This sf.net email is sponsored by: Influence the future 
of Java(TM) technology. Join the Java Community 
Process(SM) (JCP(SM)) program now. 
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to