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? thanks, Andrius
RE: Adding Fonts to userconfig...
-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
RE: Adding Fonts to userconfig...
Quoting Arved Sandstrom [EMAIL PROTECTED]: -Original Message- From: Andrius Sabanas [mailto:[EMAIL PROTECTED] Sent: April 29, 2002 5:32 AM To: [EMAIL PROTECTED] Subject: Re: Adding Fonts to userconfig... {SNIP] 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. I don't normally reply to my own posts but I wanted to add a couple of comments: 1) I was being very pedantic in my above comments. I sometimes get irritated with specifications that aren't written clearly in spots, and in this case I was being very nitpicky. 2) In fact Tomcat does have separate classloaders for each web-app and this is a safe assumption to make in practise. I imagine that all other recent or decent servlet containers operate the same way. 3) It's hard work to write a spec. I've had to write a few myself. :-) Regards, AHS - This mail sent through Chebucto Community Net http://www.chebucto.ns.ca/
Re: Adding Fonts to userconfig...
THANKS! Both solutions worked. Changing the baseDir appears to be a little cleaner. Any down side to changing the baseDire? Shawn Lindstrom [EMAIL PROTECTED] wrote: I'm attempting to add a font to my userconfig.xml file. I'm using fop version 0.20.1. Unless you have reasons to stay with 0.20.1, you should upgrade to 0.20.3. BUT - Obviously I'd like to have more control where I put my font and metric files so I've attempted numerous ways of specifying a specific path to locate these files and every combination I've tried has failed. You can set the baseDir in the userconfig: entry keybaseDir/key valueC:\Fop-0.20.1\conf\/value /entry configuration fonts font metrics-file=C:\Fop-0.20.1\conf\complogoTTF.xml kerning =yes The value for the metrics-file attribute should be an URL, try font metrics-file=file:///C:/Fop-0.20.1/conf/complogoTTF.xml kerning =yes HTH J.Pietschmann
Re: Adding Fonts to userconfig...
[EMAIL PROTECTED] wrote: I'm attempting to add a font to my userconfig.xml file. I'm using fop version 0.20.1. Unless you have reasons to stay with 0.20.1, you should upgrade to 0.20.3. BUT - Obviously I'd like to have more control where I put my font and metric files so I've attempted numerous ways of specifying a specific path to locate these files and every combination I've tried has failed. You can set the baseDir in the userconfig: entry keybaseDir/key valueC:\Fop-0.20.1\conf\/value /entry configuration fonts font metrics-file=C:\Fop-0.20.1\conf\complogoTTF.xml kerning=yes The value for the metrics-file attribute should be an URL, try font metrics-file=file:///C:/Fop-0.20.1/conf/complogoTTF.xml kerning=yes HTH J.Pietschmann