This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Marshalling Error in Nested Application Exceptions

 
Terence Lai
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have implemented the following exceptions in my EJB project:
1) ApplicationException extends from java.lang.Exception
2) DAOException extends from ApplicationException

Note that I use my IDE to generate the serialVersionUIDs in both classes. Other than invoking the parent's constructors, these exceptions do not have other logics.

In my EJB project, I have a stateless session bean declared to throw ApplicationException. During the runtime, if the session bean catches DAOException, it wraps the DAOException into the ApplicationException such as the followings:

try {
// application logic
} catch (DAOException ex) {
throw new ApplicationException(
"Error in accessing application data",
ex);
}

This nested exception creates a problem. Upon the client program invokes the session bean method, the system fails to marshal the nested exception. Specifically, I see the following exception stack trace captured from the client side:

com.mycompany.myproject.exception.ApplicationException: java.rmi.MarshalException: CORBA MARSHAL 0x4942f89a No; nested exception is:
org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Mismatched serialization UIDs : Source (RepId RMI:java.lang.Throwable:F8678B4F4D2EB705 5C635273977B8CB) = D5C635273977B8CB whereas Target (RepId RMI:com.mycompany.myproject.dao.exception.DAOException:7DFDC0413F49F03D:4553EC7D326F34B1) = 4553EC7D326F34B1 vmcid: IBM minor code: 89A completed: No

Does anyone know the cause of the error? I am using WebSphere Application Server 6.1.

Thanks,
Terence
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure that the client classpath has the same version of the class file that is on the server?
 
Terence Lai
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. The client classpath contains the same version of classes on the server side.

In fact, I have no problems if the server throws either DAOException or ApplicationException. The problem occurs when DAOException is nested inside the ApplicationException.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic