xmlgraphics-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vlad Arkhipov (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (XGC-98) UndeclaredThrowableException while loading images
Date Thu, 02 Jul 2015 06:06:04 GMT

     [ https://issues.apache.org/jira/browse/XGC-98?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Vlad Arkhipov updated XGC-98:
-----------------------------
    Description: 
UndeclaredThrowableException is thrown if an image cannot be loaded for some reason.

{code}
Caused by: java.lang.reflect.UndeclaredThrowableException
        at com.sun.proxy.$Proxy313.readUnsignedInt(Unknown Source)
        at org.apache.xmlgraphics.image.loader.impl.PreloaderEPS.preloadImage(PreloaderEPS.java:65)
[xmlgraphics-commons-1.5.jar:1.5]
        at org.apache.xmlgraphics.image.loader.ImageManager.preloadImage(ImageManager.java:175)
[xmlgraphics-commons-1.5.jar:1.5]
        at org.apache.xmlgraphics.image.loader.cache.ImageCache.needImageInfo(ImageCache.java:128)
[xmlgraphics-commons-1.5.jar:1.5]
        at org.apache.xmlgraphics.image.loader.ImageManager.getImageInfo(ImageManager.java:122)
[xmlgraphics-commons-1.5.jar:1.5]
        at org.apache.fop.fo.flow.ExternalGraphic.bind(ExternalGraphic.java:81) [fop-1.1.jar:]
        at org.apache.fop.fo.FObj.processNode(FObj.java:124) [fop-1.1.jar:]
        at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:280)
[fop-1.1.jar:]
        at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:175) [fop-1.1.jar:]
...
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.GeneratedMethodAccessor2609.invoke(Unknown Source) [:1.8.0_25]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.8.0_25]
        at java.lang.reflect.Method.invoke(Method.java:483) [rt.jar:1.8.0_25]
        at org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext$ObservingImageInputStreamInvocationHandler.invoke(AbstractImageSessionContext.java:219)
[
xmlgraphics-commons-1.5.jar:1.5]
        ... 254 more
Caused by: java.io.EOFException
        at javax.imageio.stream.ImageInputStreamImpl.readInt(ImageInputStreamImpl.java:251)
[rt.jar:1.8.0_25]
        at javax.imageio.stream.ImageInputStreamImpl.readUnsignedInt(ImageInputStreamImpl.java:266)
[rt.jar:1.8.0_25]
        ... 258 more
{code}

The problem being that InvocationHandlers in the classes AbstractImageSessionContext and ObservableStream
do not handle InvocationTargetException properly, and the exception is propagated up to the
proxied interface where InvocationTargetException is not specified.

I am not sure if you accept pull requests on Github, anyway here it is https://github.com/apache/xml-graphics-commons/pull/1

  was:
UndeclaredThrowableException is thrown if an image cannot be loaded for some reason.

{code}
Caused by: java.lang.reflect.UndeclaredThrowableException
        at com.sun.proxy.$Proxy313.readUnsignedInt(Unknown Source)
        at org.apache.xmlgraphics.image.loader.impl.PreloaderEPS.preloadImage(PreloaderEPS.java:65)
[xmlgraphics-commons-1.5.jar:1.5]
        at org.apache.xmlgraphics.image.loader.ImageManager.preloadImage(ImageManager.java:175)
[xmlgraphics-commons-1.5.jar:1.5]
        at org.apache.xmlgraphics.image.loader.cache.ImageCache.needImageInfo(ImageCache.java:128)
[xmlgraphics-commons-1.5.jar:1.5]
        at org.apache.xmlgraphics.image.loader.ImageManager.getImageInfo(ImageManager.java:122)
[xmlgraphics-commons-1.5.jar:1.5]
        at org.apache.fop.fo.flow.ExternalGraphic.bind(ExternalGraphic.java:81) [fop-1.1.jar:]
        at org.apache.fop.fo.FObj.processNode(FObj.java:124) [fop-1.1.jar:]
        at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:280)
[fop-1.1.jar:]
        at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:175) [fop-1.1.jar:]
...
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.GeneratedMethodAccessor2609.invoke(Unknown Source) [:1.8.0_25]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.8.0_25]
        at java.lang.reflect.Method.invoke(Method.java:483) [rt.jar:1.8.0_25]
        at org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext$ObservingImageInputStreamInvocationHandler.invoke(AbstractImageSessionContext.java:219)
[
xmlgraphics-commons-1.5.jar:1.5]
        ... 254 more
Caused by: java.io.EOFException
        at javax.imageio.stream.ImageInputStreamImpl.readInt(ImageInputStreamImpl.java:251)
[rt.jar:1.8.0_25]
        at javax.imageio.stream.ImageInputStreamImpl.readUnsignedInt(ImageInputStreamImpl.java:266)
[rt.jar:1.8.0_25]
        ... 258 more
{code}

The problem being that InvocationHandlers in the classes AbstractImageSessionContext and ObservableStream
do not handle InvocationTargetException properly, and the exception is propagated up to the
proxied interface where InvocationTargetException is not specified.


> UndeclaredThrowableException while loading images
> -------------------------------------------------
>
>                 Key: XGC-98
>                 URL: https://issues.apache.org/jira/browse/XGC-98
>             Project: XMLGraphicsCommons
>          Issue Type: Bug
>    Affects Versions: 1.5, 2.0.1
>            Reporter: Vlad Arkhipov
>
> UndeclaredThrowableException is thrown if an image cannot be loaded for some reason.
> {code}
> Caused by: java.lang.reflect.UndeclaredThrowableException
>         at com.sun.proxy.$Proxy313.readUnsignedInt(Unknown Source)
>         at org.apache.xmlgraphics.image.loader.impl.PreloaderEPS.preloadImage(PreloaderEPS.java:65)
[xmlgraphics-commons-1.5.jar:1.5]
>         at org.apache.xmlgraphics.image.loader.ImageManager.preloadImage(ImageManager.java:175)
[xmlgraphics-commons-1.5.jar:1.5]
>         at org.apache.xmlgraphics.image.loader.cache.ImageCache.needImageInfo(ImageCache.java:128)
[xmlgraphics-commons-1.5.jar:1.5]
>         at org.apache.xmlgraphics.image.loader.ImageManager.getImageInfo(ImageManager.java:122)
[xmlgraphics-commons-1.5.jar:1.5]
>         at org.apache.fop.fo.flow.ExternalGraphic.bind(ExternalGraphic.java:81) [fop-1.1.jar:]
>         at org.apache.fop.fo.FObj.processNode(FObj.java:124) [fop-1.1.jar:]
>         at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:280)
[fop-1.1.jar:]
>         at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:175) [fop-1.1.jar:]
> ...
> Caused by: java.lang.reflect.InvocationTargetException
>         at sun.reflect.GeneratedMethodAccessor2609.invoke(Unknown Source) [:1.8.0_25]
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[rt.jar:1.8.0_25]
>         at java.lang.reflect.Method.invoke(Method.java:483) [rt.jar:1.8.0_25]
>         at org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext$ObservingImageInputStreamInvocationHandler.invoke(AbstractImageSessionContext.java:219)
[
> xmlgraphics-commons-1.5.jar:1.5]
>         ... 254 more
> Caused by: java.io.EOFException
>         at javax.imageio.stream.ImageInputStreamImpl.readInt(ImageInputStreamImpl.java:251)
[rt.jar:1.8.0_25]
>         at javax.imageio.stream.ImageInputStreamImpl.readUnsignedInt(ImageInputStreamImpl.java:266)
[rt.jar:1.8.0_25]
>         ... 258 more
> {code}
> The problem being that InvocationHandlers in the classes AbstractImageSessionContext
and ObservableStream do not handle InvocationTargetException properly, and the exception is
propagated up to the proxied interface where InvocationTargetException is not specified.
> I am not sure if you accept pull requests on Github, anyway here it is https://github.com/apache/xml-graphics-commons/pull/1



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message