One Star

Import Package into Talend Medation Route

I'm currently trying to import another package that I have exported within my karaf runtime.
I want to make a method call from the other package that will return some data.
I know the package has been exported because when I use 'packages:exports' in karaf I can see the package, but when I try to import it into my bean I get an error saying "the import com.sample cannot be resolved" from within my bean.
Any ideas would be greatly appreciated.
3 REPLIES
Moderator

Re: Import Package into Talend Medation Route

Hi,
Could you please indicate the talend esb product build version you're using?
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.
One Star

Re: Import Package into Talend Medation Route

Hi Sabrina,
I'm using Talend 5.4.1 Open Studio
One Star

Re: Import Package into Talend Medation Route

I found the solution to this if anyone is interested.
What I had to do was edit the route Manifest file to import the package that was being exported in the OSGi container.
After that I had to reference the service through the Spring DM editor within the Studio.
I changed the namespace to look as follows.
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:context="http://www.springframework.org/schema/context"
xmlnsSmiley Surprisedsgi="http://www.springframework.org/schema/osgi"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring- beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
After that I could reference the service through the tag
<osgi:reference id="myUDPService" interface="com.myosgi.UDPService"/>
Once I had done this I just dropped a cBean, and referenced the bean through the Id "myUDPService", selected the method and was set to go!