<?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 The import org.apache cannot be resolved in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/The-import-org-apache-cannot-be-resolved/m-p/2371988#M134869</link>
    <description>Hi all, 
&lt;BR /&gt;I've created a custom Talend component, which at certain step connects to an external Http service. For that, I'm using 
&lt;BR /&gt; 
&lt;PRE&gt;org.apache.commons.httpclient&lt;/PRE&gt; 
&lt;BR /&gt; through javajet imports. I've seen the modules already exist in the Modules view. Nevertheless, when running a job the console outputs: 
&lt;BR /&gt; 
&lt;PRE&gt;Execution failed : Failed to generate code.&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt; 
&lt;BR /&gt;This is my begin code: 
&lt;BR /&gt; 
&lt;PRE&gt;&amp;lt;%@ jet &lt;BR /&gt; &amp;nbsp; &amp;nbsp;imports="&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.talend.core.model.process.INode &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.talend.core.model.process.ElementParameterParser &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.talend.core.model.metadata.IMetadataTable &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.talend.core.model.metadata.IMetadataColumn &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.talend.core.model.process.IConnection&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.talend.core.model.process.IConnectionCategory&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.talend.designer.codegen.config.CodeGeneratorArgument&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.talend.core.model.metadata.types.JavaTypesManager&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.talend.core.model.metadata.types.JavaType&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;java.util.List&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;java.util.Map&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.apache.commons.httpclient.*&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.apache.commons.httpclient.methods.*&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.apache.commons.httpclient.params.HttpMethodParams&lt;BR /&gt; &amp;nbsp; &amp;nbsp;" &lt;BR /&gt;%&amp;gt;&lt;BR /&gt;&amp;lt;% &lt;BR /&gt; &amp;nbsp; &amp;nbsp;// Get the CID&lt;BR /&gt; &amp;nbsp; &amp;nbsp;CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;&lt;BR /&gt; &amp;nbsp; &amp;nbsp;INode node = (INode)codeGenArgument.getArgument();&lt;BR /&gt; &amp;nbsp; &amp;nbsp;String cid = node.getUniqueName();&lt;BR /&gt; &amp;nbsp; &amp;nbsp;// Get the component parameters&lt;BR /&gt; &amp;nbsp; &amp;nbsp;String orionEndpoint = ElementParameterParser.getValue(node, "__ORION_ENDPOINT__");&lt;BR /&gt; &amp;nbsp; &amp;nbsp;String authEndpoint = ElementParameterParser.getValue(node, "__AUTH_ENDPOINT__");&lt;BR /&gt; &amp;nbsp; &amp;nbsp;String authUsername = ElementParameterParser.getValue(node, "__AUTH_USERNAME__");&lt;BR /&gt; &amp;nbsp; &amp;nbsp;String authPassword = ElementParameterParser.getValue(node, "__AUTH_PASSWORD__");&lt;BR /&gt; &amp;nbsp; &amp;nbsp;String entityIdField = ElementParameterParser.getValue(node, "__ENTITY_ID_FIELD__");&lt;BR /&gt; &amp;nbsp; &amp;nbsp;String entityTypeField = ElementParameterParser.getValue(node, "__ENTITY_TYPE_FIELD__");&lt;BR /&gt; &amp;nbsp; &amp;nbsp;String defaultEntityType = ElementParameterParser.getValue(node, "__DEFAULT_ENTITY_TYPE__");&lt;BR /&gt; &amp;nbsp; &amp;nbsp;String ignoredFilds = ElementParameterParser.getValue(node, "__IGNORED_FIELDS__");&lt;BR /&gt;%&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp;System.out.println("I am the begin section");&lt;BR /&gt; &amp;nbsp; &amp;nbsp;HttpClient client = new HttpClient();&lt;BR /&gt; &amp;nbsp; &amp;nbsp;PostMethod method = new PostMethod(&amp;lt;%=authEndpoint%&amp;gt;);&lt;BR /&gt; &amp;nbsp; &amp;nbsp;method.setRequestHeader(new Header("Content-Type", "application/json"));&lt;BR /&gt; &amp;nbsp; &amp;nbsp;method.setRequestBody("{\"username\":\"" + &amp;lt;%=authUsername%&amp;gt; + "\",\"password\":\"" + &amp;lt;%=authPassword%&amp;gt; + "\"}");&lt;BR /&gt; &amp;nbsp; &amp;nbsp;try {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int statusCode = client.executeMethod(method);&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (statusCode != HttpStatus.SC_OK) {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.err.println("Method failed: " + method.getStatusLine());&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} // if&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;byte[] responseBody = method.getResponseBody();&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(new String(responseBody));&lt;BR /&gt; &amp;nbsp; &amp;nbsp;} catch (HttpException e) {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.err.println("Fatal protocol violation: " + e.getMessage());&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.printStackTrace();&lt;BR /&gt; &amp;nbsp; &amp;nbsp;} catch (IOException e) {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.err.println("Fatal transport error: " + e.getMessage());&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.printStackTrace();&lt;BR /&gt; &amp;nbsp; &amp;nbsp;} finally {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;method.releaseConnection();&lt;BR /&gt; &amp;nbsp; &amp;nbsp;} // try&lt;BR /&gt;&lt;/PRE&gt; 
&lt;BR /&gt;And this is my imports secton in the Component Descriptor file: 
&lt;BR /&gt; 
&lt;PRE&gt;&amp;lt;IMPORTS&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;lt;IMPORTS&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;IMPORT&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NAME="commons-httpclient"&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MODULE="commons-httpclient-3.1.jar"&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;REQUIRED="true"&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;/&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;lt;/IMPORTS&amp;gt;&lt;BR /&gt;&lt;/PRE&gt; 
&lt;BR /&gt;In the modules view I'm able to see the following: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MELn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128722i93DD85D7F58E4397/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MELn.png" alt="0683p000009MELn.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Any hints about how to fix this issue? My Talend version is 6.2.0.</description>
    <pubDate>Sat, 16 Nov 2024 10:34:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T10:34:23Z</dc:date>
    <item>
      <title>The import org.apache cannot be resolved</title>
      <link>https://community.qlik.com/t5/Talend-Studio/The-import-org-apache-cannot-be-resolved/m-p/2371988#M134869</link>
      <description>Hi all, 
&lt;BR /&gt;I've created a custom Talend component, which at certain step connects to an external Http service. For that, I'm using 
&lt;BR /&gt; 
&lt;PRE&gt;org.apache.commons.httpclient&lt;/PRE&gt; 
&lt;BR /&gt; through javajet imports. I've seen the modules already exist in the Modules view. Nevertheless, when running a job the console outputs: 
&lt;BR /&gt; 
&lt;PRE&gt;Execution failed : Failed to generate code.&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt; 
&lt;BR /&gt;This is my begin code: 
&lt;BR /&gt; 
&lt;PRE&gt;&amp;lt;%@ jet &lt;BR /&gt; &amp;nbsp; &amp;nbsp;imports="&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.talend.core.model.process.INode &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.talend.core.model.process.ElementParameterParser &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.talend.core.model.metadata.IMetadataTable &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.talend.core.model.metadata.IMetadataColumn &lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.talend.core.model.process.IConnection&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.talend.core.model.process.IConnectionCategory&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.talend.designer.codegen.config.CodeGeneratorArgument&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.talend.core.model.metadata.types.JavaTypesManager&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.talend.core.model.metadata.types.JavaType&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;java.util.List&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;java.util.Map&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.apache.commons.httpclient.*&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.apache.commons.httpclient.methods.*&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;org.apache.commons.httpclient.params.HttpMethodParams&lt;BR /&gt; &amp;nbsp; &amp;nbsp;" &lt;BR /&gt;%&amp;gt;&lt;BR /&gt;&amp;lt;% &lt;BR /&gt; &amp;nbsp; &amp;nbsp;// Get the CID&lt;BR /&gt; &amp;nbsp; &amp;nbsp;CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;&lt;BR /&gt; &amp;nbsp; &amp;nbsp;INode node = (INode)codeGenArgument.getArgument();&lt;BR /&gt; &amp;nbsp; &amp;nbsp;String cid = node.getUniqueName();&lt;BR /&gt; &amp;nbsp; &amp;nbsp;// Get the component parameters&lt;BR /&gt; &amp;nbsp; &amp;nbsp;String orionEndpoint = ElementParameterParser.getValue(node, "__ORION_ENDPOINT__");&lt;BR /&gt; &amp;nbsp; &amp;nbsp;String authEndpoint = ElementParameterParser.getValue(node, "__AUTH_ENDPOINT__");&lt;BR /&gt; &amp;nbsp; &amp;nbsp;String authUsername = ElementParameterParser.getValue(node, "__AUTH_USERNAME__");&lt;BR /&gt; &amp;nbsp; &amp;nbsp;String authPassword = ElementParameterParser.getValue(node, "__AUTH_PASSWORD__");&lt;BR /&gt; &amp;nbsp; &amp;nbsp;String entityIdField = ElementParameterParser.getValue(node, "__ENTITY_ID_FIELD__");&lt;BR /&gt; &amp;nbsp; &amp;nbsp;String entityTypeField = ElementParameterParser.getValue(node, "__ENTITY_TYPE_FIELD__");&lt;BR /&gt; &amp;nbsp; &amp;nbsp;String defaultEntityType = ElementParameterParser.getValue(node, "__DEFAULT_ENTITY_TYPE__");&lt;BR /&gt; &amp;nbsp; &amp;nbsp;String ignoredFilds = ElementParameterParser.getValue(node, "__IGNORED_FIELDS__");&lt;BR /&gt;%&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp;System.out.println("I am the begin section");&lt;BR /&gt; &amp;nbsp; &amp;nbsp;HttpClient client = new HttpClient();&lt;BR /&gt; &amp;nbsp; &amp;nbsp;PostMethod method = new PostMethod(&amp;lt;%=authEndpoint%&amp;gt;);&lt;BR /&gt; &amp;nbsp; &amp;nbsp;method.setRequestHeader(new Header("Content-Type", "application/json"));&lt;BR /&gt; &amp;nbsp; &amp;nbsp;method.setRequestBody("{\"username\":\"" + &amp;lt;%=authUsername%&amp;gt; + "\",\"password\":\"" + &amp;lt;%=authPassword%&amp;gt; + "\"}");&lt;BR /&gt; &amp;nbsp; &amp;nbsp;try {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;int statusCode = client.executeMethod(method);&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (statusCode != HttpStatus.SC_OK) {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.err.println("Method failed: " + method.getStatusLine());&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} // if&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;byte[] responseBody = method.getResponseBody();&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(new String(responseBody));&lt;BR /&gt; &amp;nbsp; &amp;nbsp;} catch (HttpException e) {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.err.println("Fatal protocol violation: " + e.getMessage());&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.printStackTrace();&lt;BR /&gt; &amp;nbsp; &amp;nbsp;} catch (IOException e) {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.err.println("Fatal transport error: " + e.getMessage());&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;e.printStackTrace();&lt;BR /&gt; &amp;nbsp; &amp;nbsp;} finally {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;method.releaseConnection();&lt;BR /&gt; &amp;nbsp; &amp;nbsp;} // try&lt;BR /&gt;&lt;/PRE&gt; 
&lt;BR /&gt;And this is my imports secton in the Component Descriptor file: 
&lt;BR /&gt; 
&lt;PRE&gt;&amp;lt;IMPORTS&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;lt;IMPORTS&amp;gt;&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;IMPORT&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NAME="commons-httpclient"&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MODULE="commons-httpclient-3.1.jar"&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;REQUIRED="true"&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;/&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;lt;/IMPORTS&amp;gt;&lt;BR /&gt;&lt;/PRE&gt; 
&lt;BR /&gt;In the modules view I'm able to see the following: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MELn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128722i93DD85D7F58E4397/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MELn.png" alt="0683p000009MELn.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Any hints about how to fix this issue? My Talend version is 6.2.0.</description>
      <pubDate>Sat, 16 Nov 2024 10:34:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/The-import-org-apache-cannot-be-resolved/m-p/2371988#M134869</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T10:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: The import org.apache cannot be resolved</title>
      <link>https://community.qlik.com/t5/Talend-Studio/The-import-org-apache-cannot-be-resolved/m-p/2371989#M134870</link>
      <description>Have you put the&amp;nbsp; 
&lt;FONT size="3"&gt;&lt;FONT face="consolas, monaco, 'bitstream vera sans mono', 'courier new', courier, monospace"&gt;commons-httpclient-3.1.jar file in your custom component folder?&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT face="consolas, monaco, bitstream vera sans mono, courier new, courier, monospace"&gt;&lt;FONT size="3"&gt;Regards&lt;/FONT&gt;&lt;/FONT&gt; 
&lt;BR /&gt; 
&lt;FONT face="consolas, monaco, bitstream vera sans mono, courier new, courier, monospace"&gt;&lt;FONT size="3"&gt;Shong&lt;/FONT&gt;&lt;/FONT&gt;</description>
      <pubDate>Fri, 08 Jul 2016 09:16:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/The-import-org-apache-cannot-be-resolved/m-p/2371989#M134870</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-08T09:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: The import org.apache cannot be resolved</title>
      <link>https://community.qlik.com/t5/Talend-Studio/The-import-org-apache-cannot-be-resolved/m-p/2371990#M134871</link>
      <description>Here I simply did restart the IDE and my custom component recognized the importation.</description>
      <pubDate>Thu, 23 Mar 2017 13:55:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/The-import-org-apache-cannot-be-resolved/m-p/2371990#M134871</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-23T13:55:14Z</dc:date>
    </item>
  </channel>
</rss>

