[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fop-user
Subject:    Re: RendererFactory: UnsupportedOperationException by using jar -i (INDEX.LIST)
From:       Jeremias Maerki <dev () jeremias-maerki ! ch>
Date:       2008-03-17 7:58:56
Message-ID: 20080317084531.50F4.DEV () jeremias-maerki ! ch
[Download RAW message or body]

I've never worked with INDEX.LIST. But you're on the right track, I
think. The documentation says on the "jar" tool:
"An INDEX.LIST file is inserted to the META-INF directory which will
enable the application class loader to download the specified jar files
when it is searching for classes or resources."

The API classes from FOP don't reference the PDFRenderer, for example,
directly. If the PDFRenderer (handling "application/pdf") were in a
seperate JARs the class loader wouldn't know that it has to download
this JAR/class and dependent classes. Why this doesn't happen even if
the PDFRenderer is in the same JAR as the rest of FOP eludes me. Some
remote debugging might be indicated.

The peculiar thing is that the INDEX.LIST mechanism and the service
provider mechanism we use in FOP is documented right next to each but
doesn't seem to work properly:
http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html
I would expect the JVM to detect that there are service providers in a
JAR.

The Sun bug database might also reveal some further information:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4408526

Other projects seem to have similar problems:
http://www.xsmiles.org/configuration2.html

GIYF. Good luck!

On 12.03.2008 14:44:04 Jan Wilhelm wrote:
> Hello,
> 
> we switched recently from fop 0.20.5 to 0.94. Now there appears to be a
> problem with jars containing an INDEX.LIST. Is there a known problem
> with the usage of the jar -i command?
> 
> We use quite a number of jar-files (around 300 - 350) so using an
> INDEX.LIST improves the startup-time of our application. After switching
> to FOP 0.94 and making the necessary changes to the code and the xsls,
> generating pdfs worked quite well . . . from Eclipse. After we packaged
> the application into a jar file using the -I switch to generate a file
> INDEX.LIST it is no longer possible to generate pdfs. I get the
> error-message:
> 
> Caused by: java.lang.UnsupportedOperationException: Don't know how to
> handle "application/pdf" as an output format. Neither an FOEventHandler,
> nor a Renderer could be found for this output format.
> 
> We do not package all jars into one large jar. We keep them separate and
> use a long classpath. Deleting the INDEX.LIST from the app.jar solves
> the problem but increases startup-time.
> 
> Apparently the files in the folder META-INF/services are no longer
> found. (I figured this out by searching the mailing list. . . ) Is there
> a way to still use the INDEX.LIST? Is using this discouraged?
> 
> Any help is appreciated
> 
> Jan
> 



Jeremias Maerki


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic