Hmmm... disturbing. I've never seen a JDBC driver try to
deserialize internally to reply to getObject. I've only seen it return a
raw byte array from getObject if it didn't have anything more appropriate.
Hmph. I'm not sure there's an answer to this one.
The correct ClassLoader, for what it's worth, is
Thread.currentThread().getContextClasLoader() which seems to be used by
RMI but not a general ObjectInputStream. So one solution would be for the
Hypersonic folks to use that when they deserialize. Another would be
for getObject to return a byte array, as I've seen it do before (though
I can't remember whether it was Hypersonic or InstantDB). I'm a little
uncomfortable about never trying getObject if we can't figure out what to
call, since I'm not sure getBytes would return something coherent if there
was actually a valid Object in the result set.
But hey, I guess we're just as well fixing the bug you can
demonstrate rather than the possibility that rubs me the wrong way.
Aaron
On Wed, 13 Sep 2000, Sebastien Alborini wrote:
> Aaron Mulder wrote:
> >
> > What was the problem? Was getObject throwing an exception or
> > something? That code was working for me earlier...
> >
> > Aaron
> >
>
> Yes, getObject threw a SQLException when trying to deserialize helper
> classes (known only in the beans' jar). If you revert the changes and
> try running the new test you will get something like:
>
>
> [Default] java.sql.SQLException: Serialization failure:
> org.jboss.zol.testbean2.interfaces.MyObject
> at org.hsql.Trace.getError(Trace.java:124)
> at org.hsql.Trace.getError(Trace.java:115)
> at org.hsql.Trace.error(Trace.java:130)
> at org.hsql.ByteArray.deserialize(ByteArray.java:58)
> at org.hsql.jdbcResultSet.getObject(jdbcResultSet.java:710)
> at
> org.jboss.minerva.jdbc.ResultSetInPool.getObject(ResultSetInPool.java:319)
> at
> org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.getResultObject(JDBCCommand.java:379)
> at
>
>org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.handleResult(JDBCLoadEntityCommand.java:114)
> at
>
>org.jboss.ejb.plugins.jaws.jdbc.JDBCQueryCommand.executeStatementAndHandleResult(JDBCQueryCommand.java:59)
> at
> org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.java:153)
> at
>
>org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:77)
> at
>
>org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.loadEntity(JAWSPersistenceManager.java:150)
> at
>
>org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:205)
> ....
>
>
> (MyObject is a class in TestBeans2.jar).
>
> The jdbc driver doesn't seem to have the right classloader.
> Any idea??
>
> Sebastien
>