aokunsang opened a new issue, #4571:
URL: https://github.com/apache/incubator-seatunnel/issues/4571

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/incubator-seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
   1. first i run with seatunnel command is successful,the command as follows
   `
   bin/start-seatunnel-flink-13-connector-v2.sh --config 
config/v2.batch.config.template
   `
   2. however, when i submit job with flink1.13.5 restapi or webui, it is 
failed.some code as follows
   Map<String, Object> params = new HashMap<>();  
                List<String> argsList = new LinkedList<>();  
                argsList.add("-cs");
                
argsList.add("{\"env\":{\"job.name\":\"test_job\",\"execution.parallelism\":1,\"job.mode\":\"STREAMING\"},\"source\":[{\"schema\":{\"fields\":{\"name\":\"string\",\"age\":\"int\"}},\"row.num\":16,\"parallelism\":1,\"result_table_name\":\"fake\",\"plugin_name\":\"FakeSource\"}],\"transform\":[],\"sink\":[{\"parallelism\":1,\"plugin_name\":\"Console\"}]}");
                params.put("programArgsList", argsList);
                params.put("entryClass", 
"org.apache.seatunnel.core.starter.flink.SeaTunnelFlink");  
                params.put("parallelism", "1");  
                params.put("savepointPath", null);  
                Request request = new Request.Builder().url(domainHost + 
String.format("/jars/%s/run", jarid))
                                
.post(RequestBody.create(MediaType.parse("application/json"), 
JSON.toJSONString(params))).build();
                Response response = httpClient.newCall(request).execute();
                if (200 == response.code()) {
                        JSONObject body = 
JSON.parseObject(response.body().string());
                        System.out.println("response:jobid:" + 
body.getString("jobid"));
                }
   
   3. notes: I made some changes to the seatunnel code[configfile -> 
configjson],some code as follows  
       `org.apache.seatunnel.core.starter.flink.command.FlinkTaskExecuteCommand`
       public void execute() throws CommandExecuteException {
           Config config = null;
           try{
               Path configFile = FileUtils.getConfigPath(flinkCommandArgs);
               checkConfigExist(configFile);
               config = ConfigBuilder.of(configFile);
           }catch (Exception ex) {
               Map<String, Object> configMap = 
JsonUtils.toMap(flinkCommandArgs.getConfigJson(), String.class, Object.class);
               config = ConfigFactory.parseMap(configMap);
           }
         ....
       }
   
   ### SeaTunnel Version
   
   2.3.1-dev
   
   ### SeaTunnel Config
   
   ```conf
   i use configjson,instead of configfile
   {
       "env": {
           "job.name": "test_job",
           "execution.parallelism": 1,
           "job.mode": "STREAMING"
       },
       "source": [
           {
               "schema": {
                   "fields": {
                       "name": "string",
                       "age": "int"
                   }
               },
               "row.num": 16,
               "parallelism": 1,
               "result_table_name": "fake",
               "plugin_name": "FakeSource"
           }
       ],
       "transform": [],
       "sink": [
           {
               "parallelism": 1,
               "plugin_name": "Console"
           }
       ]
   }
   ```
   
   
   ### Running Command
   
   ```shell
   i can't run with command, use flink restapi/webui submit job
   ```
   
   
   ### Error Exception
   
   ```log
   {
       "errors": [
           "org.apache.flink.runtime.rest.handler.RestHandlerException: Could 
not execute application.\n\tat 
org.apache.flink.runtime.webmonitor.handlers.JarRunHandler.lambda$handleRequest$1(JarRunHandler.java:108)\n\tat
 
java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:822)\n\tat
 
java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:797)\n\tat
 
java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)\n\tat
 
java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1595)\n\tat
 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat 
java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)\n\tat
 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)\n\tat
 java.util.concurrent.ThreadPoolExecutor.runWo
 rker(ThreadPoolExecutor.java:1149)\n\tat 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat
 java.lang.Thread.run(Thread.java:748)\nCaused by: 
java.util.concurrent.CompletionException: 
org.apache.flink.util.FlinkRuntimeException: Could not execute 
application.\n\tat 
java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)\n\tat
 
java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)\n\tat
 
java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1592)\n\t...
 7 more\nCaused by: org.apache.flink.util.FlinkRuntimeException: Could not 
execute application.\n\tat 
org.apache.flink.client.deployment.application.DetachedApplicationRunner.tryExecuteJobs(DetachedApplicationRunner.java:88)\n\tat
 
org.apache.flink.client.deployment.application.DetachedApplicationRunner.run(DetachedApplicationRunner.java:70)\n\tat
 org.apache.flink.runtime.webmonitor.handlers.JarRunHandler.lambda$handleReque
 st$0(JarRunHandler.java:102)\n\tat 
java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)\n\t...
 7 more\nCaused by: org.apache.flink.client.program.ProgramInvocationException: 
The main method caused an error: Plugin 
PluginIdentifier{engineType='seatunnel', pluginType='source', 
pluginName='FakeSource'} not found.\n\tat 
org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:372)\n\tat
 
org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:222)\n\tat
 org.apache.flink.client.ClientUtils.executeProgram(ClientUtils.java:114)\n\tat 
org.apache.flink.client.deployment.application.DetachedApplicationRunner.tryExecuteJobs(DetachedApplicationRunner.java:84)\n\t...
 10 more\nCaused by: java.lang.RuntimeException: Plugin 
PluginIdentifier{engineType='seatunnel', pluginType='source', 
pluginName='FakeSource'} not found.\n\tat 
org.apache.seatunnel.plugin.discovery.AbstractPluginDiscovery.createPlu
 ginInstance(AbstractPluginDiscovery.java:223)\n\tat 
org.apache.seatunnel.plugin.discovery.AbstractPluginDiscovery.createPluginInstance(AbstractPluginDiscovery.java:178)\n\tat
 
org.apache.seatunnel.core.starter.flink.execution.SourceExecuteProcessor.initializePlugins(SourceExecuteProcessor.java:131)\n\tat
 
org.apache.seatunnel.core.starter.flink.execution.FlinkAbstractPluginExecuteProcessor.<init>(FlinkAbstractPluginExecuteProcessor.java:67)\n\tat
 
org.apache.seatunnel.core.starter.flink.execution.SourceExecuteProcessor.<init>(SourceExecuteProcessor.java:58)\n\tat
 
org.apache.seatunnel.core.starter.flink.execution.FlinkExecution.<init>(FlinkExecution.java:85)\n\tat
 
org.apache.seatunnel.core.starter.flink.command.FlinkTaskExecuteCommand.execute(FlinkTaskExecuteCommand.java:69)\n\tat
 org.apache.seatunnel.core.starter.SeaTunnel.run(SeaTunnel.java:40)\n\tat 
org.apache.seatunnel.core.starter.flink.SeaTunnelFlink.main(SeaTunnelFlink.java:34)\n\tat
 sun.reflect.NativeMethodAccessorImpl.invoke0(N
 ative Method)\n\tat 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat
 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat
 java.lang.reflect.Method.invoke(Method.java:498)\n\tat 
org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:355)\n\t...
 13 more\n"
       ]
   }
   ```
   
   
   ### Flink or Spark Version
   
   flink 1.13.5
   
   ### Java or Scala Version
   
   jdk1.8
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to