Hi all,

(could any replies to this come directly to me as well as the list please - I
get the list in digest mode)

I have a basic CMP entity bean that models a user's account in a system, and
I have a password field that I need to encrypt.  This is a very simple
example, but you'll see my problem from it.

I have the password field declared as a byte[], but get/set methods have
String param/return type.  My methods are then:

public void setPassword(String password) { this.password =
password.getBytes(); }
public String getPassword() { return new String(password); }

This all seems to work fine, but it breaks some of my other test cases.  I
haven't been able to identify exactly what the circumstances are that cause
it, but basically after a call to remove() on the bean I get the following
exception:

java.sql.SQLException: Unable to load a ResultSet column into a variable of
type '[B': java.io.StreamCorruptedException: InputStream does not contain a
serialized object

I only get this exception in some cases, and I haven't been able to replicate
it in isolation away from the other tests.  I'm running on Postgres, and
JBoss 2.1 with Sun 1.3 JVM.

When JBoss creates the table, it creates the password column as an "oid" type
- I dont know what this is, but if I do a JDBC query on it I get an Integer
type.  I can also get it as a Blob, but Postgres' Blob isn't fully
implemented so I haven't been able to determine a lot from that.

The value is never null - I found a previous mail that had the same exception
from trying to put a null value into a primitive int type.

I have very little idea what the exact cause of this is, any help would be
apprecitated - see the stack trace below.

cheers, tia for any help
dim

Stack trace:  (edited to make readable)

 [Account] TRANSACTION ROLLBACK EXCEPTION:Load failed; nested exception is:
        java.sql.SQLException: Unable to load a ResultSet column into a variable of
type '[B': java.io.StreamCorruptedException: InputStream does not contain a
serialized object; nested exception is:
        java.rmi.ServerException: Load failed; nested exception is:
        java.sql.SQLException: Unable to load a ResultSet column into a variable of
type '[B': java.io.StreamCorruptedException: InputStream does not contain a
serialized object
 [Account] java.rmi.ServerException: Load failed; nested exception is:
 [Account]      java.sql.SQLException: Unable to load a ResultSet column into a
variable of type '[B': java.io.StreamCorruptedException: InputStream does not
contain a serialized object
 [Account] java.sql.SQLException: Unable to load a ResultSet column into a
variable of type '[B': java.io.StreamCorruptedException: InputStream does not
contain a serialized object
 [Account]      at
org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.getResultObject(JDBCCommand.java:
482) [Account]  at
org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.getResultObject(JDBCCommand.java:
498) [Account]  at
org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.handleResult(JDBCLoadEn
tityCommand.java:115) [Account]         at
org.jboss.ejb.plugins.jaws.jdbc.JDBCQueryCommand.executeStatementAndHandleRes
ult(JDBCQueryCommand.java:59) [Account]         at
org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.java:159)
 [Account]      at
org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityC
ommand.java:78) [Account]       at
org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.loadEntity(JAWSPersistenceM
anager.java:150) [Account]      at
org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.
java:341) [Account]     at
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchroni
zationInterceptor.java:192) [Account]   at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceIntercep
tor.java:186) [Account]         at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
 [Account]      at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.j
ava:263) [Account]      at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
 [Account]      at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:177
) [Account]     at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
 [Account]      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:323)
 [Account]      at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerIn
voker.java:471) [Account]       at
org.jboss.ejb.plugins.jrmp.interfaces.EntityProxy.invoke(EntityProxy.java:146
) [Account]     at $Proxy16.getBdoId(Unknown Source)
 [Account]      at
com.nuix.bdo.connection.ConnectionManagerEJB.removeConnection(ConnectionManag
erEJB.java:148) [Account]       at java.lang.reflect.Method.invoke(Native Method)
 [Account]      at
org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSe
ssionContainer.java:570) [Account]      at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:177
) [Account]     at
org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessi
onInstanceInterceptor.java:206) [Account]       at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
 [Account]      at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.j
ava:263) [Account]      at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
 [Account]      at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
 [Account]      at
org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java:3
26) [Account]   at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerIn
voker.java:471) [Account]       at
org.jboss.ejb.plugins.jrmp.interfaces.StatefulSessionProxy.invoke(StatefulSes
sionProxy.java:150) [Account]   at $Proxy12.removeConnection(Unknown Source)
 [Account]      at
com.nuix.interceptor.interpretor.DeleteConnectionInterpretor.execute(DeleteCo
nnectionInterpretor.java:149) [Account]         at
com.nuix.interceptor.InterceptorEJB.execute(InterceptorEJB.java:127)
 [Account]      at java.lang.reflect.Method.invoke(Native Method)
 [Account]      at
org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulSe
ssionContainer.java:570) [Account]      at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:177
) [Account]     at
org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSessi
onInstanceInterceptor.java:206) [Account]       at
org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
 [Account]      at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.j
ava:263) [Account]      at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
 [Account]      at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
 [Account]      at
org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java:3
26) [Account]   at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerIn
voker.java:381) [Account]       at java.lang.reflect.Method.invoke(Native Method)
 [Account]      at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
 [Account]      at sun.rmi.transport.Transport$1.run(Transport.java:142)
 [Account]      at java.security.AccessController.doPrivileged(Native Method)
 [Account]      at sun.rmi.transport.Transport.serviceCall(Transport.java:139)
 [Account]      at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:443)
 [Account]      at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:64
3) [Account]    at java.lang.Thread.run(Thread.java:484)

-------------------------------------------------------

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to