我无法从WSO2 API Manager在WSO2 ESB中发布API。我的遗留架构有两个WSO2 ESB实例,第一个ESB只是一个网关组件,第二个ESB是传统的。
现在,我需要使用API Manager实例在ESB的内容中发布API。
但是,我将/repository/conf/api-manager.xml中的APIGateway部分配置为指向ESB实例,如下所示:
<APIGateway>
<Environments>
<Environment type="production" api-console="true">
<Name>Production and Sandbox</Name>
<Description> Description of environment</Description>
<!--ServerURL>https://${carbon.local.ip}:${mgt.transport.https.port}${carbon.context}/services/</ServerURL-->
<ServerURL>https://localhost:8243/services/</ServerURL>
<!--Username>${admin.username}</Username-->
<Username>admin</Username>
<!--Password>${admin.password}</Password-->
<Password>admin</Password>
<!--GatewayEndpoint>http://${carbon.local.ip}:${http.nio.port},https://${carbon.local.ip}:${https.nio.port}</GatewayEndpoint-->
<GatewayEndpoint>http://localhost:8280,https://localhost:8243</GatewayEndpoint>
</Environment>
</Environments>
<EnableGatewayKeyCache>true</EnableGatewayKeyCache>
<EnableGatewayResourceCache>true</EnableGatewayResourceCache>
<ClientDomainHeader>referer</ClientDomainHeader>
</APIGateway>
而且,我厌倦了指向8243端口,我也无法在ESB实例中发布。
在日志中,我可以看到以下内容:
2016-05-05 08:33:29,551 [-] [http-nio-9443-exec-42] INFO LogMediator To: https://localhost:9443/services/APIGatewayAdmin, From: 127.0.0.1, WSAction: urn:getApi, SOAPAction: urn:getApi, Direction: request, Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><ns2:getApi xmlns:ns2="http://service.gateway.apimgt.carbon.wso2.org"><ns2:apiProviderName>admin</ns2:apiProviderName><ns2:apiName>name</ns2:apiName><ns2:version>1.0</ns2:version></ns2:getApi></soapenv:Body></soapenv:Envelope>
因此,API管理器尝试在ESB中发布,并且ESB重新接收请求,但我在下面几行的日志中只收到一个错误:
2016-05-05 08:33:55,865 [-] [http-nio-9443-exec-4] DEBUG AxisServlet
java.lang.NullPointerException
at javax.servlet.GenericServlet.getServletContext(GenericServlet.java:123)
at org.apache.axis2.transport.http.AxisServlet.createMessageContext(AxisServlet.java:715)
[...]
2016-05-05 08:33:55,867 [-] [http-nio-9443-exec-4] DEBUG Options getAction (null) from org.apache.axis2.client.Options@353f3a03
我是否需要配置ESB才能执行此操作?