Bugs item #595672, was opened at 2002-08-15 21:28
Message generated for change (Comment added) made by loubyansky
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=595672&group_id=22866

Category: JBossCMP
Group: v3.0 Rabbit Hole
>Status: Closed
>Resolution: Out of Date
Priority: 8
Submitted By: Boris Tamarkin (upss)
Assigned to: Alexey Loubyansky (loubyansky)
Summary: Deserialization broken in JBoss 3.01

Initial Comment:
Win2000 operating system
MySQL or MS SQLServer 2000 databases

mapping in standardjbosscmp-jdbc.xml (same as in 3.0)
for mySQL
<java-type>java.lang.Object</java-type>
<jdbc-type>JAVA_OBJECT</jdbc-type>
<sql-type>LONGBLOB</sql-type>

<java-type>java.lang.Object</java-type> 
<jdbc-type>JAVA_OBJECT</jdbc-type> 
<sql-type>IMAGE</sql-type> 

Repeat scenario
Having CMP2 entity bean with one Object atribute.
Call setObject works fine and store as a Blob in 
database.
When trying to retreive after, failure happens.
Stacktrace attached below

*Notes:
1. Serialization and deserialization doing only with 3.01 
version of JBoss
2. Not trying to deserealize old blobs (I am aware of it 
can be not supported and compatible with earlier version 
of JBoss)
3. This functionality and same code works fine with 
previous JBoss 3.0 version, but it is broken in 3.01.
Thanks

Stacktrace
*********
10:51:02,738 ERROR [LogInterceptor] 
TransactionRolledbackLocalException, causedB
y:
java.sql.SQLException: Unable to load to deserialize 
result: java.io.StreamCorru
ptedException: invalid stream header
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.convertByteArra
yToObject(JDBC
Util.java:612)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.getResult
(JDBCUtil.java:311)
        at 
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMP
FieldBridge.load
ArgumentResults
(JDBCAbstractCMPFieldBridge.java:350)
        at 
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMP
FieldBridge.load
InstanceResults(JDBCAbstractCMPFieldBridge.java:304)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityComman
d.execute(JDBCLoad
EntityCommand.java:142)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityComman
d.execute(JDBCLoad
EntityCommand.java:62)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.load
Entity(JDBCStoreM
anager.java:572)
        at 
org.jboss.ejb.plugins.CMPPersistenceManager.loadEntit
y(CMPPersistence
Manager.java:410)
        at 
org.jboss.resource.connectionmanager.CachedConnectio
nInterceptor.load
Entity(CachedConnectionInterceptor.java:353)
        at 
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.inv
oke(EntityS
ynchronizationInterceptor.java:262)
        at 
org.jboss.resource.connectionmanager.CachedConnectio
nInterceptor.invo
ke(CachedConnectionInterceptor.java:186)
        at 
org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke
(EntityInstance
Interceptor.java:152)
        at 
org.jboss.ejb.plugins.EntityLockInterceptor.invoke
(EntityLockIntercep
tor.java:107)
        at 
org.jboss.ejb.plugins.EntityCreationInterceptor.invoke
(EntityCreation
Interceptor.java:69)
        at 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext
(AbstractTxInte
rceptor.java:107)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransacti
ons(TxIntercep
torCMT.java:178)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invoke
(TxInterceptorCMT.java:6
0)
        at org.jboss.ejb.plugins.SecurityInterceptor.invoke
(SecurityInterceptor.
java:130)
        at org.jboss.ejb.plugins.LogInterceptor.invoke
(LogInterceptor.java:203)
        at org.jboss.ejb.EntityContainer.invoke
(EntityContainer.java:493)
        at 
org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.inv
oke(BaseLoca
lContainerInvoker.java:301)
        at org.jboss.ejb.plugins.local.EntityProxy.invoke
(EntityProxy.java:38)
        at $Proxy161.getKeyValue(Unknown Source)
        at com.rendition.MyEJB.retrieveKey
(MyEJB.java:155)
******

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

>Comment By: Alexey Loubyansky (loubyansky)
Date: 2003-10-24 15:33

Message:
Logged In: YES 
user_id=543482

Please, reopen if it is not fixed.

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

Comment By: Dain Sundstrom (dsundstrom)
Date: 2003-08-18 01:41

Message:
Logged In: YES 
user_id=251431

I am no no longer a JBoss committer, so I am unable to fix
any bugs.

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

Comment By: Axel Mueller (camueller)
Date: 2002-11-12 23:46

Message:
Logged In: YES 
user_id=389955

It seems to be fixed in 3.0.4 (in 3.2.0beta it is NOT fixed).

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

Comment By: Stephen Coy (scoy)
Date: 2002-11-02 01:25

Message:
Logged In: YES 
user_id=463096

I believe that its fixed in Branch_3_0, Branch_3_2 and HEAD


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

Comment By: Boris Tamarkin (upss)
Date: 2002-11-01 19:45

Message:
Logged In: YES 
user_id=595649

Is it fixed in release, or in CVS?
In JBoss 3.0.3 is not seem to be fixed.
Thanks

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

Comment By: Stephen Coy (scoy)
Date: 2002-10-31 09:29

Message:
Logged In: YES 
user_id=463096

The handling of large character and binary columns has been completely 
overhauled.
The stack trace looks like a typical manifestation of JBoss's earlier 
BLOB/CLOB problems,
Note that the JAVA_OBJECT jdbc type should probably not be mapped 
to binary columns - use VARBINARY, LONGVARBINARY or CLOB 
instead (of JAVA_OBJECT).
Anyway, with correct mappings I believe this is fixed.


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

Comment By: Boris Tamarkin (upss)
Date: 2002-09-27 03:09

Message:
Logged In: YES 
user_id=595649

I wanted to add:
Scenario is:
1.start JBoss3.02
2.serialize object with CMP and persist
3. deserialize object 
(everything works great)
4. Shutdown Jboss
5.start jBoss
6. deserialize again persisted object
Boom !!! Exception
Doesn't works for String, and for byte[]


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

Comment By: Boris Tamarkin (upss)
Date: 2002-09-27 03:05

Message:
Logged In: YES 
user_id=595649

Hi Dan,
The problem still exists in 3.02 as well.
In 3.02 deserialization works fine until first shut down the 
server.
Next time server starting, same exception happens (please 
see below). So probably in 3.02 was work around of keeping 
in cash? But it is still broken though.
**Important note: objects were serialized and deserialized in 
3.02. So, something big missing here.
I have tested with 3 databases: mySQL, SQLServer2000 and
Oracle9i
And You can't not to use Blob if You want to store crypto key 
for example. 
If it is impossible to fix, please say so.
Thanks in advance,
   Boris

****
16:51:48,395 ERROR [LogInterceptor] 
TransactionRolledbackLocalException, causedB
y:
java.sql.SQLException: Unable to load to deserialize result: 
java.io.StreamCorru
ptedException: invalid stream header
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.convertByteArrayToO
bject(JDBC
Util.java:612)
        at org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.getResult
(JDBCUtil.java:311)
        at 
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPField
Bridge.load
ArgumentResults(JDBCAbstractCMPFieldBridge.java:350)
        at 
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPField
Bridge.load
InstanceResults(JDBCAbstractCMPFieldBridge.java:304)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.exe
cute(JDBCLoad
EntityCommand.java:147)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.exe
cute(JDBCLoad
EntityCommand.java:62)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity
(JDBCStoreM
anager.java:572)
        at 
org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity
(CMPPersistence
Manager.java:410)
        at 
org.jboss.resource.connectionmanager.CachedConnectionInte
rceptor.load
Entity(CachedConnectionInterceptor.java:353)
        at 
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke
(EntityS
ynchronizationInterceptor.java:262)
        at 
org.jboss.resource.connectionmanager.CachedConnectionInte
rceptor.invo
ke(CachedConnectionInterceptor.java:186)
        at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke
(EntityInstance
Interceptor.java:152)
        at org.jboss.ejb.plugins.EntityLockInterceptor.invoke
(EntityLockIntercep
tor.java:107)
        at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke
(EntityCreation
Interceptor.java:69)
        at 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext
(AbstractTxInte
rceptor.java:107)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions
(TxIntercep
torCMT.java:178)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invoke
(TxInterceptorCMT.java:6
0)
        at org.jboss.ejb.plugins.SecurityInterceptor.invoke
(SecurityInterceptor.
java:130)
        at org.jboss.ejb.plugins.LogInterceptor.invoke
(LogInterceptor.java:203)
        at org.jboss.ejb.EntityContainer.invoke
(EntityContainer.java:493)
        at 
org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke
(BaseLoca
lContainerInvoker.java:301)
        at org.jboss.ejb.plugins.local.EntityProxy.invoke
(EntityProxy.java:38)
        at $Proxy174.getKeyValue(Unknown Source)
**


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

Comment By: Boris Tamarkin (upss)
Date: 2002-09-27 03:04

Message:
Logged In: YES 
user_id=595649

Hi Dan,
The problem still exists in 3.02 as well.
In 3.02 deserialization works fine until first shut down the 
server.
Next time server starting, same exception happens (please 
see below). So probably in 3.02 was work around of keeping 
in cash? But it is still broken though.
**Important note: objects were serialized and deserialized in 
3.02. So, something big missing here.
I have tested with 3 databases: mySQL, SQLServer2000 and
Oracle9i
And You can't not to use Blob if You want to store crypto key 
for example. 
If it is impossible to fix, please say so.
Thanks in advance,
   Boris

****
16:51:48,395 ERROR [LogInterceptor] 
TransactionRolledbackLocalException, causedB
y:
java.sql.SQLException: Unable to load to deserialize result: 
java.io.StreamCorru
ptedException: invalid stream header
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.convertByteArrayToO
bject(JDBC
Util.java:612)
        at org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.getResult
(JDBCUtil.java:311)
        at 
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPField
Bridge.load
ArgumentResults(JDBCAbstractCMPFieldBridge.java:350)
        at 
org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPField
Bridge.load
InstanceResults(JDBCAbstractCMPFieldBridge.java:304)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.exe
cute(JDBCLoad
EntityCommand.java:147)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.exe
cute(JDBCLoad
EntityCommand.java:62)
        at 
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity
(JDBCStoreM
anager.java:572)
        at 
org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity
(CMPPersistence
Manager.java:410)
        at 
org.jboss.resource.connectionmanager.CachedConnectionInte
rceptor.load
Entity(CachedConnectionInterceptor.java:353)
        at 
org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke
(EntityS
ynchronizationInterceptor.java:262)
        at 
org.jboss.resource.connectionmanager.CachedConnectionInte
rceptor.invo
ke(CachedConnectionInterceptor.java:186)
        at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke
(EntityInstance
Interceptor.java:152)
        at org.jboss.ejb.plugins.EntityLockInterceptor.invoke
(EntityLockIntercep
tor.java:107)
        at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke
(EntityCreation
Interceptor.java:69)
        at 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext
(AbstractTxInte
rceptor.java:107)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions
(TxIntercep
torCMT.java:178)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invoke
(TxInterceptorCMT.java:6
0)
        at org.jboss.ejb.plugins.SecurityInterceptor.invoke
(SecurityInterceptor.
java:130)
        at org.jboss.ejb.plugins.LogInterceptor.invoke
(LogInterceptor.java:203)
        at org.jboss.ejb.EntityContainer.invoke
(EntityContainer.java:493)
        at 
org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke
(BaseLoca
lContainerInvoker.java:301)
        at org.jboss.ejb.plugins.local.EntityProxy.invoke
(EntityProxy.java:38)
        at $Proxy174.getKeyValue(Unknown Source)
**


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

Comment By: Dain Sundstrom (dsundstrom)
Date: 2002-09-18 00:08

Message:
Logged In: YES 
user_id=251431

I spend all day testing this and have determined the following:

Value classes in 3.0.0 were really broken.  You can not have
a field of type java.lang.Object and get the value back out.
 If you have a field of some custom type (like
my.custom.ValueClass), it will work until you redeploy your
applcation and then you get class cast exceptions because of
a classloader conflict.

Value classes work perfectly in 3.0.2 if the field was
stored using 3.0.2.  If it was stored with 3.0.0, it will
work the first time you deploy, but you will get a class
cast exception on redeploy.  This is because 3.0.0 stored a
java.rmi.MarshalledObject, which  doesn't respect
classloaders, and 3.0.1+ stores a MarshalledValue, which
uses classloaders correctly.

To make a long story short, there is nothing more we can do.
 Hopefully this will be the last data incompatiblity we
have, but there is no guarantee.  I suggest you try to find
a way to store you values in a more portable way in the
database, such as an xml string.

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

Comment By: Nobody/Anonymous (nobody)
Date: 2002-08-27 16:42

Message:
Logged In: NO 

We are using Oracle and map a String[] to a Blob and we do get the same exception.

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

Comment By: Dain Sundstrom (dsundstrom)
Date: 2002-08-24 03:10

Message:
Logged In: YES 
user_id=251431

I don't use MS SQL Server, but I'll see if this works with
my databases.  It may just be a SQL Server bug.

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

Comment By: Nobody/Anonymous (nobody)
Date: 2002-08-21 21:28

Message:
Logged In: NO 

Any news?
Or whom should be assigned?
Thanks

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=595672&group_id=22866


-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to