On Fri, Jul 1, 2011 at 11:12, Freeman Fang <freeman.f...@gmail.com> wrote: > Hi, > > I believe this is from another classloder issue, that said, the > classloader(it could be your servlet war classloader) which load > org.apache.cxf.transport.servlet.CXFServlet isn't the one(it could be the > container classloader) which load javax.servlet.Servlet, so although > org.apache.cxf.transport.servlet.CXFServlet is actually a servlet class, > you still see such exception. > This should come from the class loader policy you changed here. The > workaround probably could be you add a jar(like > geronimo-servlet_3.0_spec.jar) which contain javax.servlet.Servlet in your > WEB-INF/lib.
I think it's actually the other way round. The application probably contains the javax.servlet.Servlet class in one of the JARs in WEB-INF/lib, while it shouldn't. > I'd say this kind of lib version conflict issue(neethi in your case) between > the container and your application module(the war) is really general, the > self-first classloader solution may not always work and it may bring more > troubles, the root reason is that the classloader mechanism used by > JEE/Servlet container isn't very dynamic and you actually have no full > control about how to load classes from your own module, to fix this kind of > issue, a new technique(OSGi container) was brought up and it is very > powerful to handle such problem you encounter, you can easily specify the > lib version you want to use in your own module, and different versions lib > co-exist in same container won't be a problem anymore. > > Freeman > On 2011-7-1, at 下午1:06, Lalit Kumar wrote: > >> >> Hi, >> >> I tried changing the class loader policy for module 1st but following >> error >> started appearing >> >> Error 404: javax.servlet.UnavailableException: SRVE0201E: Servlet >> [org.apache.cxf.transport.servlet.CXFServlet]: not a servlet class >> >> As far as neethi is concerened it is being loaded lony once >> >> Regards, >> Lalit Kumar >> >> ----- >> Lalit Kumar >> Technical Specialist >> Fidelity International >> -- >> View this message in context: >> http://cxf.547215.n5.nabble.com/Could-not-instantiate-bean-SpringBus-2-4-1-tp4539354p4541011.html >> Sent from the cxf-dev mailing list archive at Nabble.com. > > --------------------------------------------- > Freeman Fang > > FuseSource > Email:ff...@fusesource.com > Web: fusesource.com > Twitter: freemanfang > Blog: http://freemanfang.blogspot.com > > > > > > > > > >