> -----Original Message----- > From: Andrius Sabanas [mailto:[EMAIL PROTECTED] > Sent: April 29, 2002 5:32 AM > To: [EMAIL PROTECTED] > Subject: Re: Adding Fonts to userconfig... > > > J.Pietschmann wrote: > > [EMAIL PROTECTED] wrote: > > > >> ... Any down side to changing the baseDire? > > > > > > Yes, it's global. You may run into problems with > > multithreaded servers. > > > > J.Pietschmann > > > > Hello, > > I would like to install 2 webapps with servlets using FOP on the same > servlet engine. Both of them specify their own userconfig.xml files, but > I do not use baseDir, rather get the absolute paths hardcoded. > > Now I wonder if I am going to get a conflict between those two. This > design with static (magic) Options passing seems bizzare to me :-) > But as I understand, separate webapps get loaded by separate > classloaders, so is there any problem? Can anybody comment on this?
The Servlet 2.3 specification is the first servlet spec to really have much to say about classloaders; sections 3.7 and 9.7 in particular. Most of the items are recommendations, not definite requirements. (I consider "musts" and "shoulds" to be definite requirements). In any case, there is nothing in the spec that says that each web application gets its own classloader. In fact even if all "musts", "shoulds" and recommendations are satisfied you could still have one classloader for the servlet container and all web-apps; it's just that that single classloader has certain rules. The situation is akin to that of loading application classes when invoking Java on the command line. You might have class A in each of 2 separate JARs, and also loose in yet another location, all three of which are in your classpath. Do you expect each location to be serviced by its own classloader? No, likely not. It may be that the Tomcat reference implementation has separate classloaders for each webapp. If so, this would be a signal to other servlet container authors that even if that is not required (or suggested) by the spec, that it's a good idea. But in the interests of portability I wouldn't rely on this. I think we are trying to fix things up in terms of use of statics. I want to point out that when Fop was begun that there was no idea that people would want to run the thing inside a servlet; it was meant to be a command-line processor that ran in its own JVM and produced PDF files. Regards, AHS