2015-09-25 37 views
0

當我上傳圖片併發布頁面時,會顯示一條消息網頁內容暫時不可用上傳圖片時出現「格式錯誤的字節輸入」

這是日誌中的錯誤:

21:28:57,687 ERROR [http-bio-2020-exec-6][render_portlet_jsp:132] null 
java.io.UTFDataFormatException: malformed input around byte 714 
    at com.liferay.portal.image.ImageToolImpl.read(ImageToolImpl.java:446) 
    at com.liferay.portal.image.ImageToolImpl.getImage(ImageToolImpl.java:368) 
    at com.liferay.portal.kernel.image.ImageToolUtil.getImage(ImageToolUtil.java:144) 
    at com.liferay.portal.service.impl.ImageLocalServiceImpl.updateImage(ImageLocalServiceImpl.java:144) 
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:115) 
    at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:62) 
    at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:51) 
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111) 
    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56) 
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111) 
    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56) 
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111) 
    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56) 
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111) 
    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56) 
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111) 
    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56) 
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111) 
    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56) 
    at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:111) 
21:30:20,989 WARN [http-bio-2020-exec-3][code_jsp:?] {code="404", msg="/ONA-theme/images/common/edit_white.png", uri=/ONA-theme/images/common/edit_white.png} 
21:30:20,990 WARN [http-bio-2020-exec-10][code_jsp:?] {code="404", msg="/ONA-theme/images/common/edit_template_white.png", uri=/ONA-theme/images/common/edit_template_white.png} 
21:30:20,997 WARN [http-bio-2020-exec-3][code_jsp:?] {code="404", msg="/ONA-theme/images/common/add_white.png", uri=/ONA-theme/images/common/add_white.png} 
21:30:20,998 WARN [http-bio-2020-exec-10][code_jsp:?] {code="404", msg="/ONA-theme/images/common/configuration_white.png", uri=/ONA-theme/images/common/configuration_white.png} 

我怎樣才能成功上傳圖片?

+0

你上傳了什麼樣的圖片?你正在使用哪個版本的Liferay?他抱怨圖像的格式,所以你應該先嚐試一個不同的圖像。 –

+0

另外,在你的主題中有很多圖片的404錯誤,這讓我想知道你的主題沒有更深的問題。請提供一些關於您的配置,主題和構建方式的更多信息。另外:什麼時候發生這種異常? –

+0

先生,每當我使用PNG文件,然後它不工作,並給這個錯誤,但是當我上傳JPG圖像,然後它的工作正常,...你能告訴我背後的原因。 – 007

回答

0

試着瞭解圖像的類型是否導致問題。 在Linux/Mac的系統嘗試使用(由殼/ temrinal)

# file filepath/filename 

一個常見的問題是,你正在使用CMYK而不是RGB色彩空間(嘗試使用Photoshop等軟件打開圖像,並驗證/轉換你的形象)。

+0

先生,每當我使用PNG文件,然後它不工作,並給這個錯誤,但是當我上傳JPG圖像,那麼它的工作很好,... 你能告訴我背後的原因。 – 007

+0

正如我寫的,我認爲你應該檢查你的圖像類型...例如,你確認你的PNG的顏色空間?如果你不習慣以這種方式繼續嘗試使用這個PNG文件:http://www.personal.psu.edu/sdh5174/Mario_png.png(我剛剛驗證了它的顏色空間,它是RGB而不是CMYK)。讓我知道... –