测试Eagle的自定义Application报错问题及解决办法

错误1:安装EXAMPLE_APPLICATION报错

{"success":false,"message":"Illegal Application Type: 
EXAMPLE_APPLICATION","exception":"javax.ws.rs.WebApplicationException:
 java.lang.IllegalArgumentException: Illegal Application Type: EXAMPLE_APPLICATION

这个问题,用下面的方法解决:
1、在eagle项目中的eagle-topology-assembly文件夹下,src/resources/services/org.apache.eagle.app.spi.ApplicationProvider 在该文件中添加自定义的Application的Provider类,例如

## Example
org.apache.eagle.app.example.ExampleApplicationProvider

2、再次编译之后重新部署,在页面中就有了自定义的ExampleApplication

错误2:添加Example Application报错信息:

Neither stream specific topic: dataSinkConfig.SAMPLE_STREAM_1.topic nor default shared topic: dataSinkConfig.topic found in config

这个问题,用下面的方法解决:
1、修改org.apache.eagle.app.example.ExampleApplicationProvider.xml文件

 <property>
            <name>dataSinkConfig.SAMPLE_STREAM_1.topic</name>
            <displayName>Destination(Kafka Topic) Of App Stream Data</displayName>
            <value>${siteId}_example_source_topic</value>
            <description>topic for kafka data sink</description>
            <required>true</required>
        </property>
		<property>
            <name>dataSinkConfig.SAMPLE_STREAM_2.topic</name>
            <displayName>Destination(Kafka Topic) Of App Stream Data</displayName>
            <value>${siteId}_example_source_topic</value>
            <description>topic for kafka data sink</description>
            <required>true</required>
        </property>

2、报新错误

No configuration setting found for key 'dataSinkConfig.brokerList'

3、修改配置文件org.apache.eagle.app.example.ExampleApplicationProvider.xml

<property>
            <name>dataSinkConfig.brokerList</name>
            <displayName>Broker(Kafka) List Of Stream Data</displayName>
            <value>localhost:6667</value>
            <description>kafka broker list for stream data</description>
            <required>true</required>
        </property>

4、经过增加配置文件内容,上面的错误信息没有了,app也安装成功了,但是启动不了,也删除不掉,报错信息如下:

com.google.inject.ConfigurationException: Guice configuration errors:
1) No implementation for org.apache.eagle.app.example.extensions.ExampleEntityService was bound.

1、上面出现的问题,通过查看代码,注释掉ExampleApplicationProvider类中的下面代码后解决:

//@Inject ExampleEntityService entityService;
@Override
public void init(ApplicationEntity applicationEntity) {
    this.application = applicationEntity;
    //entityService.getEntities();
}

2、通过修改后,可以卸载了,但是启动还是报错:

ERROR [2017-09-07 00:58:45,044] org.apache.eagle.app.service.impl.ApplicationManagementServiceImpl: Failed to start app EXAMPLE_APPLICATION_TEST_SITE
ERROR [2017-09-07 00:58:45,044] org.apache.eagle.common.rest.RESTResponse: Exception: No configuration setting found for key 'spoutNum'

3、通过修改配置文件org.apache.eagle.app.example.ExampleApplicationProvider.xml后解决,而且Application启动也成功了

 <property>
            <name>spoutNum</name>
            <displayName>Topology Spout Tasks</displayName>
            <value>2</value>
            <description>number of spout tasks</description>
        </property>

猜你喜欢

转载自blog.csdn.net/zwahut/article/details/90603307