|
From: <jue...@we...> - 2003-08-25 16:37:46
|
Thomas, Lars, Oops, didn't think of that: Yes, we dropped ContextLoaderServlet before = 0.9, and re-added it after 0.9.1 for Servlet 2.2 containers. Seems that = we now have one more reason for it: Servlet 2.3 containers with awkward = initialization order. Anyway, ContextLoaderServlet *will* be in 1.0 M1, to be released at the = end of this week if there aren't any major obstacles. BTW, can everybody = please test the current CVS contents against own applications? Lars, 1.0 M1 will be the first release with org.springframework as = package name, but it should still be a drop-in replacement if you = replace com.interface21 with org.springframework in all of your code = (both Java source and XML files). Juergen -----Original Message----- From: tri...@tr... [mailto:tri...@tr...] Sent: Monday, August 25, 2003 4:33 PM To: j=FCrgen h=F6ller [werk3AT] Cc: Lars Fischer; spr...@li... Subject: RE: [Springframework-developer] Example classes needed Juergen, The problem is that 'com.interface21.web.context.ContextLoaderServlet' = can't=20 be found in the classpath - it is not in the spring-full-0.9.jar from = the=20 distribution. Did we remove this file and later add it back in? Lars - I have attached a jar file that contains this missing class - add = that=20 to your lib directory. Also, remove the <listener> entry in web.xml. Thomas > Lars, >=20 > You mean that >=20 > <servlet> > <servlet-name>contextLoader</servlet-name> > =20 > = <servlet-class>com.interface21.web.context.ContextLoaderServlet</servlet-= class> > <load-on-startup>1</load-on-startup> > </servlet> >=20 > <servlet> > <servlet-name>example</servlet-name> > =20 > = <servlet-class>com.interface21.web.servlet.DispatcherServlet</servlet-cla= ss> > <load-on-startup>2</load-on-startup> > </servlet> >=20 > still loads the DispatcherServlet before the ContextLoaderServlet? = Ignoring > the load-on-startup values would be a major bug in WebLogic's web = container. > Are you *really* sure that a web.xml with entries like the above = causes wrong > initialization order? Please recheck that thoroughly! >=20 > It's bad enough that WebLogic invokes the listeners at the wrong time, = but > unfortunately that is not actually conflicting with the current spec. = I can't > believe that it ignores servlet load-on-startup values though - how = did it > get its J2EE 1.3 certification then? It seems to work on Thomas' > installation, so there should be a way to make it work on yours. >=20 > Even in the extreme case, a solution can be found. You could for = example just > use a servlet-specific context and no root context, by simply omitting = the > context loader definition. You could subclass DispatcherServlet to = perform > initialization of the root context before continuing with its own. But = I'm > pretty sure that none of these will be necessary. >=20 > Juergen >=20 >=20 > -----Original Message----- > From: Lars Fischer [mailto:lar...@gm...] > Sent: Monday, August 25, 2003 10:32 AM > To: j=FCrgen h=F6ller [werk3AT] > Cc: tri...@tr...; = spr...@li... > Subject: RE: [Springframework-developer] Example classes needed >=20 >=20 > J=FCrgen, >=20 > the problem is that the ***-servlet.xml stuff is always loaded before > the applicationContext.xml stuff no matter what I define in=20 > web.xml. This is against the documentation. >=20 > I will open a case with BEA support (this would be the first time they > would solve an issue but you can never know ...). >=20 > It seems like I have to use another server but unless there is no = error > in my application Spring is no alternative for production applications > (Petclinic does not work too at the moment). >=20 > Is there any difference between the Java SDK versions ? >=20 > Thanks > Lars >=20 > > Lars, Thomas, > >=20 > > I guess that WebLogic simply invokes the listeners after = load-on-startup=20 > > servlets. Bad WebLogic ;-) > >=20 > > Unfortunately, the Servlet 2.3 spec leaves this unspecified. The = Servlet=20 > > 2.4 spec clarifies that listeners have to be *initialized before* = and=20 > > *destroyed after* any servlets. Tomcat and Resin already behave this = > > way, Orion does too since 2.0.2 after I've informed them about the=20 > > Servlet 2.4 clarification... > >=20 > > For a solution with current WebLogic versions, I agree that using = the=20 > > servlet initializers like ContextLoaderServlet and = Log4jConfigServlet is=20 > > probably the best choice, as Thomas has recommended. > >=20 > > Juergen > >=20 > >=20 > > -----Original Message----- > > From: tri...@tr... [mailto:tri...@tr...] > > Sent: Sunday, August 24, 2003 10:49 PM > > To: Lars Fischer > > Cc: spr...@li... > > Subject: Re: [Springframework-developer] Example classes needed > >=20 > >=20 > > Lars, > >=20 > > Loading ContextLoaderServlet as a servlet with load-on-startup set = to 1=20 > > and > > loading DispatcherServlet with load-on-startup set to 2 works for me = on=20 > > WebLogic > > 8.1 SP1. If it does not work, could you send me the web.xml and = your=20 > > log output? > >=20 > > Also, I get the same errors deploying the Petclinic, so it does not = work=20 > > for me. > > Can you send me the petclinic war file that works with WebLogic 8.1 = SP1=20 > > so I > > can try it on my server? > >=20 > > Thomas > >=20 > >=20 > > > Thomas, > > >=20 > > > thanks for the suggestion. Tried it but it doesn't work. > > >=20 > > > This is a serious one: > > >=20 > > > Tested my app with Tomcat 4.1.24 and it works. > > >=20 > > > I does NOT work with > > >=20 > > > WebLogic 8.1 SP1, WebLogic Express SP1, WebLogic 7.0 SP3. > > >=20 > > > What makes me wonder is that Petclinic works with WebLogic 8.1 = SP1. > > >=20 > > > Regards > > > Lars > > >=20 > > > > Lars, > > > >=20 > > > > I have looked into this a little bit more. What happens is that = > > > > ServletContextListener.contextInitialized() method is called = _after_=20 > > the =20 > > > > HttpServlet.init() method is called on servlets specified with=20 > > <load-on- > > > > startup>. This causes the xxx-servlet.xml to be loaded before = the=20 > > > > applicationContext.xml is loaded, so that is why you can't = reference=20 > >=20 > > > > the 'cwxDao' bean. This behavior is the opposite of what I see = for > > > > Tomcat,=20 > > > > and I'm sure the same is true for Orion and Resin that Juergen = is=20 > > using.=20 > > > > I=20 > > > > looked in the Servlet 2.3 specification, but I did not see = anything > > > > specifying=20 > > > > which order these methods should be called in. Maybe Juergen or = Rod=20 > > can > > > > shed=20 > > > > some more light on this issue. =20 > > > >=20 > > > > You should be able to use the ContextLoaderServlet for now. > > > >=20 > > > > Thomas > >=20 >=20 >=20 |