@Test
public void testNamingExceptionWithNonSerializableResolvedObj()
        throws Exception {

    javax.naming.NameAlreadyBoundException wrappedException = new javax.naming.NameAlreadyBoundException(
            "some error");
    wrappedException.setResolvedObj(new InitialDirContext());
    NamingException exception = new NameAlreadyBoundException(
            wrappedException);
    writeToStream(exception);
    NamingException deSerializedException = readFromStream();
    assertNotNull(
            "Original exception resolvedObj after serialization should not be null",
            exception.getResolvedObj());
    assertNull("De-serialized exception resolvedObj should be null",
            deSerializedException.getResolvedObj());
}