Unable to read original image

0
I just made a deployment on production environment in mendix 3.3.2. When I upload a file in my application, it is uploaded successfully but when I upload any image, There is an error message says image type of 'imagename.extension' is not supported . and in the consol I find the following error message : FileDataStore::writeThumbnail: Unable to read original image 'Untitled.jpg' javax.imageio.IIOException: Can't create cache file! at javax.imageio.ImageIO.createImageInputStream(Unknown Source) at javax.imageio.ImageIO.read(Unknown Source) at r.a(SourceFile:172) at r.a(SourceFile:136) at a.a(SourceFile:353) at com.mendix.core.Core.storeImageDocumentContent(SourceFile:1453) at iJ.a(SourceFile:176) at iJ.a(SourceFile:109) at iJ.a(SourceFile:83) at iJ.processRequest(SourceFile:76) at iL.a(SourceFile:71) at com.mendix.core.MxRuntime.processRequest(SourceFile:857) at com.mendix.m2ee.server.handler.RuntimeHandler.handle(RuntimeHandler.java:43) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) at org.eclipse.jetty.server.Server.handle(Server.java:334) at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559) at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1007) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:747) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:209) at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) at java.lang.Thread.run(Unknown Source) Caused by: java.io.IOException: Access is denied at java.io.WinNTFileSystem.createFileExclusively(Native Method) at java.io.File.checkAndCreate(Unknown Source) at java.io.File.createTempFile(Unknown Source) at javax.imageio.stream.FileCacheImageInputStream.<init>(Unknown Source) at com.sun.imageio.spi.InputStreamImageInputStreamSpi.createInputStreamInstance(Unknown Source) at javax.imageio.ImageIO.createImageInputStream(Unknown Source) at javax.imageio.ImageIO.read(Unknown Source) at r.a(SourceFile:172) at r.a(SourceFile:136) at a.a(SourceFile:353) at com.mendix.core.Core.storeImageDocumentContent(SourceFile:1453) at iJ.a(SourceFile:176) at iJ.a(SourceFile:109) at iJ.a(SourceFile:83) at iJ.processRequest(SourceFile:76) at iL.a(SourceFile:71) at com.mendix.core.MxRuntime.processRequest(SourceFile:857) at com.mendix.m2ee.server.handler.RuntimeHandler.handle(RuntimeHandler.java:43) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) at org.eclipse.jetty.server.Server.handle(Server.java:334) at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:559) at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1007) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:747) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:209) at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:462) at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) at java.lang.Thread.run(Unknown Source)
asked
2 answers
1

Could it be that the image which you are uploading contains more data then the image alone? Some images contain for example color information which is used by for example photoshop. Try opening the image in an image editor and save as png

answered
1

There is some form of folder access rights issue here. It basically says it can't create a temporary cache file for the original image while trying to create a thumbnail. This is in your stacktrace:

Caused by: java.io.IOException: Access is denied
    at java.io.WinNTFileSystem.createFileExclusively(Native Method)
    at java.io.File.checkAndCreate(Unknown Source)
    at java.io.File.createTempFile(Unknown Source)
    at javax.imageio.stream.FileCacheImageInputStream.<init>(Unknown Source)

You can fix this by configuring folder access so that the application can create temporary files (probably in the tmp folder I'd say)

answered