Page 1 of 1

assets cannot display image after server restart

Posted: Wed Nov 27, 2013 12:35 pm
by Theo Schumacher
Hi,

I have installed the demo site (3.0.2GA) on a tomcat7 server and changed development.properties to keep data after restart. So that i can see my orders, wishlist etc ... after a reboot.

I have created a new product in admin, created an asset by uploading an image. When saving the asset, an error message is displayed 'url is required'. Looking to the assets, it has well been stored and can be used. I have thus linked the new asset to my new product and everything seams to be ok.

When I restart the server, my product and asset are still available but the asset image is not displayed. The stack trace shows the following error:

java.io.FileNotFoundException: /tmp/tomcat7-tomcat7-tmp/04/ab/5409v2.jpg (No such file or directory)

I thought that the images are stored in the DB or in a save place, not in a /tmp folder.

What do i need to change to keep my images ?

Re: assets cannot display image after server restart

Posted: Thu Nov 28, 2013 4:24 am
by Theo Schumacher
Hi,

some additional information. When the error on the 'save asset' button appears, the stack trace shows:

[artifact:mvn] [ERROR] 09:41:10 DynamicEntityRemoteService - Problem inspecting results for null
[artifact:mvn] java.lang.RuntimeException: java.lang.ClassNotFoundException: null
[artifact:mvn] at org.broadleafcommerce.openadmin.server.security.dao.AdminPermissionDaoImpl.isUserQualifiedForOperationOnCeilingEntity(AdminPermissionDaoImpl.java:106)
[artifact:mvn] at org.broadleafcommerce.openadmin.server.security.service.AdminSecurityServiceImpl.isUserQualifiedForOperationOnCeilingEntity(AdminSecurityServiceImpl.java:169)

and a some lines below:

[artifact:mvn] at org.broadleafcommerce.openadmin.server.security.dao.AdminPermissionDaoImpl.isUserQualifiedForOperationOnCeilingEntity(AdminPermissionDaoImpl.java:102)
[artifact:mvn] ... 131 more
[artifact:mvn] 2013-11-28 09:41:10.764:WARN:oejs.ServletHandler:/admin/null/5944.jpg
[artifact:mvn] org.broadleafcommerce.common.exception.ServiceException: Unable to fetch results for null

The error message that appears on the admin assets screen is:

URL: This field is required

Re: assets cannot display image after server restart

Posted: Sun Dec 01, 2013 12:54 am
by bpolster
To store images in the database instead of the file-system, use the following property ...

asset.use.filesystem.storage=true

The default for that is false and we recommending storing images on the file-system for most implementations.

That being said, it looks like the default for some versions of our Getting-Started site is to have the path set to a temporary directory.

First check the ""asset.server.file.system.path" property in your development-shared.properties file.

Likely, it is set to nothing. When this is the case, Broadleaf will write images to a temporary directory.

Modify this property to a directory where you want to store images. In a distributed environment, our recommended approach is to have this point to a shared network drive (e.g. NFS mount). Look for an upcoming release (next 30 days or so) where we'll introduce a FileProvider concept that will allow you to use additional approaches (such as Amazon S3) to store images in a distributed environment.