Catching image fetch exception



I am rendering some rough and ready HTML as part of a screen-scraping
task.

Presumably it is NOT valid HTML. I get messages like these often:

Uncaught error fetching image:
Exception in thread "AWT-EventQueue-1" java.lang.SecurityException
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at sun.awt.image.URLImageSource.checkSecurity(Unknown Source)
at sun.awt.image.ImageRepresentation.imageComplete(Unknown
Source)
at sun.awt.image.InputStreamImageSource.errorConsumer(Unknown
Source)
at sun.awt.image.InputStreamImageSource.setDecoder(Unknown
Source)
at sun.awt.image.InputStreamImageSource.doFetch(Unknown
Source)
at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
at sun.awt.image.ImageFetcher.run(Unknown Source)
Exception in thread "AWT-EventQueue-1" java.lang.SecurityExceptio


OR

Exception in thread "AWT-EventQueue-1" java.lang.SecurityException
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at sun.awt.image.URLImageSource.checkSecurity(Unknown Source)
at sun.awt.image.ToolkitImage.getHeight(Unknown Source)
at javax.swing.text.html.ImageView.hasPixels(Unknown Source)
at javax.swing.text.html.ImageView.paint(Unknown Source)
at javax.swing.text.BoxView.paintChild(Unknown Source)
at javax.swing.text.BoxView.paint(Unknown Source)
at javax.swing.text.BoxView.paintChild(Unknown Source)
at javax.swing.text.BoxView.paint(Unknown Source)
at javax.swing.text.ParagraphView.paint(Unknown Source)
at javax.swing.text.html.ParagraphView.paint(Unknown Source)
at javax.swing.text.BoxView.paintChild(Unknown Source)
at javax.swing.text.BoxView.paint(Unknown Source)
at javax.swing.text.html.BlockView.paint(Unknown Source)
at javax.swing.text.BoxView.paintChild(Unknown Source)
at javax.swing.text.BoxView.paint(Unknown Source)
at javax.swing.text.html.TableView$RowView.paint(Unknown
Source)
at javax.swing.text.html.TableView.paint(Unknown Source)
at javax.swing.text.BoxView.paintChild(Unknown Source)
at javax.swing.text.BoxView.paint(Unknown Source)
at javax.swing.text.html.BlockView.paint(Unknown Source)
at javax.swing.text.BoxView.paintChild(Unknown Source)
at javax.swing.text.BoxView.paint(Unknown Source)
at javax.swing.text.html.TableView$RowView.paint(Unknown
Source)
at javax.swing.text.html.TableView.paint(Unknown Source)
at javax.swing.text.BoxView.paintChild(Unknown Source)
at javax.swing.text.BoxView.paint(Unknown Source)
at javax.swing.text.html.BlockView.paint(Unknown Source)
at javax.swing.text.BoxView.paintChild(Unknown Source)
at javax.swing.text.BoxView.paint(Unknown Source)
at javax.swing.text.html.TableView$RowView.paint(Unknown
Source)
at javax.swing.text.html.TableView.paint(Unknown Source)
at javax.swing.text.BoxView.paintChild(Unknown Source)
at javax.swing.text.BoxView.paint(Unknown Source)
at javax.swing.text.html.BlockView.paint(Unknown Source)
at javax.swing.text.BoxView.paintChild(Unknown Source)
at javax.swing.text.BoxView.paint(Unknown Source)
at javax.swing.text.html.BlockView.paint(Unknown Source)
at javax.swing.text.BoxView.paintChild(Unknown Source)
at javax.swing.text.BoxView.paint(Unknown Source)
at javax.swing.text.html.BlockView.paint(Unknown Source)
at javax.swing.plaf.basic.BasicTextUI$RootView.paint(Unknown
Source)
at javax.swing.plaf.basic.BasicTextUI.paintSafely(Unknown
Source)
at javax.swing.plaf.basic.BasicTextUI.paint(Unknown Source)
at javax.swing.plaf.synth.SynthEditorPaneUI.paint(Unknown
Source)
at javax.swing.plaf.synth.SynthEditorPaneUI.update(Unknown
Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JViewport.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at
javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown
Source)
at javax.swing.RepaintManager$PaintManager.paint(Unknown
Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown
Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown
Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown
Source)
at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown
Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)


I presume these are a side effect of links to images that don't exist,
or that are not being rendered relative the the correct base.

So questions:

1. can I fake the base the HTML came from.

2. is there a way to catch these exceptions and ignore them?
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Climate change is no longer a doomsday prophecy, it?s a reality."
~ Astrid Heiberg president of the International Federation of Red Cross and Red Crescent Societies
.



Relevant Pages

  • Re: safari rendering bug: site display not correct
    ... > The problem there is not Safari, it's your HTML. ... > and you cannot reasonably expect a specific rendering. ... invalid elements and failure to close inline elements (and either ...
    (comp.sys.mac.apps)
  • Re: trying to achieve Level Triple-A conformance
    ... rendering but also behaviour. ... that the HTML DTD requires. ... the way browsers occasionally do decide to repair it for you. ... Validation is the process of comparing a document that DTD. ...
    (alt.html)
  • Re: How can I prevent spaces between tags being rendered?
    ... By not embedding whitespace (spaces or linebreaks, ... Whatever the rules for rendering HTML & CSS say, ... Remember that you can place whitespace _inside_ tags quite easily, ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: Future standard GUI library
    ... With a protocol that wasn't made for the purpose (such as HTTP) and all ... Yosemite involve three computers (the client, the server, and the file ... HTTP server, network, application logic, and generation of HTML, all ... That leaves 17ms for rendering HTML. ...
    (comp.lang.python)
  • Re: adding white space in


    ... before offering advice on HTML in public), you will see that explicitly says that the rendering effect of no-break space is undefined. ... So revealing the URL will just make this explicit: ... "This specification does not indicate the behavior, rendering or otherwise, of space characters other than those explicitly identified here as white space characters. ...
    (comp.infosystems.www.authoring.html)