Hi,

I'm trying to use a camel-flatpack endpoint inside a Fuse SMX container
(apache-servicemix-4.3.0-fuse-03-00). When triggered, the route fails with a
NullPointerException:
>>
15:58:43,328 | ERROR |  - vm://flatpack | DefaultErrorHandler              |
rg.apache.camel.processor.Logger  248 | 72 - org.apache.camel.camel-core -
2.4.0.fuse-02-00 | Failed delivery for exchangeId:
6b384114-ab78-4740-b0c2-b96a3254404f. Exhausted after delivery attempt: 1
caught: java.lang.NullPointerException
java.lang.NullPointerException
        at
net.sf.flatpack.util.ParserUtils.loadConvertProperties(ParserUtils.java:1003)[200:org.apache.servicemix.bundles.flatpack:3.1.1.3]
        at
net.sf.flatpack.AbstractDelimiterParser.doDelimitedFile(AbstractDelimiterParser.java:130)[200:org.apache.servicemix.bundles.flatpack:3.1.1.3]
        at
net.sf.flatpack.AbstractDelimiterParser.doParse(AbstractDelimiterParser.java:78)[200:org.apache.servicemix.bundles.flatpack:3.1.1.3]
        at
net.sf.flatpack.AbstractParser.parse(AbstractParser.java:113)[200:org.apache.servicemix.bundles.flatpack:3.1.1.3]
        at
org.apache.camel.component.flatpack.FlatpackProducer.process(FlatpackProducer.java:37)[201:org.apache.camel.camel-flatpack:2.4.0.fuse-02-00]
        at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[72:org.apache.camel.camel-core:2.4.0.fuse-02-00]
        ...
<<

Cross-checking against the source files, it seems that the error occurs when
Flatpack is trying to load a property file from the class path:
>>
    public static Properties loadConvertProperties() throws IOException {
        final Properties pzConvertProps = new Properties();
        final URL url =
ParserUtils.class.getClassLoader().getResource("fpconvert.properties");
        pzConvertProps.load(url.openStream());

        return pzConvertProps;
    }
<<

A remote debug confirmed that url is null, which leads to the NPE when
loading the props.

The properties file is contained in the flatpack 3.1.1 JAR file. I also
created a file of the same name and content in my bundle. Still, the error
remains.

I'm relatively new to OSGi, but my suspicion is that the call to..
>>
ParserUtils.class.getClassLoader().getResource("fpconvert.properties");
<<
... doesn't behave as in other environments, and that the error comes from
OSGi class loading.

Can any of you guys confirm this observation?
Is there a way to work around this issue?

Thanks,
Ciao, Philipp

-- 
View this message in context: 
http://servicemix.396122.n5.nabble.com/camel-flatpack-in-Fuse-SMX-fails-in-ParserUtils-tp3398705p3398705.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to