Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mismatched serialization UIDs in EJB Remote Method - java.util.date & DBTimestamp

I have a java web application that is deployed in two EARs - one for the UI tier (contains a WAR module) and one for the business tier (contains an EJB module). Both tiers are deployed to WebSphere Application Server 7. The tiers are connected via EJB 3.0 stateless session beans. The beans are looked up via JNDI.

We use Hibernate for persistence, and a DB2 database.

When the remote EJB call is returned, the following error occurs on the client side:

java.rmi.MarshalException: CORBA MARSHAL 0x4942f896 No; nested exception is: 
    org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Mismatched serialization UIDs : Source (RepId RMI:java.util.Date:AC117E28FE36587A:686A81014B597419) = 686A81014B597419 whereas Target (RepId RMI:com.ibm.db2.jcc.DBTimestamp:AA774DBE96ECCE99:7AFCE1FB570D419C) = 7AFCE1FB570D419C  vmcid: IBM  minor code: 896  completed: No

The java.util.Date field on the object is being returned from Hibernate as a com.ibm.db2.jcc.DBTimestamp field, which extends java.sql.Timestamp which extends java.util.Date. As it is a subclass of java.util.Date and is serializable, shouldn't this be handled?

I've spoken to a more experience person who has said the likely cause is that the JVM version or DBTimestamp class version is different between the web and business tier WAS servers. Both servers have the same JVM, WAS, and JAR version.

I also have a local WAS 7 server, where both tiers are deployed to the same server. The EJBs are still resolved remotely via a JNDI call to localhost. The application works fine on my local server. The only difference I'm aware of is a different micro-version of WAS, as well as deploying both tiers to the same server.

What is the cause of the problem? Is it that the DBTimestamp class can't be found on the web tier, or that the version of the class is different? Or is it an issue with polymorphism, or something else entirely?

Aside from an answer, I'd also appreciate any advice on what debugging to try - I'm out of ideas.

like image 666
J Barclay Avatar asked Nov 04 '22 19:11

J Barclay


1 Answers

I have managed to 'fix' the problem by packaging up the relevant DB2 driver JAR in the web tier EAR.

The cause of the problem is therefore that the class was not available on the classpath of the web tier. I will need to investigate the setup of the environment to figure out why it's not available, but at least the problem is clear now.

like image 172
J Barclay Avatar answered Nov 09 '22 12:11

J Barclay