Spring configuration in Talend ESB (SE) cannot reference resources in the runtime environment.

Six Stars

Spring configuration in Talend ESB (SE) cannot reference resources in the runtime environment.

I'm migrating a route that uses a resource file from within the spring configuration. In 6.5.1 this worked fine, but in 7.1.1 it cannot find the resource, despite the fact that it is included in the .jar file. This seems to be something in the way that Spring is now run from within Blueprint, and I read lots of things about OSGi using different ClassLoaders and problems therein.

 

As an alternative approach, I've tried instantiating a ClassLoader bean in Spring and using the getResourceAsStream method directly, but even this doesn't work - presumably because I'm getting the "wrong" ClassLoader.

 

If I do this from within the generated java class, as a processor (i.e. this.getClass().getClassLoader().getResourceAsStream("my/resource.txt") ) it can find it, but if I try using the Spring PathMatchingResourcePatternResolver it works fine in Studio but breaks when deployed to runtime, with an error stating that the bundle-resource isn't part of the filesystem. (The resources are found as actual files in the filesystem when run from the studio.

 

Is this a fault in Spring itself, or in the way Talend is wrapping Spring within Blueprint?

 

How should I reference a route resource from within the Spring configuration in ESB 7.1.1?

 

Thanks!

Tags (2)
Highlighted
Moderator

Re: Spring configuration in Talend ESB (SE) cannot reference resources in the runtime environment.

Hello,

We have redirected your issue to our ESB experts and then come back to you as soon as we can.

Thank you for your time.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

An API-First Approach to Modernizing Applications

Learn how to use an API-First Approach to Modernize your Applications

Watch Now

Talend API Designer – Technical Overview

Take a look at this technical overview video of Talend API Designer

Watch Now

Getting Started with APIs

Find out how to get started with APIs

Read