flink-user-zh mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 刘建刚 <liujiangangp...@gmail.com>
Subject Re: How to load udf jars in flink program
Date Thu, 15 Aug 2019 10:46:26 GMT
对不起,发现问题了。。。这是我本地的一个文件的权限问题。非常感谢,我再试试!

刘建刚 <liujiangangpeng@gmail.com> 于2019年8月15日周四 下午6:32写道:

> /external/libs 是指启动flink程序所在机器的目录吗?你们在程序里也是通过classLoader加载的jar包然后注册udf吗?
>
>          我刚才简单试了一下,将jar包放在/tmp下,会报下面的问题:
> org.apache.flink.client.deployment.ClusterDeploymentException: Could not
> deploy Yarn job cluster.
> at
> org.apache.flink.yarn.YarnClusterDescriptor.deployJobCluster(YarnClusterDescriptor.java:82)
> at org.apache.flink.client.cli.CliFrontend.runProgram(CliFrontend.java:241)
> at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:216)
> at
> org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:1053)
> at
> org.apache.flink.client.cli.CliFrontend.lambda$main$11(CliFrontend.java:1129)
> at java.security.AccessController.doPrivileged(Native Method)
> at javax.security.auth.Subject.doAs(Subject.java:422)
> at
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1692)
> at
> org.apache.flink.runtime.security.HadoopSecurityContext.runSecured(HadoopSecurityContext.java:41)
> at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:1129)
> Caused by: java.nio.file.AccessDeniedException:
> /tmp/1cc4b2d5-9f17-4d75-b598-a0f819906b9e_resources/web_server
> at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
> at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
> at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
> at
> sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:427)
> at java.nio.file.Files.newDirectoryStream(Files.java:457)
> at java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:300)
> at java.nio.file.FileTreeWalker.next(FileTreeWalker.java:372)
> at java.nio.file.Files.walkFileTree(Files.java:2706)
> at java.nio.file.Files.walkFileTree(Files.java:2742)
> at
> org.apache.flink.yarn.AbstractYarnClusterDescriptor.uploadAndRegisterFiles(AbstractYarnClusterDescriptor.java:1218)
> at
> org.apache.flink.yarn.AbstractYarnClusterDescriptor.startAppMaster(AbstractYarnClusterDescriptor.java:815)
> at
> org.apache.flink.yarn.AbstractYarnClusterDescriptor.deployInternal(AbstractYarnClusterDescriptor.java:553)
> at
> org.apache.flink.yarn.YarnClusterDescriptor.deployJobCluster(YarnClusterDescriptor.java:75)
> ... 9 more
>
> 苏 欣 <seanlwj@live.com> 于2019年8月15日周四 下午5:54写道:
>
>> 我们是这么做的,你们可以试一下。用-yt指定jar所在的目录,-C将jar添加进classpath
>>
>> 例如:flink run -m yarn-cluster -yt /external/libs  -C
>> file:///external/libs/func1.jar -C file:///external/libs/func2.jar
>>
>>
>>
>> 发送自 Windows 10 版邮件<https://go.microsoft.com/fwlink/?LinkId=550986>应用
>>
>>
>>
>> ________________________________
>> 发件人: 刘建刚 <liujiangangpeng@gmail.com>
>> 发送时间: Thursday, August 15, 2019 5:31:33 PM
>> 收件人: user-zh@flink.apache.org <user-zh@flink.apache.org>;
>> user@flink.apache.org <user@flink.apache.org>; dev@flink.apache.org <
>> dev@flink.apache.org>
>> 主题: How to load udf jars in flink program
>>
>>       We are using per-job to load udf jar when start job. Our jar file is
>> in another path but not flink's lib path. In the main function, we use
>> classLoader to load the jar file by the jar path. But it reports the
>> following error when job starts running.
>>       If the jar file is in lib, everything is ok. But our udf jar file is
>> managed in a special path. How can I load udf jars in flink program with
>> only giving the jar path?
>>
>> org.apache.flink.api.common.InvalidProgramException: Table program
>> cannot be compiled. This is a bug. Please file an issue.
>>         at
>> org.apache.flink.table.codegen.Compiler$class.compile(Compiler.scala:36)
>>         at
>> org.apache.flink.table.runtime.CRowProcessRunner.compile(CRowProcessRunner.scala:35)
>>         at
>> org.apache.flink.table.runtime.CRowProcessRunner.open(CRowProcessRunner.scala:49)
>>         at
>> org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:36)
>>         at
>> org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.open(AbstractUdfStreamOperator.java:102)
>>         at
>> org.apache.flink.streaming.api.operators.ProcessOperator.open(ProcessOperator.java:56)
>>         at
>> org.apache.flink.streaming.runtime.tasks.StreamTask.openAllOperators(StreamTask.java:424)
>>         at
>> org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:290)
>>         at org.apache.flink.runtime.taskmanager.Task.run(Task.java:723)
>>         at java.lang.Thread.run(Thread.java:745)
>> Caused by: org.codehaus.commons.compiler.CompileException: Line 5,
>> Column 1: Cannot determine simple type name "com"
>>         at
>> org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:11877)
>>         at
>> org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:6758)
>>         at
>> org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:6519)
>>         at
>> org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:6532)
>>         at
>> org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:6532)
>>         at
>> org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:6532)
>>         at
>> org.codehaus.janino.UnitCompiler.getReferenceType(UnitCompiler.java:6532)
>>         at
>> org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:6498)
>>         at
>> org.codehaus.janino.UnitCompiler.access$14000(UnitCompiler.java:218)
>>         at
>> org.codehaus.janino.UnitCompiler$22$1.visitReferenceType(UnitCompiler.java:6405)
>>         at
>> org.codehaus.janino.UnitCompiler$22$1.visitReferenceType(UnitCompiler.java:6400)
>>         at org.codehaus.janino.Java$ReferenceType.accept(Java.java:3983)
>>         at
>> org.codehaus.janino.UnitCompiler$22.visitType(UnitCompiler.java:6400)
>>         at
>> org.codehaus.janino.UnitCompiler$22.visitType(UnitCompiler.java:6393)
>>         at org.codehaus.janino.Java$ReferenceType.accept(Java.java:3982)
>>         at
>> org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:6393)
>>         at
>> org.codehaus.janino.UnitCompiler.access$1300(UnitCompiler.java:218)
>>         at
>> org.codehaus.janino.UnitCompiler$25.getType(UnitCompiler.java:8206)
>>         at
>> org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:6798)
>>         at
>> org.codehaus.janino.UnitCompiler.access$14500(UnitCompiler.java:218)
>>         at
>> org.codehaus.janino.UnitCompiler$22$2$1.visitFieldAccess(UnitCompiler.java:6423)
>>         at
>> org.codehaus.janino.UnitCompiler$22$2$1.visitFieldAccess(UnitCompiler.java:6418)
>>         at org.codehaus.janino.Java$FieldAccess.accept(Java.java:4365)
>>         at
>> org.codehaus.janino.UnitCompiler$22$2.visitLvalue(UnitCompiler.java:6418)
>>         at
>> org.codehaus.janino.UnitCompiler$22$2.visitLvalue(UnitCompiler.java:6414)
>>         at org.codehaus.janino.Java$Lvalue.accept(Java.java:4203)
>>         at
>> org.codehaus.janino.UnitCompiler$22.visitRvalue(UnitCompiler.java:6414)
>>         at
>> org.codehaus.janino.UnitCompiler$22.visitRvalue(UnitCompiler.java:6393)
>>         at org.codehaus.janino.Java$Rvalue.accept(Java.java:4171)
>>         at
>> org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:6393)
>>         at
>> org.codehaus.janino.UnitCompiler.getType2(UnitCompiler.java:6780)
>>         at
>> org.codehaus.janino.UnitCompiler.access$14300(UnitCompiler.java:218)
>>         at
>> org.codehaus.janino.UnitCompiler$22$2$1.visitAmbiguousName(UnitCompiler.java:6421)
>>         at
>> org.codehaus.janino.UnitCompiler$22$2$1.visitAmbiguousName(UnitCompiler.java:6418)
>>         at org.codehaus.janino.Java$AmbiguousName.accept(Java.java:4279)
>>         at
>> org.codehaus.janino.UnitCompiler$22$2.visitLvalue(UnitCompiler.java:6418)
>>         at
>> org.codehaus.janino.UnitCompiler$22$2.visitLvalue(UnitCompiler.java:6414)
>>         at org.codehaus.janino.Java$Lvalue.accept(Java.java:4203)
>>         at
>> org.codehaus.janino.UnitCompiler$22.visitRvalue(UnitCompiler.java:6414)
>>         at
>> org.codehaus.janino.UnitCompiler$22.visitRvalue(UnitCompiler.java:6393)
>>         at org.codehaus.janino.Java$Rvalue.accept(Java.java:4171)
>>         at
>> org.codehaus.janino.UnitCompiler.getType(UnitCompiler.java:6393)
>>         at
>> org.codehaus.janino.UnitCompiler.findIMethod(UnitCompiler.java:8960)
>>         at
>> org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:4988)
>>         at
>> org.codehaus.janino.UnitCompiler.access$9100(UnitCompiler.java:218)
>>         at
>> org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4452)
>>         at
>> org.codehaus.janino.UnitCompiler$16.visitMethodInvocation(UnitCompiler.java:4425)
>>         at
>> org.codehaus.janino.Java$MethodInvocation.accept(Java.java:5128)
>>         at
>> org.codehaus.janino.UnitCompiler.compileGet(UnitCompiler.java:4425)
>>         at
>> org.codehaus.janino.UnitCompiler.compileGetValue(UnitCompiler.java:5589)
>>         at
>> org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:3810)
>>         at
>> org.codehaus.janino.UnitCompiler.access$5900(UnitCompiler.java:218)
>>         at
>> org.codehaus.janino.UnitCompiler$13.visitMethodInvocation(UnitCompiler.java:3788)
>>         at
>> org.codehaus.janino.UnitCompiler$13.visitMethodInvocation(UnitCompiler.java:3760)
>>         at
>> org.codehaus.janino.Java$MethodInvocation.accept(Java.java:5128)
>>         at
>> org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:3760)
>>         at
>> org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:2363)
>>         at
>> org.codehaus.janino.UnitCompiler.access$1800(UnitCompiler.java:218)
>>         at
>> org.codehaus.janino.UnitCompiler$6.visitExpressionStatement(UnitCompiler.java:1497)
>>         at
>> org.codehaus.janino.UnitCompiler$6.visitExpressionStatement(UnitCompiler.java:1490)
>>         at
>> org.codehaus.janino.Java$ExpressionStatement.accept(Java.java:2929)
>>         at
>> org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:1490)
>>         at
>> org.codehaus.janino.UnitCompiler.compileStatements(UnitCompiler.java:1570)
>>         at
>> org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:3398)
>>         at
>> org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1360)
>>         at
>> org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1333)
>>         at
>> org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:825)
>>         at
>> org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:435)
>>         at
>> org.codehaus.janino.UnitCompiler.access$400(UnitCompiler.java:218)
>>         at
>> org.codehaus.janino.UnitCompiler$2.visitPackageMemberClassDeclaration(UnitCompiler.java:414)
>>         at
>> org.codehaus.janino.UnitCompiler$2.visitPackageMemberClassDeclaration(UnitCompiler.java:409)
>>         at
>> org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java:1417)
>>         at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:409)
>>         at
>> org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:381)
>>         at
>> org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:237)
>>         at
>> org.codehaus.janino.SimpleCompiler.compileToClassLoader(SimpleCompiler.java:466)
>>         at
>> org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:216)
>>         at
>> org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:207)
>>         at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:80)
>>         at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:75)
>>         at
>> org.apache.flink.table.codegen.Compiler$class.compile(Compiler.scala:33)
>>         ... 9 more
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message