Hi isomorphic,
I try to download a file, but I canīt get it.
I define a DS. The code is:
The DownloadDMI code is:
The value object is:
The JSP Code is:
The error that appear in the browser is:
The error that appear in the apache-tomcat console is:
I am not able to fix my problem.
I put the RPCManager as parameter of downloadFile method on the class DownloadDMI. I call rpcManager.doCustomResponse() in that method.
Please help me, to resolve this problem
I try to download a file, but I canīt get it.
I define a DS. The code is:
Code:
<DataSource ID="downloadDS" serverType="generic"> <fields> <field name="file" type="binary"/> </fields> <serverObject lookupStyle="new" className="dmi.DownloadDMI" /> </DataSource>
Code:
public class DownloadDMI { public DSResponse downloadFile(DSRequest dsRequest, RPCManager rpcManager) throws Exception { System.out.println("Entro al downloadFile de DownloadDMI"); DSResponse dsResponse = new DSResponse(); DownloadFile downloadItem= new DownloadFile(); InputStream stream = new FileInputStream( "Banner.png" ); downloadItem.setFile(stream); rpcManager.doCustomResponse(); dsResponse.setData(downloadItem); return dsResponse; }
Code:
package model; import java.io.InputStream; public class DownloadFile { private InputStream file; public InputStream getFile() { return file; } public void setFile(InputStream file) { this.file = file; } }
The JSP Code is:
Code:
<isomorphic:loadDS ID="downloadDS"/> function openHelpContent(){ var data = {}; data.param1 = "123"; data.param2 = "param2"; isc.DataSource.get("downloadDS").downloadFile({data:data}); } Button.create({ title: "Download File", position: "relative", width: 150, click: function () { openHelpContent(); } });
Code:
com.isomorphic.servlet.IDACall top-level exception java.lang.ClassCastException: java.lang.String at com.isomorphic.rpc.RPCManager.completeResponse(RPCManager.java:657) at com.isomorphic.rpc.RPCManager.send(RPCManager.java:494) at com.isomorphic.rpc.RPCManager.sendFailure(RPCManager.java:577) at com.isomorphic.rpc.RPCManager.sendFailure(RPCManager.java:598) at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:112) at com.isomorphic.servlet.IDACall.doPost(IDACall.java:54) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:248) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source)
Code:
=== 2010-06-21 22:57:14,250 [or25] INFO IDACall - Performing 1 operation(s) === 2010-06-21 22:57:14,265 [or25] WARN RequestContext - dsRequest.execute() failed: java.lang.Exception: attempt to call unknown operationType: downloadFile at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:154) at com.isomorphic.datasource.DataSourceDMI.execute(DataSourceDMI.java:62) at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1172) at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:155) at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:106) at com.isomorphic.servlet.IDACall.doPost(IDACall.java:54) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:248) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source) === 2010-06-21 22:57:14,281 [or25] ERROR IDACall - Error executing operation: downloadDS_downloadFile java.lang.ClassCastException: java.lang.String at com.isomorphic.rpc.RPCManager.completeResponse(RPCManager.java:657) at com.isomorphic.rpc.RPCManager.send(RPCManager.java:494) at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:106) at com.isomorphic.servlet.IDACall.doPost(IDACall.java:54) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:248) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source) === 2010-06-21 22:57:14,281 [or25] ERROR IDACall - Top-level servlet error: java.lang.ClassCastException: java.lang.String at com.isomorphic.rpc.RPCManager.completeResponse(RPCManager.java:657) at com.isomorphic.rpc.RPCManager.send(RPCManager.java:494) at com.isomorphic.rpc.RPCManager.sendFailure(RPCManager.java:577) at com.isomorphic.rpc.RPCManager.sendFailure(RPCManager.java:598) at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:112) at com.isomorphic.servlet.IDACall.doPost(IDACall.java:54) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:248) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source) === 2010-06-21 22:57:14,281 [or25] INFO Compression - /transporte/isomorphic/IDACall: 2234 -> 645 bytes
I am not able to fix my problem.
I put the RPCManager as parameter of downloadFile method on the class DownloadDMI. I call rpcManager.doCustomResponse() in that method.
Please help me, to resolve this problem
Comment