WSO2 IOTserver: multiple errors during startup, ca

2019-07-23 06:36发布

问题:

I'm trying to start WSO2 IoT server 3.3.0 on VM running Windows 10, jdk 8.0.191.

During startup I have multiple errors on almost every android API. Errors like that:

[2018-12-11 15:11:27,156] [IoT-Core] ERROR - {org.wso2.carbon.apimgt.rest.api.publisher.impl.ApisApiServiceImpl} Error while adding new API : admin-Windows Binary Security Token Service-1.0.0 - Scope 'perm:windows:enroll' is already used by another API.
    org.wso2.carbon.apimgt.api.APIManagementException: Scope 'perm:windows:enroll' is already used by another API.
            at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.addScopes(ApiMgtDAO.java:7171)
            at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.addAPI(ApiMgtDAO.java:4876)
            at org.wso2.carbon.apimgt.impl.APIProviderImpl.addAPI(APIProviderImpl.java:654)
            at org.wso2.carbon.apimgt.impl.UserAwareAPIProvider.addAPI(UserAwareAPIProvider.java:59)
            at org.wso2.carbon.apimgt.rest.api.publisher.impl.ApisApiServiceImpl.apisPost(ApisApiServiceImpl.java:281)
            at org.wso2.carbon.apimgt.rest.api.publisher.ApisApi.apisPost(ApisApi.java:574)
            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 org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179)
            at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
            at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:192)
            at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:103)
            at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
            at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96)
            at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
            at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
            at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:267)
            at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
            at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
            at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
            at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:191)
            at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:301)
            at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:220)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
            at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:276)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
            at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
            at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99)
            at org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47)
            at org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:57)
            at org.wso2.carbon.webapp.authenticator.framework.WebappAuthenticationValve.invoke(WebappAuthenticationValve.java:46)
            at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47)
            at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62)
            at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:159)
            at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
            at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
            at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
            at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
            at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1775)
            at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1734)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
            at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
            at java.lang.Thread.run(Thread.java:748)
    [2018-12-11 15:11:27,203] [IoT-Core] ERROR - {org.wso2.carbon.apimgt.webapp.publisher.APIPublisherStartupHandler} failed to publish api.
    org.wso2.carbon.apimgt.webapp.publisher.exception.APIManagerPublisherException: feign.FeignException: status 500 reading APIIndividualApi#apisPost(API,String,String); content:
    {"code":500,"message":"Internal server error","description":"Error while adding new API : admin-Windows Binary Security Token Service-1.0.0 - Scope 'perm:windows:enroll' is already used by another API.","moreInfo":"","error":[]}
            at org.wso2.carbon.apimgt.webapp.publisher.APIPublisherServiceImpl.publishAPI(APIPublisherServiceImpl.java:75)
            at org.wso2.carbon.apimgt.webapp.publisher.APIPublisherStartupHandler.publishAPIs(APIPublisherStartupHandler.java:97)
            at org.wso2.carbon.apimgt.webapp.publisher.APIPublisherStartupHandler.access$500(APIPublisherStartupHandler.java:30)
            at org.wso2.carbon.apimgt.webapp.publisher.APIPublisherStartupHandler$1.run(APIPublisherStartupHandler.java:69)
            at java.lang.Thread.run(Thread.java:748)
    Caused by: feign.FeignException: status 500 reading APIIndividualApi#apisPost(API,String,String); content:
    {"code":500,"message":"Internal server error","description":"Error while adding new API : admin-Windows Binary Security Token Service-1.0.0 - Scope 'perm:windows:enroll' is already used by another API.","moreInfo":"","error":[]}
            at feign.FeignException.errorStatus(FeignException.java:62)
            at feign.codec.ErrorDecoder$Default.decode(ErrorDecoder.java:91)
            at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:138)
            at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:76)
            at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:103)
            at com.sun.proxy.$Proxy44.apisPost(Unknown Source)
            at org.wso2.carbon.apimgt.webapp.publisher.APIPublisherServiceImpl.publishAPI(APIPublisherServiceImpl.java:56)
            ... 4 more

After start, I cannot enroll android device, enrollment hangs on retrieving the license agreement on wso2 agent.

Also when I try to change Platform Configuration- Android configuration there is "An unexpected error occurred." message after clicking save button.

By the way, version 3.2.0 started without problems on identical VM Is there any workaround? Did anyone succeed to start IoT server 3.3.0 on windows?

回答1:

I faced the same issue when running WSO2 IoT worker and manager separately. I'm not sure if you have solved this issue, but I just shared the solution that I have found after reading the source code in Github. All you need to do is add -Denable-api-scopes-sharing="true" into wso2iot-3.3.0_device-manager\bin\iot-server.sh. If you notice, this parameter present in the original bin\iot-server.sh. But it is gone after running profile-creator.sh/bat.

In iot-server.sh:

...
-Dmqtt.broker.https.port="9446" \
-Denable-api-scopes-sharing="true" \
org.wso2.carbon.bootstrap.Bootstrap $*
status=$?
...

Reference: https://github.com/wso2/carbon-apimgt/blob/017e178a332eae7d6057b47b96fd703767317e43/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java#L8025



标签: wso2 iot wso2iot