<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>KB-1236 Custom expression functions cannot access Admin Console data sources</title><link>https://community.appian.com/support/w/kb/451/kb-1236-custom-expression-functions-cannot-access-admin-console-data-sources</link><description /><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>KB-1236 Custom expression functions cannot access Admin Console data sources</title><link>https://community.appian.com/support/w/kb/451/kb-1236-custom-expression-functions-cannot-access-admin-console-data-sources</link><pubDate>Mon, 23 Jul 2018 03:51:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3352f94e-5879-45e1-b432-e74e602dc336</guid><dc:creator>Parmida Borhani</dc:creator><comments>https://community.appian.com/support/w/kb/451/kb-1236-custom-expression-functions-cannot-access-admin-console-data-sources#comments</comments><description>Current Revision posted to Appian Knowledge Base by Parmida Borhani on 7/23/2018 3:51:17 AM&lt;br /&gt;
&lt;div class="row content_container"&gt;
&lt;h2 id="symptoms"&gt;Symptoms&lt;/h2&gt;
&lt;p&gt;Custom plugin functions are not able to access data sources configured through the Admin Console. A NameNotfoundException error will be visible in the application server log in conjuction with an error for the custom function being used.&lt;/p&gt;
&lt;p&gt;For example, when using the &lt;code&gt;ExecuteStoredProcedure&lt;/code&gt; function, an error similar to what is shown below will be logged:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ERROR com.appiancorp.ps.function.ExecuteStoredProcedureFunction - Error executing: 
javax.naming.NameNotFoundException: jdbc/AppianDS
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="cause"&gt;Cause&lt;/h2&gt;
&lt;p&gt;Custom plugin functions currently do not have the ability to inject the initial context needed to utilize the application server connection pooling and communicate with the data sources configured through the Admin Console when using&amp;nbsp;&lt;code&gt;new InitialContext()&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="action"&gt;Action&lt;/h2&gt;
&lt;p&gt;In the custom plugin, use&amp;nbsp;&lt;code&gt;javax.naming.Context&lt;/code&gt; instead.&lt;/p&gt;
&lt;h2&gt;Workaround&lt;/h2&gt;
&lt;p&gt;Configure the data sources using the traditional method found in &lt;a href="https://docs.appian.com/suite/help/latest/Configuring_Relational_Databases.html"&gt;Configuring Relational Databases&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="affected-versions"&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to Appian 16.1 and later.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Last Reviewed:&amp;nbsp;March 2017&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: administration, database, application server, admin console, infrastructure, plugins&lt;/div&gt;
</description></item><item><title>KB-1236 Custom expression functions cannot access Admin Console data sources</title><link>https://community.appian.com/support/w/kb/451/kb-1236-custom-expression-functions-cannot-access-admin-console-data-sources/revision/1</link><pubDate>Mon, 06 Mar 2017 22:11:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3352f94e-5879-45e1-b432-e74e602dc336</guid><dc:creator>Nick Vigilante</dc:creator><comments>https://community.appian.com/support/w/kb/451/kb-1236-custom-expression-functions-cannot-access-admin-console-data-sources#comments</comments><description>Revision 1 posted to Appian Knowledge Base by Nick Vigilante on 3/6/2017 10:11:12 PM&lt;br /&gt;
&lt;div class="row content_container"&gt;
&lt;h2 id="symptoms"&gt;Symptoms&lt;/h2&gt;
&lt;p&gt;Custom plugin functions are not able to access data sources configured through the Admin Console. A NameNotfoundException error will be visible in the application server log in conjuction with an error for the custom function being used.&lt;/p&gt;
&lt;p&gt;For example, when using the &lt;code&gt;ExecuteStoredProcedure&lt;/code&gt; function, an error similar to what is shown below will be logged:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ERROR com.appiancorp.ps.function.ExecuteStoredProcedureFunction - Error executing: 
javax.naming.NameNotFoundException: jdbc/AppianDS
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id="cause"&gt;Cause&lt;/h2&gt;
&lt;p&gt;Custom plugin functions currently do not have the ability to inject the initial context needed to utilize the application server connection pooling and communicate with the data sources configured through the Admin Console when using&amp;nbsp;&lt;code&gt;new InitialContext()&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="action"&gt;Action&lt;/h2&gt;
&lt;p&gt;In the custom plugin, use&amp;nbsp;&lt;code&gt;javax.naming.Context&lt;/code&gt; instead.&lt;/p&gt;
&lt;h2&gt;Workaround&lt;/h2&gt;
&lt;p&gt;Configure the data sources using the traditional method found in &lt;a href="https://docs.appian.com/suite/help/latest/Configuring_Relational_Databases.html"&gt;Configuring Relational Databases&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="affected-versions"&gt;Affected Versions&lt;/h2&gt;
&lt;p&gt;This article applies to Appian 16.1 and later.&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Last Reviewed:&amp;nbsp;March 2017&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: database, application server, admin console, plugins&lt;/div&gt;
</description></item></channel></rss>