Resolve common issues with your APIs.
This article identifies the following issues that you might encounter and how to resolve them:
Layer7 Live API Creatoris not working properly, you can:
- View the logs.For more information about how to view the logs, see View Logging Information.
- View the logs for the container, such as Apache Tomcat or Jetty.
- (If the problem is client-only) Debug the issue that is with the web browser.
For more information about how to resolve known error conditions, see Error Codes.
General Connection Issues
Contact CA Support to troubleshoot your connection issues. Include the following information:
- The main container log (catalina.outfor Tomcat, console output for the single-user version ofLayer7 Live API Creator).
- The steps that you used to connect to the database.
- An export of the database, if possible.
You can encounter firewalls issues, particularly in large organizations. Verify that you can connect to the database from the machine hosting
Layer7 Live API Creatorusing SQL Tools (for example, Toad, DbVisualizer, Razor, MySQL Workbench, and Microsoft SQL Server Management Studio).
MySQL SSL Exception
Recent versions of MySQL might require that you connect to a MySQL database using Secure Sockets Layer (SSL). The following error message indicates this requirement:
javax.net.ssl.SSLException: Unsupported record version Unknown-0.0
To avoid this error, add the following to the database URL (the
URLfield for the data source connection):
For more information about this field, see Database Connectivity.
Database Connects But No Tables - Ensure Active
Layer7 Live API Creatorretrieves schema information only from active data sources.
Layer7 Live API Creatorreads the metadata from the database schema or catalog. These metadata values must be correct for the connection to succeed and the tables to be populated.
For more information about how to mark a data source as active, see Database Connectivity.
Calling PostgreSQL Functions
Layer7 Live API Creatordoes not expose PostgreSQL functions as REST endpoints. This is a PostgreSQL JDBC driver limitation. The driver exposes inadequate information about the parameter datatypes to
Layer7 Live API Creator.
External RESTFul Calls
If you are having issues invoking APIs from other servers, verify your URL and headers using REST tools, such as Postman or cURL.
For more information about how to debug using the
rest<verb>, see The SysUtility Object.
API Server caches schemas in the admin repository. A full load is required only initially, or when you refresh the schema. For large schemas, the time it takes for the initial load might exceed the web browser time-out time. In this case, an error appears, but API Server continues the load process.
Reload API Creator in your web browser, which loads the schema.
If you continue to have issues, contact Support.
Authentication Provider Not Set After you Import the API
API Creator does not store custom authentication providers in the
.jsonfile when you export your API. Specify the custom authentication provider as the authentication provider for your API after you import your API.
For more information:
- About how to specify the authentication provider for your API, see API Properties.
- About how to import and export APIs, see Import and Export APIs.
Named Filters gives SQL Error
The use of named filters allows creation of named parameter values to be used in place of column attributes. However, each database has its own rules on how to handle mixed case and quotes. Ensure that the column attribute names are in single quotes ('name'), double quotes ("name"), or back-ticks (`name`) based on Derby, MySQL, and Oracle requirements.
Connect to Large Schemas
For schemas that are more than several 100 tables, you might run into browser time-outs and heap errors. Browser timeouts reflect that the time to load the schema exceeded the browser timeout. To correct this issue, log in to API Creator again.
For heap errors, increase the heap size that is provided to the API Server. For example, in the single-user demonstration package of
Layer7 Live API Creatorthat is based on Jetty, the Start command file (
.bat) includes the following command:
java -DSTOP.PORT=8123 -DSTOP.KEY=stop_caliveapicreator -jar ../start.jar $1 $2 $3 $4 $5 $6 $7 $8 $9
Change the command file to:
java-Xmx1024m-DSTOP.PORT=8123 <<< etc >>>
For more information about the default heap size, see Installation Requirements and Supported Platforms.
Run on JDK 9 and Later
You can run
Layer7 Live API Creatoron JDK 9 and later by passing the following option to the JVM:
For instance, if you use Tomcat, you can set the following environment variable before starting API Server:
export CATALINA_OPTS="--add-modules java.xml.bind
API Creator is Unresponsive
You can log in to API Creator, but then it becomes unresponsive. You might encounter this issue if you are running on an Amazon Linux instance. This issue is caused by the server name (as returned by the
hostnamecommand) not resolving properly to an IP address. This triggers a known bug in some versions of Java, or possibly Linux kernel, which causes
For more information about this bug, see the question Java DNS resolution hangs forever in StackOverflow.
You can fix this issue using the following methods:
- Use the following option on the Java command line when you start API Server:java -Djava.net.preferIPv4Stack=true ...
- Put the host name (as determined by thehostnamecommand) in the/etc/hostsfile, for example:127.0.0.1 localhost ip-12-34-56-78::1 localhost ip-12-34-56-78
If your machine does not have a fixed IP address, these methods are not a long-term solution.
Use one of the available methods to resolving this issue. Some methods require expertise in Unix networking.
Monitor API Server Availability
You can check the health of your API Server and its availability using the
@heartbeatsystem REST endpoint. This endpoint retrieves API Server status.
For more information about this endpoint, see System REST Endpoints.
Layer7 Live API CreatorDeletes new APIs and Other Changes on Shutdown
Run only one copy of
Layer7 Live API Creatorin the same Java container (for example, Jetty or Tomcat) and only one Java container pointing to the same admin repository. For example, if you are running on Tomcat, ensure that only one copy of
Layer7 Live API Creatoris in the
webappsdirectory. Having more than one copy can result in
Layer7 Live API Creatordeleting the APIs that you create and your other changes in the admin repository since starting your Java container when you shut down the Java container.
Data Explorer Does Not Show Tables
Ensure that you have logged on to API Creator as a user with at least one assigned role and the role has at least one table with read access. If you have changed your URL fragment or your API name, clear the internal API cache by switching to another API.
Follow these steps:
- In API Creator, on the APIs page, select a different API.
- Repeat the process selecting your original API.
Layer7 Live API Creatorrebuilds the new URL endpoints.
Data Explorer Does Not Load Tables and Display Data
If you change the value of the
Metadata namefield on the Settings tab in API Creator, Data Explorer does not load tables and display data.
For more information about this setting, see API Properties.
Swagger Documentation Not Showing After Import
API Creator includes the API Documentation role. You must be assigned this role, with access to read, insert, update, and delete. You can also allow the discovery of the API Swagger doc without authentication.
For more information about how to allow the discovery of the API Swagger doc without authentication, see API Properties.
Authentication Provider - Cannot Find Custom JS Library for Create Function
Follow these steps:
Allow Slash in Primary Key for Tomcat Installations
If you are running
Layer7 Live API Creatoron Tomcat, and you have a slash in your primary key,
Layer7 Live API Creatorreturns an error saying it cannot find the row. The Tomcat server attempts to decode the "/" before sending on to
Layer7 Live API Creator.
For example, your key is
P5/P5Aand the href URL appears as (encoded):
You can enable Tomcat to accept encoded path separators, such as a slash in the primary key. Change the
CATALINA_OPTSenvironment variable. Add the following to the JVM args of the system (setenv):
Update Amazon EBS - Apache Proxy Server in the AWS Beanstalk Instance
Follow these steps:
- SSH into the machine.
- Issue the following command:cd /etc/httpd/conf.d
- Edit theelasticbeanstalk.conffile to have the following data: (Overwrite the file)
- Change the Tomcat config to allow encoded slashes (/usr/share/tomcat8/conf/tomcat8.conf):export CATALINA_OPTS="$CATALINA_OPTS -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true
- Restart Tomcat and Apache HTTP Server (httpd):sudoservice <servicename> restart
The Apache service can take a minute or two to be up.
Import API with Null Password Can Cause Database Issues
Migrating APIs from a previous version of
Layer7 Live API Creatorcan cause issues with some databases. These databases attempt to connect, fail, and then lock out the connection. To solve this, export your API and mark your data source to inactive. Because
Layer7 Live API Creatordoes not export the password, when you import the API (the JSON file), you can then enter the password, test the connection, and then activate your data source.
For more information:
Resource Properties not Visible
Resource properties are not visible if your web browser is set to auto-fill values. API Creator disables this functionality, though certain browsers ignore the disabling. Correct the browser from ignoring the disabling.
For more information about how to disable autofill in the Google Chrome web browser, see Google Chrome help.
For more information about how to disable autofill in the Sarari web browser, see Apple Safari help.
The following issue is caused by passing a string instead of an object (or vice versa):
caused by: java.lang.ClassCastException: Cannot cast java.lang.String tojdk.nashorn.api.scripting.ScriptObjectMirror
To solve this issue, you can do one of the following:
- Convert a JSON string to an object using theJSON.parse()method.
- Convert an object to a JSON string using theJSON.stringify()method.