- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
同学们,大家好。我开发了一个基于sparkLauncher的应用程序,它运行一个可执行jar,其中有5个操作。每个操作取决于特定的变量。我有一个主hadoop集群spark2.3.0-hadoop2.6.5。用在它身上效果很好。我的部分工作代码:
private void runSparkJob(String pathToJar, final LocalDate startDate, final LocalDate endDate) {
if (executionInProgress.get()) {
LOGGER.warn("Execution already in progress");
return;
}
Process sparkProcess = null;
try {
LOGGER.info("Create SparkLauncher. SparkHome: [{}]. JarPath: [{}].", sparkHome, vmJarPath);
executionInProgress.set(true);
sparkProcess = new SparkLauncher()
.setAppName(activeOperationProfile)
.setSparkHome(sparkHome) //sparkHome folder on main cluster
.setAppResource(pathToJar) // jar with 5 operation
.setConf(SparkLauncher.DRIVER_EXTRA_JAVA_OPTIONS,
String.format("-Drunner.operation-profile=%1$s -Doperation.startDate=%2$s -Doperation.endDate=%3$s", activeOperationProfile, startDate,endDate))
.setConf(SparkLauncher.DRIVER_MEMORY, "12G")
.redirectToLog(LOGGER.getName())
.setMaster("yarn")
.launch();
sparkProcess.waitFor();
int exitCode = sparkProcess.exitValue();
if (exitCode != 0) {
throw new RuntimeException("Illegal exit code. Expected: [0]. Actual: [" + exitCode + "]");
}
} catch (IOException | InterruptedException e) {
LOGGER.error("Error occurred while running SparkApplication.", e);
throw new RuntimeException(e);
} finally {
if (sparkProcess != null && sparkProcess.isAlive()) {
LOGGER.warn("Process still alive. Try to kill");
sparkProcess.destroy();
}
executionInProgress.set(false);
}
}
我已经启动了一个docker容器,其中下载了spark 2.3.0-hadoop6。测试人员需要这个容器。 我将 master 更改为 .setMaster("local"),将新配置文件的路径添加到sparkHome、jarsWithOpertations 并打包没有阴影的 jar(尝试使用阴影,但它对我不起作用)。当我尝试运行我的 SparkLaunch 应用程序时,我现在遇到了一个异常:
2018-08-06 14:47:53,150 INFO [n.m.m.b.r.SparkBaseOperationsRunner.runSparkJob] 105 : Create SparkLauncher. SparkHome: [/opt/bigtv/spark/spark-2.3.0-bin-hadoop2.6]. JarPath: [/opt/bigtv/bin/multirating-bigdata-operations-MASTER-SNAPSHOT.jar]. 2018-08-06 14:47:54,905 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : 2018-08-06 14:47:54 WARN NativeCodeLoader:62 - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 2018-08-06 14:47:57,042 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : 2018-08-06 14:47:57 ERROR SpringApplication:842 - Application run failed 2018-08-06 14:47:57,043 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : java.lang.NoSuchMethodError: org.yaml.snakeyaml.Yaml.(Lorg/yaml/snakeyaml/constructor/BaseConstructor;Lorg/yaml/snakeyaml/representer/Representer;Lorg/yaml/snakeyaml/DumperOptions;Lorg/yaml/snakeyaml/LoaderOptions;Lorg/yaml/snakeyaml/resolver/Resolver;)V 2018-08-06 14:47:57,043 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.env.OriginTrackedYamlLoader.createYaml(OriginTrackedYamlLoader.java:70) 2018-08-06 14:47:57,043 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.beans.factory.config.YamlProcessor.process(YamlProcessor.java:139) 2018-08-06 14:47:57,044 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.env.OriginTrackedYamlLoader.load(OriginTrackedYamlLoader.java:75) 2018-08-06 14:47:57,044 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.env.YamlPropertySourceLoader.load(YamlPropertySourceLoader.java:50) 2018-08-06 14:47:57,044 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.loadDocuments(ConfigFileApplicationListener.java:547) 2018-08-06 14:47:57,044 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:517) 2018-08-06 14:47:57,045 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.loadForFileExtension(ConfigFileApplicationListener.java:496) 2018-08-06 14:47:57,045 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:464) 2018-08-06 14:47:57,045 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.lambda$null$6(ConfigFileApplicationListener.java:446) 2018-08-06 14:47:57,046 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at java.lang.Iterable.forEach(Iterable.java:75) 2018-08-06 14:47:57,046 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.lambda$load$7(ConfigFileApplicationListener.java:445) 2018-08-06 14:47:57,046 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at java.lang.Iterable.forEach(Iterable.java:75) 2018-08-06 14:47:57,046 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:442) 2018-08-06 14:47:57,046 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.context.config.ConfigFileApplicationListener$Loader.load(ConfigFileApplicationListener.java:330) 2018-08-06 14:47:57,047 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.context.config.ConfigFileApplicationListener.addPropertySources(ConfigFileApplicationListener.java:212) 2018-08-06 14:47:57,047 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.context.config.ConfigFileApplicationListener.postProcessEnvironment(ConfigFileApplicationListener.java:195) 2018-08-06 14:47:57,047 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEnvironmentPreparedEvent(ConfigFileApplicationListener.java:182) 2018-08-06 14:47:57,047 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.context.config.ConfigFileApplicationListener.onApplicationEvent(ConfigFileApplicationListener.java:168) 2018-08-06 14:47:57,048 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) 2018-08-06 14:47:57,048 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) 2018-08-06 14:47:57,048 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) 2018-08-06 14:47:57,048 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) 2018-08-06 14:47:57,049 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74) 2018-08-06 14:47:57,049 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) 2018-08-06 14:47:57,049 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:358) 2018-08-06 14:47:57,049 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.SpringApplication.run(SpringApplication.java:317) 2018-08-06 14:47:57,050 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) 2018-08-06 14:47:57,050 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) 2018-08-06 14:47:57,050 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at net.mediascope.multirating.bigdata.operations.OperationRunner.main(OperationRunner.java:21) 2018-08-06 14:47:57,050 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2018-08-06 14:47:57,050 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 2018-08-06 14:47:57,051 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2018-08-06 14:47:57,051 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at java.lang.reflect.Method.invoke(Method.java:498) 2018-08-06 14:47:57,051 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) 2018-08-06 14:47:57,051 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) 2018-08-06 14:47:57,052 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) 2018-08-06 14:47:57,052 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) 2018-08-06 14:47:57,052 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2018-08-06 14:47:57,052 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 2018-08-06 14:47:57,053 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2018-08-06 14:47:57,053 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at java.lang.reflect.Method.invoke(Method.java:498) 2018-08-06 14:47:57,053 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52) 2018-08-06 14:47:57,053 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:879) 2018-08-06 14:47:57,054 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:197) 2018-08-06 14:47:57,054 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:227) 2018-08-06 14:47:57,054 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:136) 2018-08-06 14:47:57,054 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala) 2018-08-06 14:47:57,058 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : 2018-08-06 14:47:57 INFO ShutdownHookManager:54 - Shutdown hook called 2018-08-06 14:47:57,060 INFO [o.a.spark.launcher.OutputRedirector.redirect] 63 : 2018-08-06 14:47:57 INFO ShutdownHookManager:54 - Deleting directory /tmp/spark-55b54924-e628-43fe-9e43-ed34d7f35a8b 2018-08-06 14:47:57,151 INFO [o.s.b.a.l.ConditionEvaluationReportLoggingListener.logAutoConfigurationReport] 101 :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
在我的项目中,我有来自 Spring 5.0 的 Snake yaml 1.19,没有其他依赖项。我无法理解问题是什么,也许当我将其放入 docker 容器手册时,除了 Spark 之外还需要安装其他东西。
来自模块的 Pom 和操作:
<dependencies>
<dependency>
<groupId>net.mediascope</groupId>
<artifactId>multirating-bigdata-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<!-- Data Base -->
<dependency>
<groupId>org.jdbi</groupId>
<artifactId>jdbi</artifactId>
<version>2.71</version>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc42</artifactId>
<version>4.2</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.janino</groupId>
<artifactId>commons-compiler</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.11</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>jtds</artifactId>
<version>1.3.1</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>local</id>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<profiles>
<profile>${profile.active}</profile>
</profiles>
<executable>true</executable>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>hadoop</id>
<build>
<!--Необходимо для адаптации Spring-Boot приложения под запуск через Spark-->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.provides</resource>
</transformer>
<transformer
implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer">
<resource>META-INF/spring.factories</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${start-class}</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>I
最佳答案
我已经找到解决方案了。Origin Spark 包有文件夹 jars,其中有 Snakeyml 1.15,我将其更改为 1.19,现在一切正常。
关于java - Spark 启动器。 java.lang.NoSuchMethodError : org. yaml.snakeyaml.Yaml.<init>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51710753/
我正在用来自JSON文件的一些数据填充Flutter中的列表。 但是,我的代码不断抛出异常"NoSuchMethodError (NoSuchMethodError: The method 'add'
通过eclipse运行Tomcat 7报错是: javax.servlet.ServletException: java.lang.NoSuchMethodError: org.eclipse.jdt
这是我的错误行: 这是我的代码: 最佳答案 final jobs= json.decode(response.body)['name_database_table']; 关于mobile - NoSu
很难说出这里问的是什么。这个问题是模棱两可的、模糊的、不完整的、过于宽泛的或修辞的,无法以目前的形式得到合理的回答。为了帮助澄清这个问题以便可以重新打开它,visit the help center
我已经被这个错误困扰了几个小时。。我的pom.xml。应用程序未启动。所有的Spring框架依赖于相同的版本,但仍然得到相同的错误。。更新。MVN依赖的结果:树。看起来这里一切都很好。
我得到: NoSuchMethodError: com.foo.SomeService.doSmth()Z 我是否正确理解这个'Z'意味着doSmth()方法的返回类型是 boolean 值?如果为
我在 Speed 类中引用 PlayerUtil.getMovementSpeed(player);,在我的 PlayerUtil 类中,我将方法定义为: public static double g
我得到: NoSuchMethodError: com.foo.SomeService.doSmth()Z 我是否正确理解这个 'Z' 意味着 doSmth() 方法的返回类型是 boolean 值?
我在使用 Spark 和 Scala 时遇到了一个奇怪的错误。我有一段代码声明了一个变量: var offset = 0 这会导致以下异常: java.lang.NoSuchMethodError:
我已经成功实现了 reflectionEquals 方法,其中包含一个排除字段列表。 return EqualsBuilder.reflectionEquals(this, obj, new Str
我正在使用 Spring 框架和 Maven 开发 Java Enterprise 应用程序。我正在为此学习一门类(class),并且一直坚持集成 Hibernate JPA。当我运行项目时,它返回以
I/flutter ( 8282): The following NoSuchMethodError was thrown building Meme(dirty, state: _MemeState
运行以下代码时出现 NoSuchMethodError - 我想从 JSON url 打印出轨道标题 - 我错过了什么吗? import 'dart:async'; import 'dart:conv
我正在做 Searchview flutter 中的例子 https://github.com/MageshPandian20/Flutter-SearchView 但我想对 进行更改子项类有一个 最
尝试从Eclipse中的简单Java程序连接到Hive时出现以下错误。看起来好像连接,然后引发此错误。我可以通过beeline在本地连接到Hive Thrift服务器,而不会出现问题。 两个libth
当我向安全资源发出请求时,会发生NoSuchMethodError。 基于基于Spring Boot 1.4.4的Grails 3.2.5的项目 AppConfig: @EnableWebSecuri
这个问题已经有答案了: Differences between Exception and Error (11 个回答) 已关闭 7 年前。 我的印象是 Exception 非常适合捕获所有可能的异常
祝大家有美好的一天!我使用 google Vision API,当我在 IntelliJ Idea 中运行我的程序时,它工作得很好,但是当我编译 jar 文件时,它在处理照片时给出错误 java.la
我一直在为这个问题苦苦挣扎。我正在开发一个包含很多包的 netbeans java 项目,起初我更改了 gui,但是当我运行代码时,它没有反射(reflect)任何更改,即使我在保存、清理、清理和编译
我一直在寻找问题的解决方案,但没有得到足够的答案。 我正在开发 Bukkit插件的更新系统。因此,我必须自己编写这些类的代码。但我一直想从 debug(String) 调用一个方法(具体来说: ano
我是一名优秀的程序员,十分优秀!