1

I have the WSO2 API Manager running on a Windows 2012 R2 server and all dashboard URL's like https://localhost:9443/store,https://localhost:9443/carbon,https://localhost:9443/publisher work fine. But when I configure and deploy (in the carbon.super tenant) the example WeatherAPI web service and try to reach it via the /services/... URL i.e.:

https://localhost:9443/services/weather/1.0.0/*?q=Amsterdam

I get the following error page returned:

> HTTP Status 500 - 
> 
> 
> type Exception report
> 
> message 
> 
> description The server encountered an internal error that prevented it
> from fulfilling this request.
> 
> exception  org.apache.axis2.AxisFault
>   org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
>   org.wso2.carbon.core.transports.CarbonServlet.doGet(CarbonServlet.java:155)
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
>   org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
>   org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
>   org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
>   org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68)
>   org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(CharacterSetFilter.java:61)
> 
> 
> 
> root cause  java.lang.NullPointerException
>   org.apache.synapse.rest.RESTUtils.getFullRequestPath(RESTUtils.java:80)
>   org.apache.synapse.rest.API.canProcess(API.java:179)
>   org.apache.synapse.rest.RESTRequestHandler.dispatchToAPI(RESTRequestHandler.java:79)
>   org.apache.synapse.rest.RESTRequestHandler.process(RESTRequestHandler.java:64)
>   org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:220)
>   org.apache.synapse.core.axis2.SynapseMessageReceiver.receive(SynapseMessageReceiver.java:83)
>   org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
>   org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144)
>   org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:139)
>   org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:837)
>   org.wso2.carbon.core.transports.CarbonServlet.handleRestRequest(CarbonServlet.java:303)
>   org.wso2.carbon.core.transports.CarbonServlet.doGet(CarbonServlet.java:152)
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
>   org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
>   org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
>   org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
>   javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
>   org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68)
>   org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(CharacterSetFilter.java:61)

When I create my own web service in a tenant and deploy it, I get the same error. So I probably misconfigured something, but don't know where to look. All paths below /services/... seem to return this error page. I checked the log files in the [WSO2]/repository/logs directory, but they don't show any errors.

Maarten Docter
  • 1,029
  • 1
  • 13
  • 31

1 Answers1

1

You are trying to access the services from the servlet port 9443. Try with the 8280 port . However, the endpoint of the API in APIM does not look like as you mention. Check the example given in the official WSO2 documentation

Vanji
  • 1,696
  • 14
  • 23
  • Enpoint will look like something similar to [1] [1]http://localhost:8280/youtube/1.0.0/top_rated – Vanji Sep 17 '15 at 22:55
  • Thanks @vanji. I'm using IIS as a reverse proxy in front of the WSO2 tomcat server, so I messed around with the `` values in the `api-manager.xml` file because it was showing the local IP-address in the store. I restored the original values and added an IIS Rewrite Rule to let my external API calls route (`https://api.mydomain.com/...`) to the internal localhost:8243 address (i.e. the https port, instead of the :8280 http port) and an outgoing rule to transform localhost:8243 URL's in the response content back to `https://api.mydomain.com/...` – Maarten Docter Sep 18 '15 at 08:59
  • Check this post in [1] to understand about the revers proxy. [1] https://jenananthan.wordpress.com/2015/05/12/configure-wso2-esb-with-reverse-proxy-with-proxy-context-path/ – Vanji Sep 18 '15 at 22:36
  • Your article describes the Wso2 esb behind the Nginx reverse proxy. I am using, and got it working, wso2 API Manager behind Internet Information Server (IIS) as a reverse proxy. So I don't really understand how this article adds value to the answer. – Maarten Docter Sep 19 '15 at 07:42