You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When referencing in the backend base urls environment variables defined in envSettings.props file the following is raised during export.
2022-11-30 11:44:51,985 [APISpecificationFactory] DEBUG: Can't handle API specification with class: com.axway.apim.api.apiSpecification.Swagger2xSpecification
2022-11-30 11:44:52,021 [APIManagerAPIAdapter] ERROR: Error setting remote host for API based on backendBasePath: http://${env.HOSTNAME}:${env.PORT.TRAFFIC}/healthcheck
java.net.MalformedURLException: For input string: "${env.PORT.TRAFFIC}"
at java.net.URL.(URL.java:645)
at java.net.URL.(URL.java:508)
at java.net.URL.(URL.java:457)
at com.axway.apim.adapter.apis.APIManagerAPIAdapter.addRemoteHost(APIManagerAPIAdapter.java:303)
at com.axway.apim.adapter.apis.APIManagerAPIAdapter.getAPIs(APIManagerAPIAdapter.java:101)
at com.axway.apim.APIExportApp.execute(APIExportApp.java:212)
at com.axway.apim.APIExportApp.exportAPI(APIExportApp.java:87)
at com.axway.apim.APIExportApp.exportAPI(APIExportApp.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.axway.apim.cli.APIManagerCLI.run(APIManagerCLI.java:132)
at com.axway.apim.cli.APIManagerCLI.main(APIManagerCLI.java:76)
Caused by: java.lang.NumberFormatException: For input string: "${env.PORT.TRAFFIC}"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:569)
at java.lang.Integer.parseInt(Integer.java:615)
at java.net.URLStreamHandler.parseURL(URLStreamHandler.java:222)
at java.net.URL.(URL.java:640)
... 13 more
Steps to reproduce
Create a sample API or modify an api to have for the backend the "Base URL" to use environmentalized fields (being present/provided within ../groups/group-X/instance-Y/envSettings.props) :
Example Base URL: http://${env.HOSTNAME}:${env.PORT.TRAFFIC} , where env.HOSTNAME=IP_APIGW_HOST
Resource path: /resourcepath
Virtualized the api and within the Frontend definition, for Outbound section -->Backend you should have
Attempt the export ./apim.sh -h apigw -port 8075 -u user -p pass -s api get "testapi" -o json
Attached the relevant log output.
Remark: If I remove in the frontend definition for Outbound the port, "${env.PORT.TRAFFIC}", below error will not be present.
Could it be validation on the variable type (ex:integer as it's a port) but because it gets a string it raises this ?
Relevant log output
2022-11-30 16:05:07,204 [APIManagerAPIAdapter] ERROR: Error setting remote host for API based on backendBasePath: http://${env.HOSTNAME}:${env.PORT.TRAFFIC}
java.net.MalformedURLException: For input string: "${env.PORT.TRAFFIC}"
at java.net.URL.<init>(URL.java:645)
at java.net.URL.<init>(URL.java:508)
at java.net.URL.<init>(URL.java:457)
at com.axway.apim.adapter.apis.APIManagerAPIAdapter.addRemoteHost(APIManagerAPIAdapter.java:303)
at com.axway.apim.adapter.apis.APIManagerAPIAdapter.getAPIs(APIManagerAPIAdapter.java:101)
at com.axway.apim.APIExportApp.execute(APIExportApp.java:212)
at com.axway.apim.APIExportApp.exportAPI(APIExportApp.java:87)
at com.axway.apim.APIExportApp.exportAPI(APIExportApp.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.axway.apim.cli.APIManagerCLI.run(APIManagerCLI.java:132)
at com.axway.apim.cli.APIManagerCLI.main(APIManagerCLI.java:76)
Caused by: java.lang.NumberFormatException: For input string: "${env.PORT.TRAFFIC}"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:569)
at java.lang.Integer.parseInt(Integer.java:615)
at java.net.URLStreamHandler.parseURL(URLStreamHandler.java:222)
at java.net.URL.<init>(URL.java:640)
... 13 more
The text was updated successfully, but these errors were encountered:
APIM-CLI version
1.13.2
API-Management version
7.7.0.20211130
Bug description
When referencing in the backend base urls environment variables defined in envSettings.props file the following is raised during export.
2022-11-30 11:44:51,985 [APISpecificationFactory] DEBUG: Can't handle API specification with class: com.axway.apim.api.apiSpecification.Swagger2xSpecification
2022-11-30 11:44:52,021 [APIManagerAPIAdapter] ERROR: Error setting remote host for API based on backendBasePath: http://${env.HOSTNAME}:${env.PORT.TRAFFIC}/healthcheck
java.net.MalformedURLException: For input string: "${env.PORT.TRAFFIC}"
at java.net.URL.(URL.java:645)
at java.net.URL.(URL.java:508)
at java.net.URL.(URL.java:457)
at com.axway.apim.adapter.apis.APIManagerAPIAdapter.addRemoteHost(APIManagerAPIAdapter.java:303)
at com.axway.apim.adapter.apis.APIManagerAPIAdapter.getAPIs(APIManagerAPIAdapter.java:101)
at com.axway.apim.APIExportApp.execute(APIExportApp.java:212)
at com.axway.apim.APIExportApp.exportAPI(APIExportApp.java:87)
at com.axway.apim.APIExportApp.exportAPI(APIExportApp.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.axway.apim.cli.APIManagerCLI.run(APIManagerCLI.java:132)
at com.axway.apim.cli.APIManagerCLI.main(APIManagerCLI.java:76)
Caused by: java.lang.NumberFormatException: For input string: "${env.PORT.TRAFFIC}"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:569)
at java.lang.Integer.parseInt(Integer.java:615)
at java.net.URLStreamHandler.parseURL(URLStreamHandler.java:222)
at java.net.URL.(URL.java:640)
... 13 more
Steps to reproduce
Example Base URL: http://${env.HOSTNAME}:${env.PORT.TRAFFIC} , where env.HOSTNAME=IP_APIGW_HOST
Resource path: /resourcepath
http://${env.HOSTNAME}:${env.PORT.TRAFFIC}/resourcepath
Attached the relevant log output.
Remark: If I remove in the frontend definition for Outbound the port, "${env.PORT.TRAFFIC}", below error will not be present.
Could it be validation on the variable type (ex:integer as it's a port) but because it gets a string it raises this ?
Relevant log output
The text was updated successfully, but these errors were encountered: