tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 32428] New: - Classloader issue when reading serialized object from database.
Date Mon, 29 Nov 2004 13:54:19 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32428>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32428

           Summary: Classloader issue when reading serialized object from
                    database.
           Product: Tomcat 5
           Version: 5.0.28
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Unknown
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: rszalai@aitia.ai


I've set up a JDBC datasource for MySQL as it described in 
this page: 

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-
howto.html

I've installed mysql-connector-java-3.0.9-stable-bin.jar in 
$CATALINA_HOME/common/lib

When I try to read a serialized object from a BLOB column, 
I always get ClassNotFoundException. 
The class of the object that I want to read is located in my
webapp's WEB-INF/classes directory.

Code: 

161   rs = stmt.executeQuery();
162			
163   if (rs.next()) {
164      DummyVO dummy = new DummyVO();
165      dummy.setId(rs.getLong(1));
...      ...
176      dummy.setEnv((Dummy) rs.getObject(9));
...      ...
179   }

Stacktrace:

java.sql.SQLException: Class not found: java.lang.ClassNotFoundException: 
sim.test.Dummy while reading serialized object
        at com.mysql.jdbc.ResultSet.getObject(ResultSet.java:1537)
        at org.apache.commons.dbcp.DelegatingResultSet.getObject(DelegatingResul
tSet.java:286)
        at sim.proba.dao.SimulationDAO.findById(SimulationDAO.java:176)
        at sim.proba.web.SimAction.getSimulation(SimAction.java:40)
        at sim.proba.web.ControlSimAction.execute(ControlSimAction.java:71)
        at org.apache.struts.action.RequestProcessor.processActionPerform(Reques
tProcessor.java:421)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:226)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:116
4)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

If this is the normal classloader behaivor, how can I read serialized object
from db?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message