llzcx commented on issue #15602:
URL:
https://github.com/apache/dolphinscheduler/issues/15602#issuecomment-2094673365
我在3.2.1也遇到了同样的问题,只选择jar路径,不选resource报错:无法找到jar资源:
```
[ERROR] 2024-05-05 00:48:23.518 -0700 - java task failed
java.lang.IllegalArgumentException: Cannot find the resourceItem:
file:/dolphinscheduler/default/resources/jar/test-1.0-SNAPSHOT.jar
at
org.apache.dolphinscheduler.plugin.task.api.resource.ResourceContext.getResourceItem(ResourceContext.java:51)
at
org.apache.dolphinscheduler.plugin.task.java.JavaTask.buildJarCommand(JavaTask.java:181)
at
org.apache.dolphinscheduler.plugin.task.java.JavaTask.handle(JavaTask.java:123)
at
org.apache.dolphinscheduler.server.worker.runner.DefaultWorkerTaskExecutor.executeTask(DefaultWorkerTaskExecutor.java:54)
at
org.apache.dolphinscheduler.server.worker.runner.WorkerTaskExecutor.run(WorkerTaskExecutor.java:175)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
[ERROR] 2024-05-05 00:48:23.518 -0700 - Task execute failed, due to meet an
exception
org.apache.dolphinscheduler.plugin.task.api.TaskException: run java task
error
at
org.apache.dolphinscheduler.plugin.task.java.JavaTask.handle(JavaTask.java:148)
at
org.apache.dolphinscheduler.server.worker.runner.DefaultWorkerTaskExecutor.executeTask(DefaultWorkerTaskExecutor.java:54)
at
org.apache.dolphinscheduler.server.worker.runner.WorkerTaskExecutor.run(WorkerTaskExecutor.java:175)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Cannot find the resourceItem:
file:/dolphinscheduler/default/resources/jar/test-1.0-SNAPSHOT.jar
at
org.apache.dolphinscheduler.plugin.task.api.resource.ResourceContext.getResourceItem(ResourceContext.java:51)
at
org.apache.dolphinscheduler.plugin.task.java.JavaTask.buildJarCommand(JavaTask.java:181)
at
org.apache.dolphinscheduler.plugin.task.java.JavaTask.handle(JavaTask.java:123)
... 5 common frames omitted
```
选了resource以后出现jar无法访问的问题:
```
[INFO] 2024-05-05 00:49:12.634 -0700 - #!/bin/bash
BASEDIR=$(cd `dirname $0`; pwd)
cd $BASEDIR
${JAVA_HOME}/bin/java -classpath
.:/tmp/dolphinscheduler/exec/process/root/13497703320224/13498447194144_11/13/23:/tmp/dolphinscheduler/exec/process/root/13497703320224/13498447194144_11/13/23//tmp/dolphinscheduler/exec/process/root/13497703320224/13498447194144_11/13/23/jar/test-1.0-SNAPSHOT.jar
-jar
/tmp/dolphinscheduler/exec/process/root/13497703320224/13498447194144_11/13/23//tmp/dolphinscheduler/exec/process/root/13497703320224/13498447194144_11/13/23/jar/test-1.0-SNAPSHOT.jar
xms:50m
[INFO] 2024-05-05 00:49:12.634 -0700 - ****************************** Script
Content *****************************************************************
[INFO] 2024-05-05 00:49:12.634 -0700 - Executing shell command : sudo -u
root -i
/tmp/dolphinscheduler/exec/process/root/13497703320224/13498447194144_11/13/23/13_23.sh
[INFO] 2024-05-05 00:49:12.653 -0700 - process start, process id is: 32966
[INFO] 2024-05-05 00:49:13.655 -0700 - ->
Error: Unable to access jarfile
/tmp/dolphinscheduler/exec/process/root/13497703320224/13498447194144_11/13/23//tmp/dolphinscheduler/exec/process/root/13497703320224/13498447194144_11/13/23/jar/test-1.0-SNAPSHOT.jar
[INFO] 2024-05-05 00:49:13.656 -0700 - process has exited. execute
path:/tmp/dolphinscheduler/exec/process/root/13497703320224/13498447194144_11/13/23,
processId:32966 ,exitStatusCode:1 ,processWaitForStatus:true
,processExitValue:1
[INFO] 2024-05-05 00:49:13.656 -0700 - java task run result:
TaskResponse(varPool=null, processId=32966, resultString=null, appIds=null,
process=null, cancel=false, exitStatusCode=1, status=null)
```
看上去是/tmp/dolphinscheduler/exec/process/root/13497703320224/13498447194144_11/13/23//tmp/dolphinscheduler/exec/process/root/13497703320224/13498447194144_11/13/23/jar/test-1.0-SNAPSHOT.jar这个路径被拼接了2次。
--
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]