<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Can't load Spring context in Talend ESB Runtime in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Can-t-load-Spring-context-in-Talend-ESB-Runtime/m-p/2263701#M43775</link>
    <description>&lt;B&gt;&lt;U&gt;What I am doing&lt;/U&gt;&lt;/B&gt;: I'm using an external JAR library made with 
&lt;B&gt;Spring&lt;/B&gt;, through a 
&lt;B&gt;tJavaFlex &lt;/B&gt;component. I've created a 
&lt;B&gt;Routine &lt;/B&gt;with my own method and library that is loading my application context this way: 
&lt;BR /&gt; 
&lt;PRE&gt;public String customMethod(){&lt;BR /&gt;	ApplicationContext ap = new ClassPathXmlApplicationContext("classpath:/META-INF/spring/application-context.xml");&lt;BR /&gt;	CustomInterface test = (CustomInterface) ap.getBean("customClass");&lt;BR /&gt;	&lt;BR /&gt;	return test.businessMethod();&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt;My 
&lt;B&gt;application-context.xm&lt;/B&gt;l looks like this one: 
&lt;BR /&gt; 
&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;BR /&gt;&amp;lt;beans xmlns=""&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlns:xsi="" &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlns:context=""&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlns:mvc=""&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; xsi:schemaLocation=" &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  "&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp;&amp;lt;!-- Spring IoC Context --&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp;&amp;lt;context:component-scan base-package="com.test" /&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp;&amp;lt;import resource="root-config.xml" /&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp;&amp;lt;import resource="classpath:/root-context.xml" /&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp;&amp;lt;!-- Enables the Spring MVC @Controller programming model --&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp;&amp;lt;mvc:annotation-driven /&amp;gt;&lt;BR /&gt;&amp;lt;/beans&amp;gt;&lt;/PRE&gt; 
&lt;BR /&gt;the tJavaFlex component is inside a Job that is called from a Route. 
&lt;BR /&gt;If I run this on my Talend Open Studio ESB it 
&lt;B&gt;works&lt;/B&gt;. 
&lt;BR /&gt; 
&lt;B&gt;&lt;U&gt;My problem&lt;/U&gt;&lt;/B&gt;: from the mediation perspective, I right-click on my route and build it, so I can deploy inside my Runtimefolder/container/deploy. 
&lt;BR /&gt;But when I use my route from my container it doesn't work! It looks like it can't load the application-context.xml file, giving me an exception like it can't find a bean named "customClass". 
&lt;BR /&gt;Is it because the "classpath" is differend in the built kar file? How can I fix this?</description>
    <pubDate>Sat, 16 Nov 2024 11:19:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T11:19:50Z</dc:date>
    <item>
      <title>Can't load Spring context in Talend ESB Runtime</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Can-t-load-Spring-context-in-Talend-ESB-Runtime/m-p/2263701#M43775</link>
      <description>&lt;B&gt;&lt;U&gt;What I am doing&lt;/U&gt;&lt;/B&gt;: I'm using an external JAR library made with 
&lt;B&gt;Spring&lt;/B&gt;, through a 
&lt;B&gt;tJavaFlex &lt;/B&gt;component. I've created a 
&lt;B&gt;Routine &lt;/B&gt;with my own method and library that is loading my application context this way: 
&lt;BR /&gt; 
&lt;PRE&gt;public String customMethod(){&lt;BR /&gt;	ApplicationContext ap = new ClassPathXmlApplicationContext("classpath:/META-INF/spring/application-context.xml");&lt;BR /&gt;	CustomInterface test = (CustomInterface) ap.getBean("customClass");&lt;BR /&gt;	&lt;BR /&gt;	return test.businessMethod();&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt;My 
&lt;B&gt;application-context.xm&lt;/B&gt;l looks like this one: 
&lt;BR /&gt; 
&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;BR /&gt;&amp;lt;beans xmlns=""&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlns:xsi="" &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlns:context=""&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; xmlns:mvc=""&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; xsi:schemaLocation=" &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  "&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp;&amp;lt;!-- Spring IoC Context --&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp;&amp;lt;context:component-scan base-package="com.test" /&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp;&amp;lt;import resource="root-config.xml" /&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp;&amp;lt;import resource="classpath:/root-context.xml" /&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp;&amp;lt;!-- Enables the Spring MVC @Controller programming model --&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp;&amp;lt;mvc:annotation-driven /&amp;gt;&lt;BR /&gt;&amp;lt;/beans&amp;gt;&lt;/PRE&gt; 
&lt;BR /&gt;the tJavaFlex component is inside a Job that is called from a Route. 
&lt;BR /&gt;If I run this on my Talend Open Studio ESB it 
&lt;B&gt;works&lt;/B&gt;. 
&lt;BR /&gt; 
&lt;B&gt;&lt;U&gt;My problem&lt;/U&gt;&lt;/B&gt;: from the mediation perspective, I right-click on my route and build it, so I can deploy inside my Runtimefolder/container/deploy. 
&lt;BR /&gt;But when I use my route from my container it doesn't work! It looks like it can't load the application-context.xml file, giving me an exception like it can't find a bean named "customClass". 
&lt;BR /&gt;Is it because the "classpath" is differend in the built kar file? How can I fix this?</description>
      <pubDate>Sat, 16 Nov 2024 11:19:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Can-t-load-Spring-context-in-Talend-ESB-Runtime/m-p/2263701#M43775</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T11:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can't load Spring context in Talend ESB Runtime</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Can-t-load-Spring-context-in-Talend-ESB-Runtime/m-p/2263702#M43776</link>
      <description>Route already contains own Spring config (Spring view at Mediation perspective). You can extend it as you wish.</description>
      <pubDate>Tue, 03 Feb 2015 06:32:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Can-t-load-Spring-context-in-Talend-ESB-Runtime/m-p/2263702#M43776</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-03T06:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can't load Spring context in Talend ESB Runtime</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Can-t-load-Spring-context-in-Talend-ESB-Runtime/m-p/2263703#M43777</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Route already contains own Spring config (Spring view at Mediation perspective). You can extend it as you wish.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;I'm using a Routine not a Route...</description>
      <pubDate>Tue, 03 Feb 2015 07:55:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Can-t-load-Spring-context-in-Talend-ESB-Runtime/m-p/2263703#M43777</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-03T07:55:59Z</dc:date>
    </item>
  </channel>
</rss>

