【presto】presto编译报错整理(大全)

问题一:

报错信息:

1) Explicit bindings are required and com.facebook.presto.execution.TaskManager is not explicitly bound.
  while locating com.facebook.presto.execution.TaskManager
    for the 1st parameter of com.facebook.presto.server.GracefulShutdownHandler.<init>(GracefulShutdownHandler.java:65)
  at com.facebook.presto.server.GracefulShutdownModule.setup(GracefulShutdownModule.java:27)

2) Explicit bindings are required and com.facebook.presto.execution.TaskManagerConfig is not explicitly bound.
  while locating com.facebook.presto.execution.TaskManagerConfig
    for the 2nd parameter of com.facebook.presto.server.ServerMainModule.createAsyncHttpResponseExecutor(ServerMainModule.java:481)
  at com.facebook.presto.server.ServerMainModule.createAsyncHttpResponseExecutor(ServerMainModule.java:481)

3) Explicit bindings are required and com.facebook.presto.execution.TaskManagerConfig is not explicitly bound.
  while locating com.facebook.presto.execution.TaskManagerConfig
    for the 1st parameter of com.facebook.presto.server.ServerMainModule.createAsyncHttpTimeoutExecutor(ServerMainModule.java:489)
  at com.facebook.presto.server.ServerMainModule.createAsyncHttpTimeoutExecutor(ServerMainModule.java:489)

4) Explicit bindings are required and com.facebook.presto.operator.ExchangeClientConfig is not explicitly bound.
  while locating com.facebook.presto.operator.ExchangeClientConfig
    for the 1st parameter of com.facebook.presto.server.ServerMainModule.createExchangeExecutor(ServerMainModule.java:465)
  at com.facebook.presto.server.ServerMainModule.createExchangeExecutor(ServerMainModule.java:465)

5) Explicit bindings are required and com.facebook.presto.transaction.TransactionManager is not explicitly bound.
  while locating com.facebook.presto.transaction.TransactionManager
    for the 1st parameter of com.facebook.presto.security.AccessControlManager.<init>(AccessControlManager.java:79)
  at com.facebook.presto.security.AccessControlModule.configure(AccessControlModule.java:28)

6) Error: Invalid configuration property node.environment: may not be null (for class io.airlift.node.NodeConfig.environment)

7) Error: Invalid configuration property presto.version: presto.version must be provided when it cannot be automatically determined (for class com.facebook.presto.server.ServerConfig.prestoVersion)

7 errors
com.google.inject.CreationException: Unable to create injector, see the following errors:

1) Explicit bindings are required and com.facebook.presto.execution.TaskManager is not explicitly bound.
  while locating com.facebook.presto.execution.TaskManager
    for the 1st parameter of com.facebook.presto.server.GracefulShutdownHandler.<init>(GracefulShutdownHandler.java:65)
  at com.facebook.presto.server.GracefulShutdownModule.setup(GracefulShutdownModule.java:27)

2) Explicit bindings are required and com.facebook.presto.execution.TaskManagerConfig is not explicitly bound.
  while locating com.facebook.presto.execution.TaskManagerConfig
    for the 2nd parameter of com.facebook.presto.server.ServerMainModule.createAsyncHttpResponseExecutor(ServerMainModule.java:481)
  at com.facebook.presto.server.ServerMainModule.createAsyncHttpResponseExecutor(ServerMainModule.java:481)

3) Explicit bindings are required and com.facebook.presto.execution.TaskManagerConfig is not explicitly bound.
  while locating com.facebook.presto.execution.TaskManagerConfig
    for the 1st parameter of com.facebook.presto.server.ServerMainModule.createAsyncHttpTimeoutExecutor(ServerMainModule.java:489)
  at com.facebook.presto.server.ServerMainModule.createAsyncHttpTimeoutExecutor(ServerMainModule.java:489)

4) Explicit bindings are required and com.facebook.presto.operator.ExchangeClientConfig is not explicitly bound.
  while locating com.facebook.presto.operator.ExchangeClientConfig
    for the 1st parameter of com.facebook.presto.server.ServerMainModule.createExchangeExecutor(ServerMainModule.java:465)
  at com.facebook.presto.server.ServerMainModule.createExchangeExecutor(ServerMainModule.java:465)

5) Explicit bindings are required and com.facebook.presto.transaction.TransactionManager is not explicitly bound.
  while locating com.facebook.presto.transaction.TransactionManager
    for the 1st parameter of com.facebook.presto.security.AccessControlManager.<init>(AccessControlManager.java:79)
  at com.facebook.presto.security.AccessControlModule.configure(AccessControlModule.java:28)

6) Error: Invalid configuration property node.environment: may not be null (for class io.airlift.node.NodeConfig.environment)

7) Error: Invalid configuration property presto.version: presto.version must be provided when it cannot be automatically determined (for class com.facebook.presto.server.ServerConfig.prestoVersion)

7 errors
	at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:543)
	at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:159)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:106)
	at com.google.inject.Guice.createInjector(Guice.java:87)
	at io.airlift.bootstrap.Bootstrap.initialize(Bootstrap.java:240)
	at com.facebook.presto.server.PrestoServer.run(PrestoServer.java:127)
	at com.facebook.presto.server.PrestoServer.main(PrestoServer.java:73)



Process finished with exit code 1

问题原因

没有正确编写对 VM option位置。

下面是我最先写的内容

-ea -XX:+UseG1GC -XX:G1HeapRegionSize=32M -XX:+UseGCOverheadLimit -XX:+ExplicitGCInvokesConcurrent -Xmx2G -Dconfig=etc/config.properties -Dlog.levels-file=etc/log.properties

在这里插入图片描述

解决方案

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述


问题二:

问题描述:

在运行项目的时候,出现例如在presto-parser模块Cannot resolve symbol 'SqlBaseParser缺少代码的错误,这是因为源码不带anltr4的生成代码。可以在根目录运行生成anltr4代码的命令。

解决方案:

mvn antlr4:antlr4

在执行命令完成后,错误依旧没有消失,我们可以看看项目的结构。File -> Project Structure -> Modules -> presto-parser,将presto-parser的target -> generated-sources ->anltr4设置为Sources

在这里插入图片描述


问题三:

报错信息:

[ERROR] Failed to execute goal pl.project13.maven:git-commit-id-plugin:2.2.0:revision (default) on project adam-cli_2.10: .git directory could not be found! Please specify a valid [dotGitDirectory] in your pom.xml -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:

解决方案:

pom.xml 文件添加如下内容:

<plugin>
    <groupId>pl.project13.maven</groupId>
    <artifactId>git-commit-id-plugin</artifactId>
    <configuration>
        <skip>true</skip>
    </configuration>
</plugin>

问题四:

编译presto 报错,报错内容如下:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:check (checkstyle) on project presto-hive-metastore: You have 1 Checkstyle violation. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :presto-hive-metastore
MacBook-Pro-2:presto hanzhe$ ./mvnw clean install -DskipTests

问题原因

原因是重写之后的代码不符合规范,maven-checkstyle-plugin检查失败,如果不打算根据presto的规范改的话。

解决方案

presto-root 工程下 修改pom.xml 文件

添加

        <air.check.skip-extended>true</air.check.skip-extended>

全部如下:

<properties>
        <air.main.basedir>${project.basedir}</air.main.basedir>

        <air.check.skip-spotbugs>true</air.check.skip-spotbugs>
        <air.check.skip-pmd>true</air.check.skip-pmd>
        <air.check.skip-jacoco>true</air.check.skip-jacoco>
        <air.check.skip-extended>true</air.check.skip-extended>
        <air.checkstyle.config-file>src/checkstyle/presto-checks.xml</air.checkstyle.config-file>

        <air.java.version>1.8.0-151</air.java.version>
        <air.maven.version>3.3.9</air.maven.version>
</properties>     

问题四

报错内容

Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.1:analyze-only (default) on project presto-main: Dependency problems found -> [Help 1]

解决方法

  1. 用mvn 命令分析依赖问题
 mvn dependency:analyze

经过打印日志发现org.glassfish.jersey.core:jersey-common依赖问题,则在presto-main下的pom.xml里面build-》plugins-》标签下增加:

<plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-dependency-plugin</artifactId>
      <configuration>
           <!-- TODO: Remove this once fixed -->
           <ignoredDependencies>
                <ignoredDependency>org.glassfish.jersey.core:jersey-common:jar</ignoredDependency>
           </ignoredDependencies>
      </configuration>
</plugin>
posted @ 2022-11-10 19:24  彬在俊  阅读(405)  评论(0编辑  收藏  举报