java.io.NotSerializableException when using response type "url"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

java.io.NotSerializableException when using response type "url"

Michael Imhof
I defined the following request:

    <request-map uri="processUpload">
        <security https="true" auth="true"/>
        <event type="java" path="ch.nowhow.isgate.file.FileEvents" invoke="processLocaleFile"/>
        <response name="success" type="url" value="/archiv/control/listArchiv"/>
        <response name="error" type="view" value="upload"/>
    </request-map>

It's working fine but in the log file I get the exception at the bottom.
Does somebody has a clue why this exception is thrown????

---- exception report ----------------------------------------------------------
Exception: java.io.NotSerializableException
Message: org.apache.catalina.core.ApplicationContextFacade
---- stack trace ---------------------------------------------------------------
java.io.NotSerializableException: org.apache.catalina.core.ApplicationContextFacade
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
javolution.util.FastMap.writeObject(Unknown Source)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
org.ofbiz.base.util.UtilObject.getBytes(UtilObject.java:73)
org.ofbiz.webapp.control.RequestHandler.callRedirect(RequestHandler.java:518)
org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:375)
org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:188)
org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:76)
javax.servlet.http.HttpServlet.service(HttpServlet.java:615)
javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:248)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:595)
Reply | Threaded
Open this post in threaded view
|

Re: java.io.NotSerializableException when using response type "url"

G.Venkata Phanindra
Hi,

I donnot see any problem with the request-map u have listed below plese do
check if there is any issue with the class u r using.

Is the log file added below is complete ...


On 4/25/07, Michael Imhof <[hidden email]> wrote:

>
>
> I defined the following request:
>
>     <request-map uri="processUpload">
>         <security https="true" auth="true"/>
>         <event type="java" path="ch.nowhow.isgate.file.FileEvents"
> invoke="processLocaleFile"/>
>         <response name="success" type="url"
> value="/archiv/control/listArchiv"/>
>         <response name="error" type="view" value="upload"/>
>     </request-map>
>
> It's working fine but in the log file I get the exception at the bottom.
> Does somebody has a clue why this exception is thrown????
>
> ---- exception report
> ----------------------------------------------------------
> Exception: java.io.NotSerializableException
> Message: org.apache.catalina.core.ApplicationContextFacade
> ---- stack trace
> ---------------------------------------------------------------
> java.io.NotSerializableException:
> org.apache.catalina.core.ApplicationContextFacade
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java
> :1369)
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java
> :1284)
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
> javolution.util.FastMap.writeObject(Unknown Source)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
> :39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:585)
> java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java
> :1284)
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
> org.ofbiz.base.util.UtilObject.getBytes(UtilObject.java:73)
> org.ofbiz.webapp.control.RequestHandler.callRedirect(RequestHandler.java
> :518)
> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:375)
> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:188)
> org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:76)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:615)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:252)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:173)
> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:248)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:202)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:173)
> org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:213)
> org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:178)
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
> :126)
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
> :105)
> org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:107)
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
> :148)
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
> (Http11BaseProtocol.java:664)
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
> PoolTcpEndpoint.java:527)
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
> LeaderFollowerWorkerThread.java:80)
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:684)
> java.lang.Thread.run(Thread.java:595)
> --
> View this message in context:
> http://www.nabble.com/java.io.NotSerializableException-when-using-response-type-%22url%22-tf3644637.html#a10178489
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>


--
G.Venkata Phanindra
Mob:: 9849852989
Reply | Threaded
Open this post in threaded view
|

Re: java.io.NotSerializableException when using response type "url"

Michael Imhof
Hi,

I found the problem. Because in my web request I'm downloading data from the server, I cannot
send a new request in the response (because I already did the download request).

The failed controller request map:

    <request-map uri="createAuftragImage">
        <security https="true" auth="true"/>
        <event type="java" path="ch.nowhow.MyEvents" invoke="downloadImage"/>
        <response name="success" type="<b>request-redirect" value="listEntries"/>
        <response name="error" type="view" value="listEntries"/>
    </request-map>

Inside the method downloadImage, I'm using
UtilHttp.streamContentToBrowser
to download the data.

The solution is to change the response type:

    <request-map uri="createAuftragImage">
        <security https="true" auth="true"/>
        <event type="java" path="ch.nowhow.MyEvents" invoke="downloadImage"/>
        <response name="success" type="<b>none" value=""/>
        <response name="error" type="view" value="listEntries"/>
    </request-map>

Michael

G.Venkata Phanindra wrote
Hi,

I donnot see any problem with the request-map u have listed below plese do
check if there is any issue with the class u r using.

Is the log file added below is complete ...


On 4/25/07, Michael Imhof <michael.imhof@nowhow.ch> wrote:
>
>
> I defined the following request:
>
>     <request-map uri="processUpload">
>         <security https="true" auth="true"/>
>         <event type="java" path="ch.nowhow.isgate.file.FileEvents"
> invoke="processLocaleFile"/>
>         <response name="success" type="url"
> value="/archiv/control/listArchiv"/>
>         <response name="error" type="view" value="upload"/>
>     </request-map>
>
> It's working fine but in the log file I get the exception at the bottom.
> Does somebody has a clue why this exception is thrown????
>
> ---- exception report
> ----------------------------------------------------------
> Exception: java.io.NotSerializableException
> Message: org.apache.catalina.core.ApplicationContextFacade
> ---- stack trace
> ---------------------------------------------------------------
> java.io.NotSerializableException:
> org.apache.catalina.core.ApplicationContextFacade
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java
> :1369)
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java
> :1284)
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
> javolution.util.FastMap.writeObject(Unknown Source)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java
> :39)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
> java.lang.reflect.Method.invoke(Method.java:585)
> java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java
> :1284)
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
> org.ofbiz.base.util.UtilObject.getBytes(UtilObject.java:73)
> org.ofbiz.webapp.control.RequestHandler.callRedirect(RequestHandler.java
> :518)
> org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:375)
> org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:188)
> org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:76)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:615)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:252)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:173)
> org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:248)
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:202)
> org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:173)
> org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:213)
> org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:178)
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
> :126)
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
> :105)
> org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:107)
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541)
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
> :148)
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
> (Http11BaseProtocol.java:664)
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
> PoolTcpEndpoint.java:527)
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
> LeaderFollowerWorkerThread.java:80)
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:684)
> java.lang.Thread.run(Thread.java:595)
> --
> View this message in context:
> http://www.nabble.com/java.io.NotSerializableException-when-using-response-type-%22url%22-tf3644637.html#a10178489
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>
>


--
G.Venkata Phanindra
Mob:: 9849852989