sitewhere / sitewhere

SiteWhere is an industrial strength open-source application enablement platform for the Internet of Things (IoT). It provides a multi-tenant microservice-based infrastructure that includes device/asset management, data ingestion, big-data storage, and integration through a modern, scalable architecture. SiteWhere provides REST APIs for all system functionality. SiteWhere provides SDKs for many common device platforms including Android, iOS, Arduino, and any Java-capable platform such as Raspberry Pi rapidly accelerating the speed of innovation.
https://sitewhere.io
Other
1.02k stars 382 forks source link

service-instance-management #811

Open liwh1111 opened 4 years ago

liwh1111 commented 4 years ago

Hello, I want to start the service-instance-management service in idea. What configuration should be modified? Kafka has been configured, but it still reports an error

2020-05-14 11:12:13.788 ERROR 3196 --- [   Service Main] c.s.i.templates.InstanceTemplateManager  : InstanceTemplateManager state transitioned to ERROR.

com.sitewhere.spi.SiteWhereException: Root folder for instance templates not found!
    at com.sitewhere.instance.templates.InstanceTemplateManager.getTemplatesRoot(InstanceTemplateManager.java:97) ~[classes/:na]
    at com.sitewhere.instance.templates.InstanceTemplateManager.refreshTemplates(InstanceTemplateManager.java:110) ~[classes/:na]
    at com.sitewhere.instance.templates.InstanceTemplateManager.start(InstanceTemplateManager.java:52) ~[classes/:na]
    at com.sitewhere.server.lifecycle.LifecycleComponent.lifecycleStart(LifecycleComponent.java:255) [classes/:na]
    at com.sitewhere.server.lifecycle.LifecycleComponent.startNestedComponent(LifecycleComponent.java:314) [classes/:na]
    at com.sitewhere.server.lifecycle.StartComponentLifecycleStep.execute(StartComponentLifecycleStep.java:49) [classes/:na]
    at com.sitewhere.server.lifecycle.CompositeLifecycleStep.execute(CompositeLifecycleStep.java:77) [classes/:na]
    at com.sitewhere.instance.microservice.InstanceManagementMicroservice.microserviceStart(InstanceManagementMicroservice.java:291) [classes/:na]
    at com.sitewhere.microservice.GlobalMicroservice.start(GlobalMicroservice.java:53) [classes/:na]
    at com.sitewhere.server.lifecycle.LifecycleComponent.lifecycleStart(LifecycleComponent.java:255) [classes/:na]
    at com.sitewhere.microservice.MicroserviceApplication$StartMicroservice.startMicroservice(MicroserviceApplication.java:150) [classes/:na]
    at com.sitewhere.microservice.MicroserviceApplication$StartMicroservice.call(MicroserviceApplication.java:97) [classes/:na]
    at com.sitewhere.microservice.MicroserviceApplication$StartMicroservice.call(MicroserviceApplication.java:88) [classes/:na]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_144]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_144]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_144]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_144]

2020-05-14 11:12:13.789  INFO 3196 --- [   Service Main] c.s.i.m.InstanceManagementMicroservice   : Sent state update for lifecycle status change 'LifecycleError'
2020-05-14 11:12:13.789 ERROR 3196 --- [   Service Main] c.s.i.m.InstanceManagementMicroservice   : InstanceManagementMicroservice state transitioned to ERROR.

com.sitewhere.spi.ServerStartupException: Unable to start 'InstanceTemplateManager'
    at com.sitewhere.server.lifecycle.LifecycleComponent.startNestedComponent(LifecycleComponent.java:318) ~[classes/:na]
    at com.sitewhere.server.lifecycle.StartComponentLifecycleStep.execute(StartComponentLifecycleStep.java:49) ~[classes/:na]
    at com.sitewhere.server.lifecycle.CompositeLifecycleStep.execute(CompositeLifecycleStep.java:77) ~[classes/:na]
    at com.sitewhere.instance.microservice.InstanceManagementMicroservice.microserviceStart(InstanceManagementMicroservice.java:291) ~[classes/:na]
    at com.sitewhere.microservice.GlobalMicroservice.start(GlobalMicroservice.java:53) ~[classes/:na]
    at com.sitewhere.server.lifecycle.LifecycleComponent.lifecycleStart(LifecycleComponent.java:255) ~[classes/:na]
    at com.sitewhere.microservice.MicroserviceApplication$StartMicroservice.startMicroservice(MicroserviceApplication.java:150) [classes/:na]
    at com.sitewhere.microservice.MicroserviceApplication$StartMicroservice.call(MicroserviceApplication.java:97) [classes/:na]
    at com.sitewhere.microservice.MicroserviceApplication$StartMicroservice.call(MicroserviceApplication.java:88) [classes/:na]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_144]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_144]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_144]
    at java.lang.Thread.run(Thread.java:748) [na:1.8.0_144]
derekadams commented 4 years ago

I don't think it's possible to run the microservices directly in an IDE since they make assumptions based on being packaged inside a docker container. In this case, the assumption is that certain folders are available on the local file system, which is loaded as part of the docker image build process. We've gotten away from using the file system in 3.0, but the microservices now depend on running in Kubernetes, so there will be similar issues. We do offer the ability to run debug images which you can connect to via the standard Java debugger.