<?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 Re: I'm having an issue with an external library (oauth2-platform-api-6.2.4.jar) in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/I-m-having-an-issue-with-an-external-library-oauth2-platform-api/m-p/2361842#M126111</link>
    <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;Using a tLibraryLoad component to load external jar in the beginning of job or create a user routine to implement your code, import external jar to your user routine. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
    <pubDate>Sat, 14 Oct 2023 18:01:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-10-14T18:01:16Z</dc:date>
    <item>
      <title>I'm having an issue with an external library (oauth2-platform-api-6.2.4.jar)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/I-m-having-an-issue-with-an-external-library-oauth2-platform-api/m-p/2361841#M126110</link>
      <description>&lt;P&gt;I have a strange issue that may be related to how I am importing an external library. I went to the Modules tab and clicked on the "import External Jars" icon, and selected my jar. In this case oauth2-platform-api-6.2.4.jar. &lt;/P&gt;&lt;P&gt;I created a tjava component with the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;//Prepare the config&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;OAuth2Config oauth2Config = new OAuth2Config.OAuth2ConfigBuilder(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;context.clientId,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;context.clientSecret&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;) // set client id and secret&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.callDiscoveryAPI(Environment.SANDBOX) // call discovery API to populate urls&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.buildConfig();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;//Generate the CSRF token&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;String csrf = oauth2Config.generateCSRFToken();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;//Prepare scopes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;List&amp;lt;Scope&amp;gt; scopes = new ArrayList&amp;lt;Scope&amp;gt;();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;//scopes.add(Scope.OpenIdAll);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;scopes.add(Scope.Accounting); // add as needed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;//Get the authorization URL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;String url = oauth2Config.prepareUrl(scopes, context.callbackUrl, csrf); //redirectUri - pass the callback url&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;System.out.println(url);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and in the includes I have:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;import java.util.ArrayList;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;import java.util.List;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;import com.intuit.oauth2.config.Environment;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;import com.intuit.oauth2.config.OAuth2Config;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;import com.intuit.oauth2.config.Scope;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I run it normally I get a runtime error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;Starting job Authorization at 17:25 13/10/2023.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;[statistics] connecting to socket on port 3868&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;[statistics] connected&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Exception in thread "main" java.lang.NoClassDefFoundError: com/intuit/oauth2/config/OAuth2Config$OAuth2ConfigBuilder&lt;/P&gt;&lt;P&gt;	at quickbooks_api_base.authorization_0_1.Authorization.tJava_2Process(Authorization.java:1404)&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;	at quickbooks_api_base.authorization_0_1.Authorization.tFileInputDelimited_1Process(Authorization.java:1321)&lt;/P&gt;&lt;P&gt;	at quickbooks_api_base.authorization_0_1.Authorization.runJobInTOS(Authorization.java:2202)&lt;/P&gt;&lt;P&gt;	at quickbooks_api_base.authorization_0_1.Authorization.main(Authorization.java:1800)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;[statistics] disconnected&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;[statistics] disconnected&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Caused by: java.lang.ClassNotFoundException: com.intuit.oauth2.config.OAuth2Config$OAuth2ConfigBuilder&lt;/P&gt;&lt;P&gt;	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)&lt;/P&gt;&lt;P&gt;	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)&lt;/P&gt;&lt;P&gt;	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)&lt;/P&gt;&lt;P&gt;	... 4 more&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Job Authorization ended at 17:25 13/10/2023. [Exit code&amp;nbsp;= 1]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The context variables clientId, clientSecret, and callbackUrl contain oauth2 client_id, client_secret, and callback_url. This is for quickbooks, and the library came from intuit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The class that cannot be found is in the jar, I looked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is only at runtime that it can't be found. The compiler finds it just fine as no compile errors appear, and even stranger, if I run it in Java Debug, the code runs through normally (Traces Debug fails the same way that the normal run fails).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that I am missing a configuration or something somewhere.&lt;/P&gt;&lt;P&gt;One thing that is strange, I had to add a Maven config to Project Settings : Build-&amp;gt;Maven-&amp;gt;Default-&amp;gt;Project all the way at the bottom of the pom, immediately before &amp;lt;/project&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;dependencies&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;!-- &lt;A href="https://mvnrepository.com/artifact/com.intuit.quickbooks-online/oauth2-platform-api" alt="https://mvnrepository.com/artifact/com.intuit.quickbooks-online/oauth2-platform-api" target="_blank"&gt;https://mvnrepository.com/artifact/com.intuit.quickbooks-online/oauth2-platform-api&lt;/A&gt; --&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;dependency&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;groupId&amp;gt;com.intuit.quickbooks-online&amp;lt;/groupId&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;artifactId&amp;gt;oauth2-platform-api&amp;lt;/artifactId&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;version&amp;gt;6.2.4&amp;lt;/version&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/dependency&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/dependencies&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Without this, the code wouldn't even compile.&lt;/P&gt;&lt;P&gt;Is there any setting that I might be missing? or did I import the jar improperly?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 21:46:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/I-m-having-an-issue-with-an-external-library-oauth2-platform-api/m-p/2361841#M126110</guid>
      <dc:creator>MarkM1</dc:creator>
      <dc:date>2023-10-13T21:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: I'm having an issue with an external library (oauth2-platform-api-6.2.4.jar)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/I-m-having-an-issue-with-an-external-library-oauth2-platform-api/m-p/2361842#M126111</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;Using a tLibraryLoad component to load external jar in the beginning of job or create a user routine to implement your code, import external jar to your user routine. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
      <pubDate>Sat, 14 Oct 2023 18:01:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/I-m-having-an-issue-with-an-external-library-oauth2-platform-api/m-p/2361842#M126111</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-14T18:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: I'm having an issue with an external library (oauth2-platform-api-6.2.4.jar)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/I-m-having-an-issue-with-an-external-library-oauth2-platform-api/m-p/2361843#M126112</link>
      <description>&lt;P&gt;This worked, but I had to put in eleven tLibraryLoad components because it doesn't check dependencies. Is there a way to get Maven to load a library and it's dependencies?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 15:54:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/I-m-having-an-issue-with-an-external-library-oauth2-platform-api/m-p/2361843#M126112</guid>
      <dc:creator>MarkM1</dc:creator>
      <dc:date>2023-10-23T15:54:31Z</dc:date>
    </item>
  </channel>
</rss>

