kyoty opened a new pull request #5676:
URL: https://github.com/apache/dolphinscheduler/pull/5676


   ## Purpose of the pull request
   In the newly implemented alert-plugin, the automatically generated spi 
service name is wrong:
   
![image](https://user-images.githubusercontent.com/52202080/122869972-a051c780-d35f-11eb-92d9-37a9e4c65648.png)
   
   reproduce step(Use feishu-plugin as an example):
   1. remove the file if exist:  
`dolphinscheduler-alert-plugin\dolphinscheduler-alert-feishu\target\classes\META-INF\services\org.apache.dolphinscheduler.spi.DolphinSchedulerPlugin`
 (if we build the project by ` mvn -U clean package -Prelease 
-Dmaven.test.skip=true`, then the file would exists)
   2. config the `alert.properties` in `dolphinscheduler-alert`, then run the 
`AlertServer`, you would see exceptions like below:
   ```java
   Exception in thread "main" java.util.ServiceConfigurationError: 
org.apache.dolphinscheduler.spi.DolphinSchedulerPlugin: 
file:/E:/workspaces/dolphinscheduler/dolphinscheduler-alert-plugin/dolphinscheduler-alert-feishu/target/classes/META-INF/services/org.apache.dolphinscheduler.spi.DolphinSchedulerPlugin:1:
 Illegal provider-class name: 
org\apache\dolphinscheduler\plugin\alert\feishu\FeiShuAlertPlugin
        at java.util.ServiceLoader.fail(ServiceLoader.java:239)
        at java.util.ServiceLoader.fail(ServiceLoader.java:245)
        at java.util.ServiceLoader.parseLine(ServiceLoader.java:272)
        at java.util.ServiceLoader.parse(ServiceLoader.java:307)
        at java.util.ServiceLoader.access$200(ServiceLoader.java:185)
        at 
java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:357)
        at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:393)
        at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
        at 
com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:270)
        at 
com.google.common.collect.ImmutableList.copyOf(ImmutableList.java:234)
        at 
org.apache.dolphinscheduler.spi.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:106)
        at 
org.apache.dolphinscheduler.spi.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:99)
        at 
org.apache.dolphinscheduler.spi.plugin.DolphinPluginLoader.loadPlugins(DolphinPluginLoader.java:90)
        at 
org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:114)
        at 
org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:158)
        at 
org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:174)
   Disconnected from the target VM, address: '127.0.0.1:13662', transport: 
'socket'
   ```
   
   ## Brief change log
   Ensure the auto-generated spi service classname is right by replace 
`File.seperator` to '.'
   ## Verify this pull request
   Manual test works well, the spi service file can be auto-generated to the 
right format as expected.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to