Page 1 of 1

FileNotFoundException Loading Product Images

Posted: Fri May 22, 2015 1:50 am
by lldaj
I am testing BroadleafCommerce features on AWS and am impressed so far.

I am running into a problem retrieving static assets from S3.. Product images are not being displayed. Otherwise, the site runs fine inside an ElasticBeanstalk image. I followed the tutorial for using S3 for static assets. I see newly created assets so I'm fairly certain that the S3 interface is working.

Rather than reupload all the product image data via the admin site, I deployed the static data from a non-AWS environment onto S3. This could be a potential problem, but I'm seeing an odd exception in the log files. After retrieving the file from S3 and cacheing the file (supposedly), the file doesn't exist. The path raises suspicion, though - this/path/should/not/exist/... I haven't been able to track down the cause. Does anyone have any insight?

[ERROR] 00:04:38 StaticAssetViewController - Unable to retrieve static asset
java.io.FileNotFoundException: this/path/should/not/exist/fd33eed7-29ac-4185-bba9-fc434024e546 (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at org.broadleafcommerce.cms.file.service.StaticAssetStorageServiceImpl.lookupAssetAndCreateLocalFile(StaticAssetStorageServiceImpl.java:118)
at org.broadleafcommerce.cms.file.service.StaticAssetStorageServiceImpl.getCacheFileModel(StaticAssetStorageServiceImpl.java:217)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy146.getCacheFileModel(Unknown Source)
at org.broadleafcommerce.cms.web.file.StaticAssetViewController.handleRequestInternal(StaticAssetViewController.java:136)
.
.
.

Re: FileNotFoundException Loading Product Images

Posted: Tue May 26, 2015 11:47 pm
by phillipuniverse
What versions of things are you on?

Re: FileNotFoundException Loading Product Images

Posted: Wed May 27, 2015 11:58 am
by lldaj
I'm on version 3.1.8.

The problem showed up in my local dev environment as well. Not sure how it got there - it worked before I started S3 testing.
Those static assets were the ones I used for S3 testing. Maybe I messed something up using AWS copy commands.

I corrected the problem both locally and on AWS after the original post by wiping and reloading the static assets.

The path in the exception is odd and looks like one I would use for a something I never expected to happen. I couldn't track it to anything in the broadleaf baseline on github though. Maybe this is something to write off as an anomaly for now, but record in case it ever pops up again.

Thanks for looking at it.