Page 1 of 1

image not found Exception after ran jar file

PostPosted: Fri Jun 05, 2015 4:59 pm
by usharanicnp
hi to all,
i am developing a software which is generating some word documents..
i am able read text, images, math formulas from the word documents successfully in eclipse environment. (i have installed imagemagick and renamed imconvert)but when i created jar file an ran that jar file i got exception like given below

org.docx4j.openpackaging.exceptions.Docx4JException: Error checking image format

at org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractIma
ge.ensureFormatIsSupported(BinaryPartAbstractImage.java:598)
at org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractIma
ge.ensureFormatIsSupported(BinaryPartAbstractImage.java:500)
at org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractIma
ge.createImagePart(BinaryPartAbstractImage.java:264)
at org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractIma
ge.createImagePart(BinaryPartAbstractImage.java:172)
at cnp.TestForLineBr.retrieveParticularCell(TestForLineBr.java:148)
at cnp.TestForLineBr.main(TestForLineBr.java:191)
Caused by: java.io.FileNotFoundException: Image not found: file://C:/Users/USHAR
A~1.COD/AppData/Local/Temp/img1187846489083172396.img
at org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.
needSource(AbstractImageSessionContext.java:282)
at org.apache.xmlgraphics.image.loader.cache.ImageCache.needImageInfo(Im
ageCache.java:123)
at org.apache.xmlgraphics.image.loader.ImageManager.getImageInfo(ImageMa
nager.java:122)
at org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractIma
ge.getImageInfo(BinaryPartAbstractImage.java:865)
at org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractIma
ge.ensureFormatIsSupported(BinaryPartAbstractImage.java:590)

what is the problem ???? :?:
pls help me out of this problem, thanks in advance !
sorry about my English!!

Re: image not found Exception after ran jar file

PostPosted: Mon Jun 08, 2015 11:47 am
by jason
The problem is

java.io.FileNotFoundException: Image not found: file://C:/Users/USHAR
A~1.COD/AppData/Local/Temp/img1187846489083172396.img

Re: image not found Exception after ran jar file

PostPosted: Mon Jun 08, 2015 3:55 pm
by usharanicnp
thanks for u r reply

how can i rectify the issue pls help me
thanks in advance................ :oops:

Re: image not found Exception after ran jar file

PostPosted: Wed Jun 10, 2015 2:37 pm
by usharanicnp
sorry, for my duplicate post!
how can i resolve the issue

any native support is required to resolve the issue ??

pls help me any one
thanks in advance.

Re: image not found Exception after ran jar file

PostPosted: Wed Jun 10, 2015 7:56 pm
by jason
It looks like org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext.needSource(AbstractImageSessionContext.java:282)
is trying to get the image from the path file://C:/Users/USHARA~1.COD/AppData/Lo ... 172396.img

See http://grepcode.com/file/repo1.maven.or ... .String%29

You'll need to debug that.

Start by verifying the file is actually there in your Temp dir (ie was it written?)

If it is, you may need to worry about the truncation (~) in the path done to comply with 8.3 naming rules?

If that's the problem, then maybe docx4j needs to use getCanonicalPath instead of getAbsolutePath; see http://stackoverflow.com/a/21605726/1031689

Can you compile docx4j from its sources to try that?

Re: image not found Exception after ran jar file

PostPosted: Fri Jun 12, 2015 2:58 pm
by usharanicnp
thank you for your reply,

i found temp image file in my local temp directory.

i realized that the problem is URL of an image.

to debug the issue can i create my own BinaryPartAbstractImage.java ??

give me any idea to debug the issue or it needed any commercial support ? pls let me know...

i need to debug my jar file i don't have another choice pls help me.
in eclipse environment, it is working well but when running the runnable jar i am getting the issue. why it is happening like that...



thanks in advance.

Re: image not found Exception after ran jar file

PostPosted: Fri Jun 12, 2015 9:58 pm
by usharanicnp
i have attached my code.

please find the attachment.
thanks in advance....

Re: image not found Exception after ran jar file

PostPosted: Mon Jun 15, 2015 5:27 pm
by usharanicnp
pls help me

any one got problem like this, pls share your process to debug the issue

help me any one...!!!