wso2 / product-apim

Welcome to the WSO2 API Manager source code! For info on working with the WSO2 API Manager repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
851 stars 787 forks source link

[APIM 3.2] Error in API Product Creation #12123

Closed rashm1n closed 1 week ago

rashm1n commented 2 years ago

Description:

Issue arises when an API with no-endpoint and an API with an endpoint (sample-api) gets combined in the API-Product creation.

Steps to reproduce:

  1. Create the sample Pizza-Shack API
  2. Create another API from scratch without providing an endpoint.
  3. Go to API-Product creation and create an API combining resources from the two APIs.

StackTrace

[2021-12-10 19:00:45,108] ERROR - APIMappingUtil No throttle policies available in the tenant carbon.super [2021-12-10 19:01:05,604] ERROR - ApiProductsApiServiceImpl Error while adding new API Product : admin-p1 - Error while parsing Endpoint Config json org.wso2.carbon.apimgt.api.APIManagementException: Error while parsing Endpoint Config json at org.wso2.carbon.apimgt.impl.utils.APIUtil.setEndpointSecurityForAPIProduct_aroundBody766(APIUtil.java:11051) ~[org.wso2.carbon.apimgt.impl_6.7.206.220.jar:?] at org.wso2.carbon.apimgt.impl.utils.APIUtil.setEndpointSecurityForAPIProduct(APIUtil.java:11009) ~[org.wso2.carbon.apimgt.impl_6.7.206.220.jar:?] at org.wso2.carbon.apimgt.impl.APIProviderImpl.addAPIProductWithoutPublishingToGateway_aroundBody444(APIProviderImpl.java:7970) ~[org.wso2.carbon.apimgt.impl_6.7.206.220.jar:?] at org.wso2.carbon.apimgt.impl.APIProviderImpl.addAPIProductWithoutPublishingToGateway(APIProviderImpl.java:7926) ~[org.wso2.carbon.apimgt.impl_6.7.206.220.jar:?] at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.addAPIProductWithoutPublishingToGateway(UserAwareAPIProvider.java:1) ~[org.wso2.carbon.apimgt.impl_6.7.206.220.jar:?] at org.wso2.carbon.apimgt.rest.api.publisher.v1.impl.ApiProductsApiServiceImpl.apiProductsPost(ApiProductsApiServiceImpl.java:737) [classes/:?] at org.wso2.carbon.apimgt.rest.api.publisher.v1.ApiProductsApi.apiProductsPost(ApiProductsApi.java:329) [classes/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_281] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_281] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_281] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_281] at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) [cxf-core-3.4.4.jar:3.4.4] at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) [cxf-core-3.4.4.jar:3.4.4] at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201) [cxf-rt-frontend-jaxrs-3.4.4.jar:3.4.4] at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104) [cxf-rt-frontend-jaxrs-3.4.4.jar:3.4.4] at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) [cxf-core-3.4.4.jar:3.4.4] at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) [cxf-core-3.4.4.jar:3.4.4] at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [cxf-core-3.4.4.jar:3.4.4] at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-core-3.4.4.jar:3.4.4] at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:265) [cxf-rt-transports-http-3.4.4.jar:3.4.4] at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) [cxf-rt-transports-http-3.4.4.jar:3.4.4] at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) [cxf-rt-transports-http-3.4.4.jar:3.4.4] at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) [cxf-rt-transports-http-3.4.4.jar:3.4.4] at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:225) [cxf-rt-transports-http-3.4.4.jar:3.4.4] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:298) [cxf-rt-transports-http-3.4.4.jar:3.4.4] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:217) [cxf-rt-transports-http-3.4.4.jar:3.4.4] at javax.servlet.http.HttpServlet.service(HttpServlet.java:681) [tomcat-servlet-api_9.0.31.wso2v1.jar:?] at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:273) [cxf-rt-transports-http-3.4.4.jar:3.4.4] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) [tomcat_9.0.31.wso2v1.jar:?] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [tomcat_9.0.31.wso2v1.jar:?] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat_9.0.31.wso2v1.jar:?] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [tomcat_9.0.31.wso2v1.jar:?] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [tomcat_9.0.31.wso2v1.jar:?] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) [tomcat_9.0.31.wso2v1.jar:?] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) [tomcat_9.0.31.wso2v1.jar:?] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) [tomcat_9.0.31.wso2v1.jar:?] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) [tomcat_9.0.31.wso2v1.jar:?] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat_9.0.31.wso2v1.jar:?] at org.wso2.carbon.identity.context.rewrite.valve.TenantContextRewriteValve.invoke(TenantContextRewriteValve.java:86) [org.wso2.carbon.identity.context.rewrite.valve_1.4.0.jar:?] at org.wso2.carbon.identity.authz.valve.AuthorizationValve.invoke(AuthorizationValve.java:110) [org.wso2.carbon.identity.authz.valve_1.4.0.jar:?] at org.wso2.carbon.identity.auth.valve.AuthenticationValve.invoke(AuthenticationValve.java:103) [org.wso2.carbon.identity.auth.valve_1.4.0.2.jar:?] at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99) [org.wso2.carbon.tomcat.ext_4.6.0.44.jar:?] at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:49) [org.wso2.carbon.tomcat.ext_4.6.0.44.jar:?] at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62) [org.wso2.carbon.tomcat.ext_4.6.0.44.jar:?] at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:145) [org.wso2.carbon.tomcat.ext_4.6.0.44.jar:?] at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687) [tomcat_9.0.31.wso2v1.jar:?] at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57) [org.wso2.carbon.tomcat.ext_4.6.0.44.jar:?] at org.wso2.carbon.tomcat.ext.valves.RequestCorrelationIdValve.invoke(RequestCorrelationIdValve.java:124) [org.wso2.carbon.tomcat.ext_4.6.0.44.jar:?] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) [tomcat_9.0.31.wso2v1.jar:?] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357) [tomcat_9.0.31.wso2v1.jar:?] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:382) [tomcat_9.0.31.wso2v1.jar:?] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat_9.0.31.wso2v1.jar:?] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893) [tomcat_9.0.31.wso2v1.jar:?] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1726) [tomcat_9.0.31.wso2v1.jar:?] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat_9.0.31.wso2v1.jar:?] at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) [tomcat_9.0.31.wso2v1.jar:?] at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) [tomcat_9.0.31.wso2v1.jar:?] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat_9.0.31.wso2v1.jar:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_281] Caused by: org.json.simple.parser.ParseException at org.json.simple.parser.JSONParser.parse(Unknown Source) ~[json-simple_1.1.0.wso2v1.jar:?] at org.json.simple.parser.JSONParser.parse(Unknown Source) ~[json-simple_1.1.0.wso2v1.jar:?] at org.json.simple.parser.JSONParser.parse(Unknown Source) ~[json-simple_1.1.0.wso2v1.jar:?] at org.wso2.carbon.apimgt.impl.utils.APIUtil.setEndpointSecurityForAPIProduct_aroundBody766(APIUtil.java:11030) ~[org.wso2.carbon.apimgt.impl_6.7.206.220.jar:?] ... 58 more

rashm1n commented 2 years ago

Screenshot

image