camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] Created: (CAMEL-3120) hawtdb - Should wrap caused exception in wrapped IOException
Date Tue, 14 Sep 2010 08:43:40 GMT
hawtdb - Should wrap caused exception in wrapped IOException

                 Key: CAMEL-3120
             Project: Apache Camel
          Issue Type: Improvement
    Affects Versions: 2.4.0
            Reporter: Claus Ibsen
            Assignee: Hiram Chirino
            Priority: Minor
             Fix For: 2.6.0

The {{decode}} method in {{ObjectCodec}} should wrap the causes stacktrace in the wrapped

For example OSGi frameworks may be pesky and we want to be able to see whatever stacktrace
it may thrown on you.


    public T decode(DataInput dataIn) throws IOException {
        int size = dataIn.readInt();
        byte[] data = new byte[size];
        ByteArrayInputStream bytesIn = new ByteArrayInputStream(data);
        ObjectInputStream objectIn = new ObjectInputStream(bytesIn);
        try {
            return (T) objectIn.readObject();
        } catch (ClassNotFoundException e) {
            throw new IOException(e.getMessage());

For being JDK 1.5 compatible you need to do it like
    public static IOException createIOException(String message, Throwable cause) {
        IOException answer = new IOException(message);
        return answer;

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message