我开发了一个带有Spring Boot的Web应用程序,它使用Apache Spark来查询来自不同数据源(如Oracle)的数据.一开始,我计划运行应用程序而不使用spark-submit脚本提交它,但看起来我没有提交jar就无法连接到Master集群.我已经成功生成了一个超级jar,其中包含我正在使用的所有依赖项和子项目,但似乎Spark不喜欢Spring Boot应用程序.当我尝试提交应用时,spark会显示以下错误:
Exception in thread "main" java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.Log4jLoggerFactory loaded from file:/home/rojasmi1/spark/spark-1.4.0/assembly/target/scala-2.10/spark-assembly-1.4.0-hadoop2.2.0.jar). If you are using Weblogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml Object of class [org.slf4j.impl.Log4jLoggerFactory] must be an instance of class ch.qos.logback.classic.LoggerContext
at org.springframework.util.Assert.isInstanceOf(Assert.java:339)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:151)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLogger(LogbackLoggingSystem.java:143)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:89)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationStartedEvent(LoggingApplicationListener.java:152)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:100)
at org.springframework.boot.context.event.EventPublishingRunListener.started(EventPublishingRunListener.java:54)
at …Run Code Online (Sandbox Code Playgroud) 有没有巧合的人知道如何清空我正在开发的iOS应用程序的缓存内存,在它进入后台的那一刻(applicationDidEnterBackground)?我已经调查了NSCache,但我仍然无法理解如何检索缓存基本上删除/释放它?
我正在创建一个iOS应用程序,其中我有以下要求:应用程序应该在第一次启动时显示登录屏幕,并且当应用程序从后台到前台时也必须显示该屏幕,以防它具有在运行时被发送到后台.
我已经处理过两种情况下的屏幕显示.但是,当我这样做并且应用程序来自后台时,我单击texfield键入我的密码,应用程序被冻结,并且它在一个我不知道它意味着什么的线程中失败.
当应用程序来自这样的背景时,我在AppDelegate的applicationWillEnterForeground中调用屏幕显示:
self.window=[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
RoomRootViewController* room = [[RoomRootViewController alloc] init];
[[self window] setRootViewController:room];
[self.window makeKeyAndVisible];
Run Code Online (Sandbox Code Playgroud)
这是正确的方法吗?
非常感谢提前!我完全迷失了这个,因为我是iOS的新手,所以任何帮助都将非常感激.
附加在图像中,您可以看到应用程序失败的位置. 

我对 Spark 非常陌生,我有一个查询可以从两个 Oracle 表中获取数据。这些表必须由一个字段连接,它可以很好地与下面的代码一起使用。但是,我需要像在 Oracle“where”子句中一样应用过滤器。例如,带上年龄在 25 到 50 岁之间的员工。我还必须应用 GroupBy 过滤器并使用 OrderBy 对最终结果进行排序。问题是唯一正确执行的操作是从表中检索所有数据以及它们之间的连接。其余的过滤器根本没有应用,我不知道为什么。你能帮我解决这个问题吗?我确定我遗漏了一些东西,因为没有得到编译错误。数据加载正常,但“where”子句似乎对数据没有任何影响,尽管有些员工的年龄在 25 到 50 岁之间。
public static JavaRDD<Row> getResultsFromQuery(String connectionUrl) {
JavaSparkContext sparkContext = new JavaSparkContext(new SparkConf()
.setAppName("SparkJdbcDs").setMaster("local"));
SQLContext sqlContext = new SQLContext(sparkContext);
Map<String, String> options = new HashMap<>();
options.put("driver", "oracle.jdbc.OracleDriver");
options.put("url", connectionUrl);
options.put("dbtable", "EMPLOYEE");
DataFrameReader dataFrameReader = sqlContext.read().format("jdbc")
.options(options);
DataFrame dataFrameFirstTable = dataFrameReader.load();
options.put("dbtable", "DEPARTMENT");
dataFrameReader = sqlContext.read().format("jdbc").options(options);
DataFrame dataFrameSecondTable = dataFrameReader.load();
//JOIN. IT WORKS JUST FINE!!!
DataFrame resultingDataFrame = dataFrameFirstTable.join(dataFrameSecondTable,
"DEPARTMENTID");
//FILTERS. THEY DO NOT …Run Code Online (Sandbox Code Playgroud) 我正在建立一个基于Magnolia的网站,并尝试将模板脚本放入webapp中的templates文件夹中.但是,我无法在任何地方找到该文件夹.所有教程都说,如果我在我的环境中访问此目录magnolia-5.0/apache-tomcat-7.0.40/webapps/magnoliaAuthor,我可以得到它,但我还没有管理它.
我附上了我的magnoliaAuthor文件夹的屏幕截图,其中应该存在的每个文件夹实际上都是,除了我需要的唯一文件夹(模板).
希望你能帮助我.谢谢!
apache-spark ×2
ios ×2
java ×2
appdelegate ×1
caching ×1
dataframe ×1
jar ×1
magnolia ×1
nscache ×1
oracle ×1
spring-boot ×1
templates ×1
ubuntu ×1
xcode ×1