Liferay &引用;字节“周围的输入格式不正确”;上载图像时

Liferay &引用;字节“周围的输入格式不正确”;上载图像时,liferay,Liferay,当我上传图像和发布页面时,会显示一条消息web内容暂时不可用 这是日志中的错误: 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)

当我上传图像和发布页面时,会显示一条消息web内容暂时不可用

这是日志中的错误:

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}

如何成功上传图像?

尝试了解导致问题的图像类型。 在Linux/Mac系统上尝试使用(通过shell/temrinal)


一个常见问题是您使用的是CMYK而不是RGB颜色空间(尝试使用Photoshop之类的软件打开图像并验证/转换图像)。

您上载了什么类型的图像?您使用的是哪个版本的Liferay?他在抱怨图像的格式,所以你应该先尝试不同的图像。此外,你的主题中的图像有很多404错误,这让我怀疑你的主题是否有更深层次的问题。请提供更多关于配置、主题和构建方式的信息。还有:什么时候会发生这种异常?先生,每当我使用png文件时,它就不工作了,并且给出了这个错误,但是当我上传jpg图像时,它工作正常,。。。你能告诉我这背后的原因吗?先生,每当我使用png文件,它就不工作,并给出这个错误,但当我上传jpg图像,然后它的工作很好,。。。你能告诉我这背后的原因吗?正如我所写的,我认为你应该检查一下你的形象。。。例如,您是否验证了png的颜色空间?如果你不习惯这样做,试着使用这个PNG文件:(我刚刚验证了它的颜色空间,它是RGB而不是CMYK)。让我知道。。。
# file filepath/filename