Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Odd Exception retrieving image through java api
quietsky1
I am encountering an odd behavior when attempting to retrieve an image from MediaBin through the java api. I get an ArrayIndexOutOfBoundsException that manifests itself under seemingly random circumstances.For example, I have a junit test class that tests the retrieval of tiff images. This test class runs without errors when run by itself. Nevertheless, when running it as part of a larger set of tests, 4 out of 7 retrievals fail, producing the stack-trace listed below.Furthermore, by merely changing the name of the destination file it is possible to trigger the error.i.e. output to: gold_bracelet-LgRGB.tif ---- succeedsoutput to: gold_bracelet-RGB_lg.tif --- failsI have a try-catch clause around the offending MediaBin call (Image.retrieveFile), and I have a high degree of confidence that this behavior cannot be accounted by something in our code.Has anyone experienced this behavior ?I am running against MediaBin 3.0 (on Windows box) from an OSX (panther) machine running jdk 1.4.2 Any help would be greatly appreciated !the stack trace:java.lang.ArrayIndexOutOfBoundsException at java.lang.System.arraycopy(Native Method) at com.MediaBin.BER.BERBuffer.writeBytes(BERBuffer.java:285) at com.MediaBin.BER.BERMsg.encodeOctetString(BERMsg.java:896) at com.MediaBin.Proxy.MBPGUID.encode(MBPGUID.java:198) at com.MediaBin.Proxy.MBPGUID.encode(MBPGUID.java:181) at com.MediaBin.Proxy.PrimitiveImpl.encode(PrimitiveImpl.java:397) at com.MediaBin.Transaction.GetImageFileRequest.encode(GetImageFileRequest.java:195) at com.MediaBin.Transaction.GetImageFileRequest.DO(GetImageFileRequest.java:54) at com.MediaBin.Proxy.AssetImpl.retrieveFile(AssetImpl.java:1032)...
Find more posts tagged with
Comments
pflory
I don't have experience in the specfic problem space you've defined, but wondering if there is
any pattern to the exceptions? Only TIF files? Which 4 out of 7 files fails? What sizes?
Patterns or simply chaos? This answer might help lead to the curse.
Paul
Paul Flory
quietsky1
chaos, I am afraid.
I am outputting the same tif file: 'gold bracelet.tif' , but in different sizes, colorspace, and format, to test the 'transformation' abilities of MediaBin.
The file is 952x295 pixels, RGB, stored at 300 ppi
I output to the target path:
/Users/philippe/projects/imageworks/resources.test/test_cache
For the output, I use the base name of the image (gold bracelet) and append suffixes that describe the file. The same transformation will fail depending on this suffix
For example:
I output a 2 inch wide image at 100 ppi (or 200px wide) to:
'gold bracelet-SmRGB.tif'
succeeds
'gold bracelet-RG_B.tif'
succeeds
'gold bracelet-RGB_sm.tif'
fails
I thought initially that the problem was with some pattern in the file name. I stuck with 'gold bracelet-SmRGB.tif' (not my first choice) and similar and all my tests ran when I ran just that one suite of tests.
I then ran this suite of tests along with all of my other tests (grand finale), and some of the tests that were previously working started failing. Nothing changed other than the fact that there were tests preceding this suite, but the context was the same, and all the tests are independent.
After I posted this message, I changed the output directory from:
/Users/philippe/projects/imageworks/resources.test/test_cache
to:
/Users/philippe/projects/imageworks/test
and all the errors disappeared.
Here again there is not pattern, it does not matter how long the directory name is, or whether there are periods or underscores. Some paths work, others do not.
I am starting to wonder whether this has something to do with the JVM in OSX rather than the MediaBin interface. Having gotten as far as trying to reproduce this in Windos.