|
From: <jue...@we...> - 2003-08-26 02:13:11
|
Lars,
You mean that
<servlet>
<servlet-name>contextLoader</servlet-name>
=
<servlet-class>com.interface21.web.context.ContextLoaderServlet</servlet-=
class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>example</servlet-name>
=
<servlet-class>com.interface21.web.servlet.DispatcherServlet</servlet-cla=
ss>
<load-on-startup>2</load-on-startup>
</servlet>
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!
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.
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.
Juergen
-----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
J=FCrgen,
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.
I will open a case with BEA support (this would be the first time they
would solve an issue but you can never know ...).
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).
Is there any difference between the Java SDK versions ?
Thanks
Lars
> 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=20
> 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=20
> > > 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 =
> > > 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
|