Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [Java Task] java task failed #15602

Open
2 of 3 tasks
lohcve opened this issue Feb 20, 2024 · 6 comments
Open
2 of 3 tasks

[Bug] [Java Task] java task failed #15602

lohcve opened this issue Feb 20, 2024 · 6 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@lohcve
Copy link

lohcve commented Feb 20, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

I have upgraded to 3.2.1 version,but find some errors to execute simple jar file。
error logs:
2.txt

it looks like jar path error.

What you expected to happen

support jar file

How to reproduce

execute simple jar file

Anything else

No response

Version

3.2.x

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@lohcve lohcve added bug Something isn't working Waiting for reply Waiting for reply labels Feb 20, 2024
@rdsuncn
Copy link

rdsuncn commented Feb 23, 2024

选jar的时候,不要再选resource。但是你会碰到接下来另一个错误

image

@rdsuncn
Copy link

rdsuncn commented Feb 23, 2024

[ERROR] 2024-02-23 03:52:11.382 -0500 o.a.d.p.t.j.JavaTask:[146] - java task failed
java.lang.IllegalArgumentException: Cannot find the resourceItem: file:/dolphinscheduler/default/resources/test001/demo.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.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
[ERROR] 2024-02-23 03:52:11.382 -0500 o.a.d.s.w.r.WorkerTaskExecutor:[181] - 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.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.IllegalArgumentException: Cannot find the resourceItem: file:/dolphinscheduler/default/resources/test001/demo.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

@lohcve
Copy link
Author

lohcve commented Feb 23, 2024

[ERROR] 2024-02-23 03:52:11.382 -0500 o.a.d.p.t.j.JavaTask:[146] - java task failed java.lang.IllegalArgumentException: Cannot find the resourceItem: file:/dolphinscheduler/default/resources/test001/demo.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.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:840) [ERROR] 2024-02-23 03:52:11.382 -0500 o.a.d.s.w.r.WorkerTaskExecutor:[181] - 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.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:840) Caused by: java.lang.IllegalArgumentException: Cannot find the resourceItem: file:/dolphinscheduler/default/resources/test001/demo.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放在hdfs上,错误跟你类似。

@llzcx
Copy link

llzcx commented May 5, 2024

我在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次。

@DearZh
Copy link

DearZh commented Jul 4, 2024

这个问题有排期修复的计划吗?

@SbloodyS SbloodyS added help wanted Extra attention is needed and removed Waiting for reply Waiting for reply labels Jul 17, 2024
@ztzlove51
Copy link

getResourceAbsolutePathInLocal改为getResourceRelativePath再重新打包就好了

图片

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants