RE: Adding Fonts to userconfig...

2002-04-29 Thread Arved_37
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...

2002-04-29 Thread Arved Sandstrom
> -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...

2002-04-29 Thread Andrius Sabanas
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...

2002-04-28 Thread J.Pietschmann
[EMAIL PROTECTED] wrote:
...  Any down side to changing the baseDire?
Yes, it's global. You may run into problems with
multithreaded servers.
J.Pietschmann


Re: Adding Fonts to userconfig...

2002-04-25 Thread Shawn.Lindstrom

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:
   
 baseDir
 C:\Fop-0.20.1\conf\
   

> 
>
>   

Re: Adding Fonts to userconfig...

2002-04-24 Thread J.Pietschmann
[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:
  
baseDir
C:\Fop-0.20.1\conf\
  

   
  The value for the metrics-file attribute should be an URL,
try
   
HTH
J.Pietschmann


Adding Fonts to userconfig...

2002-04-24 Thread Shawn.Lindstrom

I'm attempting to add a font to my userconfig.xml file.  I'm using fop
version 0.20.1.
I've followed the directions at apache for adding fonts -
http://xml.apache.org/fop/fonts.html



I'm using VisualAge for Java running in the Websphere test environment on
windows 2000.
In my Java I've specified the option of the userconfig file with the API:
//Set the User Config File which includes the company font
File userConfigFile = new File("C:
\\Fop-0.20.1\\conf\\userconfig.xml"); //temp hardcode
Options options = new Options(userConfigFile);

When I don't specify a path to where my metrics and ttf file are located I
get the following error:
  reading user configuration file
  building formatting object tree
  setting up fonts
   [1Failed to read font metrics file complogoTTF.xml :
  File
"file:///C:/IBMVJava353/ide/tools/com-ibm-ivj-ui-webcontrolcenter/complogoTTF.xml"

not found.
  [2java.lang.RuntimeException: java.lang.NullPointerException

So I placed my metrics file and ttf file in the
"C:/IBMVJava353/ide/tools/com-ibm-ivj-ui-webcontrolcenter" folder and
everything works like it should.
Here is the userconfig.xml file I used:

   
  
 
 
    
   





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.

Here is an example I've tried and the error I get when I run it:

   
  
 
 
    
   


reading user configuration file
building formatting object tree
setting up fonts
 [1Failed to read font metrics file C:\Fop-0.20.1\conf\complogoTTF.xml :
File "C:\Fop-0.20.1\conf\complogoTTF.xml" not found.
[2java.lang.RuntimeException: java.lang.NullPointerException


I've checked and rechecked and had others check and recheck that there are
no spelling mistakes in this path.  I've pasted it into a command line and
the file opens up - i.e. the path is correct.
I've tried every combination of forward and back slashes I could think of.
I'm sure I've missed a few - at least the one that works :).
Any Suggestions?
Or, do I simply have to accept that FOP will determine where these files
are located on my server?



Any help would be greatly appreciated!

Shawn Lindstrom