KB-1083 "javax.naming.NameNotFoundException" thrown in reference to data sources during application server startup

Symptoms

When starting Appian, an error message can be seen in the logs where there seems to be an inconsistency in how a character has been typed in a configuration file and how it is read by the application server.

Examples are given below:

WebLogic

javax.naming.NameNotFoundException: While trying to lookup 'jdbc.AppianPrimaryDS' didn't find subcontext 'jdbc'. Resolved ''; remaining name 'jdbc/AppianPrimaryDS'

JBoss

javax.naming.NameNotFoundException: jdbc.AppianPrimaryDS -- service jboss.naming.context.java."jdbc.AppianPrimaryDS"

However, in both the above examples, jdbc.AppianPrimaryDS does not seem to be explicitly defined as such in any configuration file.

Cause

The application server is misreading a character in an expression defined in a configuration file. There are different possible reasons for the issue:

  1. A configuration file was modified in Windows (respectively Linux) and transferred to Linux (respectively Windows). Windows internally works with UTF-16 character encoding, whereas Unix-based systems make UTF-8 the default character encoding. Transferring text files between both systems without a common character encoding mechanism can lead to such issues.
  2. The character encoding for the configuration file in question is not set to UTF-8.
  3. The application server is set to a different encoding mechanism than UTF-8.
  4. The conf.data.APPIAN_DATA_SOURCE field in custom.properties located in <APPIAN_HOME>/ear/suite.ear/conf/ does not match the data source name provided in the Weblogic Admin Console.

Refer to UTF-8 for more information.

Action

  1. Locate configuration files mentioning the problematic string.
  2. Manually retype the string using the correct character encoding method. This step needs to be followed in the system where the configuration file is used.
  3. Save the configuration file in the system used for Appian.
  4. Ensure the conf.data.APPIAN_DATA_SOURCE field in custom.properties matches the data source name in the Weblogic Admin Console.

If the character encoding method for the configuration file is not UTF-8, set it to UTF-8.

By default, the application server should be set to UTF-8. If this isn't the case, set it to UTF-8. In order to do so, the following step configuration needs to be enabled depending on the application server used:

WebLogic

  1. Open the setDomainEnv.sh|bat file in a text editor; it can be found under:
    <WEBLOGIC_HOME>\user_projects\domains\base_domain\bin\
  2. Under JAVA_Properties, verify that -Dfile.encoding=UTF-8 is included.

JBoss

  1. Open the standalone.conf|conf.bat file in a text editor; it can be found under:
    <JBOSS_HOME>\bin\
  2. Verify that "URI_ENC=-Dorg.apache.catalina.connector.URI_ENCODING=UTF-8" is present.

Affected Versions

This article applies to all versions of Appian.

Last Reviewed: July 2017

Related
Recommended