[ https://issues.apache.org/activemq/browse/CAMEL-3120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61810#action_61810 ]
Claus Ibsen commented on CAMEL-3120: ------------------------------------ And when using equinox {code} Caused by: java.io.IOException: org.apache.camel.impl.DefaultExchangeHolder at org.fusesource.hawtbuf.codec.ObjectCodec.createIOException(ObjectCodec.java:60) at org.fusesource.hawtbuf.codec.ObjectCodec.decode(ObjectCodec.java:55) at org.apache.camel.component.hawtdb.HawtDBCamelCodec.unmarshallExchange(HawtDBCamelCodec.java:74) at org.apache.camel.component.hawtdb.HawtDBAggregationRepository.get(HawtDBAggregationRepository.java:159) ... 56 more Caused by: java.lang.ClassNotFoundException: org.apache.camel.impl.DefaultExchangeHolder at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:494) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at org.fusesource.hawtbuf.codec.ObjectCodec.decode(ObjectCodec.java:51) at org.apache.camel.component.hawtdb.HawtDBCamelCodec.unmarshallExchange(HawtDBCamelCodec.java:74) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:398) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105) at org.apache.camel.component.hawtdb.HawtDBAggregationRepository.get(HawtDBAggregationRepository.java:159) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at org.apache.camel.processor.aggregate.AggregateProcessor.doAggregation(AggregateProcessor.java:207) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at org.apache.camel.processor.aggregate.AggregateProcessor.process(AggregateProcessor.java:184) at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:604) at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at org.fusesource.hawtbuf.codec.ObjectCodec.decode(ObjectCodec.java:51) ... 58 more {code} > hawtdb - Should wrap caused exception in wrapped IOException > ------------------------------------------------------------ > > Key: CAMEL-3120 > URL: https://issues.apache.org/activemq/browse/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 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.