gpt4 book ai didi

java - 在Tomcat 7中无法进行图像渲染

转载 作者:行者123 更新时间:2023-11-28 23:31:50 25 4
gpt4 key购买 nike

使用上载图片后,我正在尝试显示图片。用户上载图片后,我正尝试使用以下代码显示图片。
<a4j:mediaOutput element="img" createContent="#{bean.paint}" value="1"
style="width:275px; height:75px;" mimeType="image/jpg" id="media" cacheable="false">
<f:param value="#{bean.timeStamp}" name="time" />
</a4j:mediaOutput>
我的Java代码是
     public Part part;
//getters & Setters
public void paint(OutputStream stream, Object data) throws IOException{
InputStream inputStream = null;
try {
inputStream = part.getInputStream();
stream.write(IOUtils.toByteArray(inputStream));
stream.close();
} catch (Exception e){

}
}

 我的部分包含文件。但是我收到了吼叫的例外。
严重:反序列化数据的输入错误
java.io.InvalidClassException:未经授权的反序列化尝试; org.apache.el.lang.VariableMapperImpl
    在org.richfaces.util.LookAheadObjectInputStream.resolveClass(LookAheadObjectInputStream.java:97)
    在java.io.ObjectInputStream.readNonProxyDesc(未知来源)
    在java.io.ObjectInputStream.readClassDesc(未知来源)
    在java.io.ObjectInputStream.readOrdinaryObject(未知来源)
    在java.io.ObjectInputStream.readObject0(未知来源)
    在java.io.ObjectInputStream.readObject(未知来源)
    在org.apache.el.MethodExpressionImpl.readExternal(MethodExpressionImpl.java:297)
    在java.io.ObjectInputStream.readExternalData(未知来源)
    在java.io.ObjectInputStream.readOrdinaryObject(未知来源)
    在java.io.ObjectInputStream.readObject0(未知来源)
    在java.io.ObjectInputStream.defaultReadFields(未知来源)
    在java.io.ObjectInputStream.readSerialData(未知来源)
    在java.io.ObjectInputStream.readOrdinaryObject(未知来源)
    在java.io.ObjectInputStream.readObject0(未知来源)
    在java.io.ObjectInputStream.readObject(未知来源)
    在com.sun.faces.facelets.el.TagMethodExpression.readExternal(TagMethodExpression.java:158)
    在java.io.ObjectInputStream.readExternalData(未知来源)
    在java.io.ObjectInputStream.readOrdinaryObject(未知来源)
    在java.io.ObjectInputStream.readObject0(未知来源)
    在java.io.ObjectInputStream.defaultReadFields(未知来源)
    在java.io.ObjectInputStream.readSerialData(未知来源)
    在java.io.ObjectInputStream.readOrdinaryObject(未知来源)
    在java.io.ObjectInputStream.readObject0(未知来源)
    在java.io.ObjectInputStream.readArray(未知来源)
    在java.io.ObjectInputStream.readObject0(未知来源)
    在java.io.ObjectInputStream.readObject(未知来源)
    在org.richfaces.util.Util.decodeObjectData(Util.java:237)
    在org.richfaces.resource.DefaultCodecResourceRequestData.getData(DefaultCodecResourceRequestData.java:97)
    在org.richfaces.resource.ResourceFactoryImpl.createResource(ResourceFactoryImpl.java:337)
    在org.richfaces.resource.ResourceHandlerImpl.handleResourceRequest(ResourceHandlerImpl.java:156)
    在javax.faces.webapp.FacesServlet.service(FacesServlet.java:643)
    在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
    在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    在com.wellsfargo.ecar.common.util.ServerFilter.doFilter(ServerFilter.java:46)
    在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    在org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    在org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    在org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
    在org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
    在org.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process(AbstractProtocol.java:515)
    在org.apache.tomcat.util.net.JIoEndpoint $ SocketProcessor.run(JIoEndpoint.java:304)
    在java.util.concurrent.ThreadPoolExecutor $ Worker.runTask(未知来源)
    在java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知来源)
    在java.lang.Thread.run(未知来源)
2015年4月6日下午4:06:13 org.apache.catalina.core.StandardWrapperValve调用
严重:带有路径的上下文中的Servlet [Faces Servlet]的Servlet.service()

有什么我想念的吗?请帮帮我。

最佳答案

您可以升级到解决此问题的最新版本。或者,打开您的RichFaces jar / zip文件并找到resource-serialization.properties,然后将“ org.apache.el.lang.VariableMapperImpl”添加到白名单。

关于java - <a4j:mediaOutput/>在Tomcat 7中无法进行图像渲染,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29469897/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com