[opencms-dev] Problem during Setting of image.size for uploaded images?

Eska sven.kiesow at interone.de
Thu Mar 17 18:15:24 CET 2011


Found the solution myself:

the $CATALINA_BASE/temp folder must be writeable for the tomcat-user.
In my case the owner of that directory was root. After changing the owner
to the tomcat-user the image.size property was created again.

Eska


Eska wrote:
> 
> Hi Mario,
> 
> seems it is a permission problem.
> Where does OpenCms try to create extract the images to?
> 
> In the Linux system all files/folders have the tomcat user as owner.
> 
> Eska
> 
> 17 Mar 2011 17:54:11,191 DEBUG [.opencms.loader.CmsImageScaler: 183]
> Unable to extract the image size for resource "/sites/ABC/DEF.jpg".
> javax.imageio.IIOException: Can't create cache file!
>         at javax.imageio.ImageIO.createImageInputStream(ImageIO.java:335)
>         at javax.imageio.ImageIO.read(ImageIO.java:1325)
>         at com.alkacon.simapi.Simapi.read(Simapi.java:281)
>         at com.alkacon.simapi.Simapi.read(Simapi.java:253)
>         at
> org.opencms.loader.CmsImageScaler.<init>(CmsImageScaler.java:177)
>         at
> org.opencms.file.types.CmsResourceTypeImage$CmsImageAdjuster.adjust(CmsResourceTypeImage.java:112)
>         at
> org.opencms.file.types.CmsResourceTypeImage.createResource(CmsResourceTypeImage.java:296)
>         at org.opencms.file.CmsObject.createResource(CmsObject.java:733)
>         at
> org.opencms.workplace.explorer.CmsNewResourceUpload.actionUpload(CmsNewResourceUpload.java:482)
>         at
> org.apache.jsp.WEB_002dINF.jsp.offline.system.workplace.commons.newresource_005fupload_jsp._jspService(newresource_005fupload_jsp.java:135)
>         at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>         at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
>         at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
>         at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
>         at
> org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
>         at
> org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
>         at
> org.opencms.flex.CmsFlexRequestDispatcher.includeExternal(CmsFlexRequestDispatcher.java:194)
>         at
> org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:169)
>         at org.opencms.loader.CmsJspLoader.service(CmsJspLoader.java:1193)
>         at
> org.opencms.flex.CmsFlexRequestDispatcher.includeInternalWithCache(CmsFlexRequestDispatcher.java:423)
>         at
> org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:173)
>         at
> org.opencms.loader.CmsJspLoader.dispatchJsp(CmsJspLoader.java:1227)
>         at org.opencms.loader.CmsJspLoader.load(CmsJspLoader.java:1171)
>         at
> org.opencms.loader.CmsResourceManager.loadResource(CmsResourceManager.java:964)
>         at
> org.opencms.main.OpenCmsCore.showResource(OpenCmsCore.java:1498)
>         at org.opencms.main.OpenCmsServlet.doGet(OpenCmsServlet.java:152)
>         at org.opencms.main.OpenCmsServlet.doPost(OpenCmsServlet.java:164)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
>         at
> org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
>         at
> org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
>         at
> org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776)
>         at
> org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705)
>         at
> org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898)
>         at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
>         at java.lang.Thread.run(Thread.java:662)
> Caused by: java.io.IOException: Permission denied
>         at java.io.UnixFileSystem.createFileExclusively(Native Method)
>         at java.io.File.checkAndCreate(File.java:1704)
>         at java.io.File.createTempFile(File.java:1792)
>         at
> javax.imageio.stream.FileCacheImageInputStream.<init>(FileCacheImageInputStream.java:84)
>         at
> com.sun.imageio.spi.InputStreamImageInputStreamSpi.createInputStreamInstance(InputStreamImageInputStreamSpi.java:51)
>         at javax.imageio.ImageIO.createImageInputStream(ImageIO.java:331)
>         ... 48 more
> 
> 
> 
> Mario Jäger wrote:
>> 
>> Hi Eska,
>> 
>> Does that happen with all images you upload into OpenCms? The OpenCms 
>> CmsImageScaler reads the height and the width of the uploaded image. 
>> This is done with Java Core functionalities. In your case the image size 
>> is not recognized. Can be, that the image is corrupt and that does not 
>> bother the image programs you use.
>> 
>> Which Java version (incl. update version) do you use? To get more 
>> information about the issue, add the following line in the file 
>> WEB-INF/classes/log4j.properties in the section "Set levels for all 
>> default channels available in OpenCms", please:
>> 
>> log4j.logger.org.opencms.loader.CmsImageScaler=DEBUG
>> 
>> Restart the servlet container after that, please.
>> 
>> Upload an image into OpenCms then again and send us the OpenCms log file 
>> WEB-INF/logs/opencms.log, please.
>> 
>> Kind Regards,
>> Mario.
>> 
>> Am 17.03.2011 11:42, schrieb Eska:
>>>
>>> Hi List,
>>>
>>> I have a somewhat older and upgraded OpenCms 7.0.5 where today I happen
>>> to
>>> notice,
>>> that after uploading a JPG Image the property "image.size" is not set.
>>>
>>> I know, that this worked in the past, so here is my question:
>>>
>>> Is there a configuration to allow/disable the setting of the image.size
>>> property in OpenCms?
>>> Or how might it be possible that the image.size property is not set when
>>> uploading an image?
>>>
>>> Thanks
>>>
>>> Eska
>>>
>> 
>> 
>> -- 
>> -------------------
>> Mario Jäger
>> 
>> Visit OpenCms Days 2011 Conference and Expo
>> May 9 to May 10 2011 in Cologne, Germany
>> http://www.opencms-days.org
>> 
>> Alkacon Software GmbH  - The OpenCms Experts
>> http://www.alkacon.com - http://www.opencms.org
>> 
>> _______________________________________________
>> This mail is sent to you from the opencms-dev mailing list
>> To change your list options, or to unsubscribe from the list, please
>> visit
>> http://lists.opencms.org/mailman/listinfo/opencms-dev
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Problem-during-Setting-of-image.size-for-uploaded-images--tp31171469p31174643.html
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.




More information about the opencms-dev mailing list