You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2010/09/14 17:00:44 UTC

[jira] Assigned: (CAMEL-3120) hawtdb - Should work in OSGi

     [ https://issues.apache.org/activemq/browse/CAMEL-3120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-3120:
----------------------------------

    Assignee: Claus Ibsen  (was: Hiram Chirino)

> hawtdb - Should work in OSGi
> ----------------------------
>
>                 Key: CAMEL-3120
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3120
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 2.4.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.5.0
>
>         Attachments: CAMEL-3120-buf.patch, CAMEL-3120-db.patch
>
>
> The {{decode}} method in {{ObjectCodec}} should wrap the causes stacktrace in the wrapped IOException.
> For example OSGi frameworks may be pesky and we want to be able to see whatever stacktrace it may thrown on you.
> {code}
>     public T decode(DataInput dataIn) throws IOException {
>         int size = dataIn.readInt();
>         byte[] data = new byte[size];
>         dataIn.readFully(data);
>         ByteArrayInputStream bytesIn = new ByteArrayInputStream(data);
>         ObjectInputStream objectIn = new ObjectInputStream(bytesIn);
>         try {
>             return (T) objectIn.readObject();
>         } catch (ClassNotFoundException e) {
>             throw new IOException(e.getMessage());
>         }
>     }
> {code}
> For being JDK 1.5 compatible you need to do it like
> {code}
>     public static IOException createIOException(String message, Throwable cause) {
>         IOException answer = new IOException(message);
>         answer.initCause(cause);
>         return answer;
>     }
> {code}

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