On 23.02.2006 09:53:41 jelka.kosir wrote:
> Jeremias Maerki <[EMAIL PROTECTED]> wrote on 22.02.2006 18:50:07:
> 
> > Added a Wiki page, in case anybody needs that in the future:
> > http://wiki.apache.org/xmlgraphics-fop/HowTo/BasicHttpAuthentication
> 
> 
> Seems easy enough even for me to implement :) thank you
> 
> I have a feeling you overlooked some responses I made for you, so just to 
> be sure here they are again.
> I need to know if there is something I have to do with my findings (maybe 
> report somewhere ?)

Sorry, answering now...

I've looked into it. The java.net.URL instance that gets created does
contain the username and password but when its openStream() method is
called this authentication info seems to be ignored. So, it's not a bug
in FOP, but something weird in Sun's Java class library.

David Delbecq's remark earlier is obviously correct. Using the
Authenticator approach in a J2EE environment is not optimal. I found a
different and probably much better approach which I added to the Wiki
page I wrote earlier:
http://wiki.apache.org/xmlgraphics-fop/HowTo/BasicHttpAuthentication
(You'll need the latest FOP Trunk for that to work!)

I hope that helps.

> ------ 
> Jeremias wrote: 
> > On the other side it's strange that wget is able to get the image with
> > the uid/pwd encoded in the URL and FOP is not. Maybe FOP 0.20.5 does
> > something bad with the URL. It would be great if someone could check
> > this case with FOP Trunk so we can fix any problems like that for the
> > next release. 
> 
> I did try the "http://username:[EMAIL PROTECTED]/resource.gif" notation 
> with the new FOP Trunk and I'm getting error 401 code (Unauthorized). 
> This url works in wget. Should a bug report be submitted ? 
>
> This is the error message that displays when I run Fop Trunk from command 
> line: 
> 
> Error with opening URL '//user:[EMAIL PROTECTED]/image.gif': Server 
> retu 
> rned HTTP response code: 401 for URL: 
> http://user:[EMAIL PROTECTED]/image.gif 
> java.io.IOException: Server returned HTTP response code: 401 for URL: 
> http://user:[EMAIL PROTECTED]/image.gif 
> 
> I also tried this notation in my custom config file (I use custom fonts 
> because character set we use is Latin 2) I set 
> <base>http://user:[EMAIL PROTECTED]/</base> 
> and this produces Error 401 when I run FOP Trunk from command line (wget 
> is able to retrieve with this url). 
> 
> Error with opening URL 'arial.xml': Server returned HTTP response code: 
> 401 for 
> URL: http://user:[EMAIL PROTECTED]/arial.xml 
> java.io.IOException: Server returned HTTP response code: 401 for URL: 
> http://user:[EMAIL PROTECTED]/arial.xml 
> 
> Mismatch: page-sequence (http://www.w3.org/1999/XSL/Format) vs. root 
> (http://www 
> .w3.org/1999/XSL/Format) 
> Error with opening URL 'arial.xml': Server returned HTTP response code: 
> 401 for 
> URL: http://user:[EMAIL PROTECTED]/arial.xml 
> java.io.IOException: Server returned HTTP response code: 401 for URL: 
> http://user:[EMAIL PROTECTED]/arial.xml 
> 
> javax.xml.transform.TransformerException: java.lang.RuntimeException: 
> Cannot loa 
> d font: failed to create Source from metrics file arial.xml 
> Exception 
> javax.xml.transform.TransformerException: java.lang.RuntimeException: 
> Cannot loa 
> d font: failed to create Source from metrics file arial.xml 



Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to