FileNotFoundException Loading Product Images
Posted: Fri May 22, 2015 1:50 am
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)
.
.
.
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)
.
.
.