You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by b....@freenet.de on 2007/04/26 12:15:51 UTC

fop.jar, Service-registration mechanism, one-jar problem

Hi there,

I maintain a sort of release notes application, that is capable of exporting release notes information to various formats. I tried to add FOP-support to it and failed. I'm limited to one-jar solutions, I'm not allowed to refer to any sort of external package. That's why I use a huge jar containing all the neat stuff, including FOP.

Now FOP does a funny thing with renderer-registration and I don't see the use for it. Instead of doing a sort of init process like:

- create map
- register internal classes with MIMEs
- handover map to plugin concept

you do something like "read entries from file fop.jar and register if instance of some sort of abstract renderer". I don't have no fop.jar and it starts, but as soon as I transform something it fails to load the MIME-relevant renderer classes. Makes no sense to me, because I've packed them into the app's jar...they're definitely available.

I also tried to register the renderers on my own (RendererMakers), but this causes some weird class cast exceptions with TransformerFactory (I assume somebody casts something into a non-SAX-special class, while I switched to SAX-implementation via System.properties).

So how to get rid of this problem while relying on FOP and using it as part of a all-in-one-jar?

Thanks so far...









---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: fop.jar, Service-registration mechanism, one-jar problem

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Plus, you may need to merge some text files inside /META-INF/services if
you merge multiple JARs which may have files with the same name.

BTW, FOP doesn't do "funny things" concerning renderer registration.
This is a properly documented facility offered through Java. See here:
http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html#Service%20Provider
Many packages use that facility including: ImageIO, javax.sound, Apache
Batik, Apache Xalan-J and many more.


On 27.04.2007 02:10:20 Daniel Noll wrote:
> b.ohnsorg@freenet.de wrote:
> > Now FOP does a funny thing with renderer-registration and I don't see
> > the use for it. Instead of doing a sort of init process like:
> > 
> > - create map
>  > - register internal classes with MIMEs
>  > - handover map to plugin concept
> > 
> > you do something like "read entries from file fop.jar and register if
> > instance of some sort of abstract renderer".
> 
> It sounds like you might have just forgotten to put the content of 
> fop.jar's /META-INF directory into your own jar file.
> 
> Daniel
> 



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: fop.jar, Service-registration mechanism, one-jar problem

Posted by Daniel Noll <da...@nuix.com>.
b.ohnsorg@freenet.de wrote:
> Now FOP does a funny thing with renderer-registration and I don't see
> the use for it. Instead of doing a sort of init process like:
> 
> - create map
 > - register internal classes with MIMEs
 > - handover map to plugin concept
> 
> you do something like "read entries from file fop.jar and register if
> instance of some sort of abstract renderer".

It sounds like you might have just forgotten to put the content of 
fop.jar's /META-INF directory into your own jar file.

Daniel

-- 
Daniel Noll

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org