This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Marshalling Error in Nested Application Exceptions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Marshalling Error in Nested Application Exceptions" Watch "Marshalling Error in Nested Application Exceptions" New topic
Author

Marshalling Error in Nested Application Exceptions

Terence Lai
Greenhorn

Joined: Dec 09, 2007
Posts: 8
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

Joined: Jul 20, 2005
Posts: 9947
    
161

Are you sure that the client classpath has the same version of the class file that is on the server?


[My Blog] [JavaRanch Journal]
Terence Lai
Greenhorn

Joined: Dec 09, 2007
Posts: 8
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Marshalling Error in Nested Application Exceptions
 
Similar Threads
Application Exception in MDB
Rollback
SessionBean method returning POJO == exception?
Design Issues
Transaction EJB session bean