PowerMockRunner throws UnsatisfiedLinkError with ImageIO.write() #161

Open
johanhaleby opened this Issue Jul 23, 2015 · 5 comments

Comments

Projects
None yet
1 participant
Collaborator

johanhaleby commented Jul 23, 2015

From james.de...@gmail.com on August 24, 2009 23:48:28

What steps will reproduce the problem? 1) Create a JUnit4.4 unit test using 1.2.5 and EasyMock 2.4
2) Create a new File object, and simply make a JPEG image like this:

BufferedImage testImage = new BufferedImage(width, height,
BufferedImage.TYPE_3BYTE_BGR);
ImageIO.write(testImage, "jpeg", startFile); What is the expected output? What do you see instead? It's expected that the ImageIO will create a new JPG image. What happens,
is an exception is thrown:

Caused by: java.lang.UnsatisfiedLinkError:
com.sun.imageio.plugins.jpeg.JPEGImageWriter.initWriterIDs(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;)V
at com.sun.imageio.plugins.jpeg.JPEGImageWriter.initWriterIDs(Native Method)
at
com.sun.imageio.plugins.jpeg.JPEGImageWriter.(JPEGImageWriter.java:163)
at
com.sun.imageio.plugins.jpeg.JPEGImageWriterSpi.createWriterInstance(JPEGImageWriterSpi.java:96)
at
javax.imageio.spi.ImageWriterSpi.createWriterInstance(ImageWriterSpi.java:327)
at javax.imageio.ImageIO$ImageWriterIterator.next(ImageIO.java:817)
at javax.imageio.ImageIO$ImageWriterIterator.next(ImageIO.java:801)
at javax.imageio.ImageIO.write(ImageIO.java:1471)
at javax.imageio.ImageIO.write(ImageIO.java:1521)
at redfin.util.ImageUtilTest.createTempJpeg(ImageUtilTest.java:17)
at
com.redfin.uploader.photoServiceWS.PhotoServiceImplTest$DataHandlerMyMock.(PhotoServiceImplTest.java:260)
at
com.redfin.uploader.photoServiceWS.PhotoServiceImplTest.testUploadFailTwo(PhotoServiceImplTest.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
at
org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$2.runTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:222)
... 19 more What version of the product are you using? On what operating system? Create a JUnit4.4 unit test using 1.2.5 and EasyMock 2.4 with Java 6 and on
Windows XP

Original issue: http://code.google.com/p/powermock/issues/detail?id=141

Collaborator

johanhaleby commented Jul 23, 2015

From johan.ha...@gmail.com on August 24, 2009 23:41:38

Thanks for reporting this. How does your test look like? What have you prepared for test?

Collaborator

johanhaleby commented Jul 23, 2015

From ask.mi...@gmail.com on August 15, 2012 09:31:05

I get the same exact thing. Trying to generate a receipt image that includes text and a barcode image, but get the UnsatisfiedLinkError for the JPEG writer.

Collaborator

johanhaleby commented Jul 23, 2015

From ishai...@gmail.com on March 13, 2013 14:16:31

The API that triggers an issue is only supported on 32 bit JRE on Windows as explained here: http://stackoverflow.com/questions/5207145/jai-and-imageio-for-64-bit-windows . If you are running 64 bit windows JDK/JRE - you'll have to switch to 32 bit.

Collaborator

johanhaleby commented Jul 23, 2015

From james.de...@gmail.com on March 13, 2013 14:17:22

Uh that seems like a bad "solution" don't you think?

Collaborator

johanhaleby commented Jul 23, 2015

From alg...@gmail.com on March 13, 2013 14:52:47

That doesn't really seem like a solution at all :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment