J
j0hn_P
Hello,
I have a test Servlet class that instantiates an auction package I
created. The auctions are stored as a serialized file. The Servlet is
stored in '$root\servlets\WEB-INF\classes' and the auction package is
stored in '$root\servlets\WEB-INF\classes\auction'. The servlet cannot
deserialize the auctions from file. Please can anyone help. Much
appreciated.
Using jdk1.3.1_02
and jakarta-tomcat-4.1.24
Here is the stack trace:
[INFO] Registry - -Loading registry information
[INFO] Registry - -Creating new Registry instance
[INFO] Registry - -Creating MBeanServer
[INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1.24
[INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080
[INFO] ChannelSocket - -JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009
[INFO] JkMain - -Jk running ID=0 time=10/160
config=C:\jakarta-tomcat-4.1.24\conf\jk2.properties
Class cast exception: File could not be deserialized
Unable to load auctions from file! AuctionManager:loadAuctions()
java.lang.ClassNotFoundException: Auction
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1443)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1289)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:195)
at
java.ibjectInputStream.resolveClass(ObjectInputStream.java:654)
at
java.ibjectInputStream.inputClassDescriptor(ObjectInputStream.java:918)
at
java.ibjectInputStream.readObject(ObjectInputStream.java:366)
at
java.ibjectInputStream.readObject(ObjectInputStream.java:236)
at
java.ibjectInputStream.inputObject(ObjectInputStream.java:1186)
at
java.ibjectInputStream.readObject(ObjectInputStream.java:386)
at
java.ibjectInputStream.readObject(ObjectInputStream.java:236)
at java.util.LinkedList.readObject(LinkedList.java:687)
at java.lang.reflect.Method.invoke(Native Method)
at
java.ibjectInputStream.invokeObjectReader(ObjectInputStream.java:2214)
at
java.ibjectInputStream.inputObject(ObjectInputStream.java:1411)
at
java.ibjectInputStream.readObject(ObjectInputStream.java:386)
at
java.ibjectInputStream.readObject(ObjectInputStream.java:236)
at auction.AuctionManager.loadAuctions(AuctionManager.java:32)
at
auction.AuctionManager.getAuctionManagerInstance(AuctionManager.java:179)
at AuctionLogin.<init>(AuctionLogin.java:15)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:903)
at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:668)
at
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:416)
at
org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:216)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar
dPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar
dPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar
dPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar
dPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar
dPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar
dPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11P
rotocol.java:392)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:484)
Thanks
I have a test Servlet class that instantiates an auction package I
created. The auctions are stored as a serialized file. The Servlet is
stored in '$root\servlets\WEB-INF\classes' and the auction package is
stored in '$root\servlets\WEB-INF\classes\auction'. The servlet cannot
deserialize the auctions from file. Please can anyone help. Much
appreciated.
Using jdk1.3.1_02
and jakarta-tomcat-4.1.24
Here is the stack trace:
[INFO] Registry - -Loading registry information
[INFO] Registry - -Creating new Registry instance
[INFO] Registry - -Creating MBeanServer
[INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1.24
[INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080
[INFO] ChannelSocket - -JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009
[INFO] JkMain - -Jk running ID=0 time=10/160
config=C:\jakarta-tomcat-4.1.24\conf\jk2.properties
Class cast exception: File could not be deserialized
Unable to load auctions from file! AuctionManager:loadAuctions()
java.lang.ClassNotFoundException: Auction
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1443)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1289)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:195)
at
java.ibjectInputStream.resolveClass(ObjectInputStream.java:654)
at
java.ibjectInputStream.inputClassDescriptor(ObjectInputStream.java:918)
at
java.ibjectInputStream.readObject(ObjectInputStream.java:366)
at
java.ibjectInputStream.readObject(ObjectInputStream.java:236)
at
java.ibjectInputStream.inputObject(ObjectInputStream.java:1186)
at
java.ibjectInputStream.readObject(ObjectInputStream.java:386)
at
java.ibjectInputStream.readObject(ObjectInputStream.java:236)
at java.util.LinkedList.readObject(LinkedList.java:687)
at java.lang.reflect.Method.invoke(Native Method)
at
java.ibjectInputStream.invokeObjectReader(ObjectInputStream.java:2214)
at
java.ibjectInputStream.inputObject(ObjectInputStream.java:1411)
at
java.ibjectInputStream.readObject(ObjectInputStream.java:386)
at
java.ibjectInputStream.readObject(ObjectInputStream.java:236)
at auction.AuctionManager.loadAuctions(AuctionManager.java:32)
at
auction.AuctionManager.getAuctionManagerInstance(AuctionManager.java:179)
at AuctionLogin.<init>(AuctionLogin.java:15)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:903)
at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:668)
at
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:416)
at
org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:216)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar
dPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar
dPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar
dPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar
dPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar
dPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Standar
dPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11P
rotocol.java:392)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:484)
Thanks