我遇到了我的Maven POM文件的问题,它无法找到火花依赖并且返回错误:无法读取org.apache.spark的工件描述符:spark-streaming-kafka_2.10:jar:1.2.1
我已经确认它不是任何公司防火墙的问题,因为所有其他依赖项都正确加载,只是这个.
我也能够在我的maven设置中确认它正试图从以下回购中提取.我尝试删除本地计算机上的.m2 repo以重新加载它,仍然没有骰子.
http://repo.maven.apache.org/maven2/org/apache/spark/spark-streaming-kafka_2.10/1.2.1/
下面是我的pom文件
<groupId>my.group.id</groupId>
<artifactId>sentiment</artifactId>
<version>1.0-SNAPSHOT</version>
<name>NPITWITTER</name>
<properties>
</properties>
<dependencies>
<dependency>
<groupId>com.sparkjava</groupId>
<artifactId>spark-core</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-streaming-kafka_2.10</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.10</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-streaming_2.10</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-hive_2.10</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_2.10</artifactId>
<version>1.2.1</version>
</dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)
我试图从互联网上下载多个文件,等待所有这些文件完成.这是我正在运行的C#控制台应用程序,因此不需要任何进度条事件处理程序.但是,即使尚未下载所有文件,它目前仍继续执行代码.
您将如何等待所有异步下载文件完成.
private void DownloadMultipleFiles(List<DocumentObject> doclist)
{
foreach(var value in doclist){
try
{
using (WebClient webClient = new WebClient())
{
string downloadToDirectory = @Resources.defaultDirectory + value.docName;
webClient.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
webClient.DownloadFileCompleted += client_DownloadFileCompleted;
webClient.DownloadFileAsync(new Uri(value.docUrl), @downloadToDirectory);
//Add them to the local
Context.listOfLocalDirectories.Add(downloadToDirectory);
}
}
catch (Exception)
{
Errors.printError("Failed to download File: " + value.docName);
}
}
}
Run Code Online (Sandbox Code Playgroud) 我使用客户端对象模型方法C#,以从包含子文件夹的文档库中检索所有列表项.我检查了MSDN文档,我被困在为什么我无法获得字段属性,或者我甚至做到了这一点.
NetworkCredential credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
ClientContext clientcontext = new ClientContext(Resources.defaultSPSite);
clientcontext.Credentials = credentials;
//Load Libraries from SharePoint
//Web site = clientcontext.Web;
clientcontext.Load(clientcontext.Web.Lists);
clientcontext.ExecuteQuery();
//List sharedDocumentsList = clientcontext.Web.Lists.GetByTitle("TestLDOCS");
//CamlQuery camlQuery = new CamlQuery();
//camlQuery.ViewXml = @"<View Scope='Recursive'><Query></Query></View>";
foreach (List list in clientcontext.Web.Lists)
{
clientcontext.Load(list);
clientcontext.ExecuteQuery();
//list.TemplateFeatureId.ToString().Equals("") &&
string baseType = list.BaseType.ToString();
string listTitle = list.Title.ToString();
if (list.BaseType.ToString().Equals("DocumentLibrary", StringComparison.InvariantCultureIgnoreCase) && list.Title.ToString().Equals("TestLDOCS", StringComparison.InvariantCultureIgnoreCase))
{
foreach (Folder subFolder in list.RootFolder.Folders)
{
foreach (File f in subFolder.Files)
{
Console.WriteLine((string) f.Title);
}
}
}
}
} …Run Code Online (Sandbox Code Playgroud) 我试图通过指定该数组的路径来弄清楚如何更改JSON数组中的现有对象.
问题是我不知道如何指定数组的路径,以便可以更改它.我在那里尝试的每个方法都没有关于如何更改ObjectNode中的数组的示例.
这是我现在的代码,在其中我尝试通过指针表示法指定数组的路径来获取和更改数组,但是,这总是不返回数组:
构建POJO类不是一种选择.
我的json结构中的数组如下:
{
RESULTS: {
ATTACHMENTS: {
ATTACHMENT: [{object}]
}
}
}
Run Code Online (Sandbox Code Playgroud)
码:
private JsonNode attachmentConversion(JsonNode object){
final String ATTACHMENT_POINTER = "/RESULTS/ATTACHMENTS/ATTACHMENT"; //Path to the array
ObjectNode OUTPUT = object.deepCopy();
OUTPUT.remove("DETAILS");
//Validate is an array - It properly fetches the array
if(object.at(ATTACHMENT_POINTER).isArray()){
int counter=0;
//Loop through attachment array - It properly fethes each object in the array
for(final JsonNode objNode : object.at(ATTACHMENT_POINTER)){
ObjectNode objectNode = objNode.deepCopy();
OUTPUT.withArray(ATTACHMENT_POINTER) //HERE IS THE PROBLEM - How do I specify the …Run Code Online (Sandbox Code Playgroud) 我只是设法构建了一些javascript代码,以确保多个滑块的最大值不超过24.
问题是当我尝试在jquery mobile中的多页模板中使用它时,它只适用于第一页,并且无法检查通过多页模板加载的第二页.
这是我的jsFiddle,可以更好地了解情况
[JsFiddle示例](http://jsfiddle.net/WEewU/20/
第一页有效,第二页没有.
我正在努力确保页面上的任意数量的滑块不超过24小时.然后在jquery mobile中的所有多页面模板中使用此代码.
完整代码
<!DOCTYPE html>
Run Code Online (Sandbox Code Playgroud)
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0-alpha.1/jquery.mobile-1.2.0-alpha.1.min.css"
/>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0-alpha.1/jquery.mobile-1.2.0-alpha.1.min.js"></script>
</head>
<body>
<form>
<!-- Home Page-->
<div data-role="page" id="home">
<div data-role="header" data-position="fixed" data-id="myheader">
<h1>test</h1>
</div>
<!-- /header -->
<div data-role="content">
<ul id="sliders1">
<li>
<input type="range" id="slider" class="value" name="slider1" value="0"
min="0" max="24" data-highlight="true" />
</li>
<li>
<input type="range" class="value" id="slider" name="slider2" value="0"
min="0" max="24" data-highlight="true" />
</li>
<li>
<input type="range" class="value" id="slider" name="slider3" value="0"
min="0" max="24" data-highlight="true" />
</li>
</ul> …Run Code Online (Sandbox Code Playgroud) 在提交复制并粘贴到下面的 Spark 应用程序时,我遇到了以下错误的问题。我首先对这个问题进行了一些谷歌搜索,并确定这可能是一个签名 jar 的问题,该签名 jar 是作为我的 jar 构建过程的依赖项加载的。因此,我更改了 POM 以过滤并将其从依赖项中删除。然而,即使在我这样做之后,jar 似乎仍然报告无效的签名文件摘要。
我正在通过 IntelliJ IDE 通过 Build > Build Artifacts 构建我的 jar。
我通过文件 > 项目结构 > 工件 > 提取到目标 Jar 创建了我的工件。
有没有人在 Maven 和 intellij IDE 中编译了 Spark 应用程序,并为我提供了如何正确执行此操作的步骤?
java.lang.SecurityException: Invalid signature file digest for Manifest main att ributes
at sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVeri fier.java:286)
at sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier .java:239)
at java.util.jar.JarVerifier.processEntry(JarVerifier.java:307)
at java.util.jar.JarVerifier.update(JarVerifier.java:218)
at java.util.jar.JarFile.initializeVerifier(JarFile.java:345)
at java.util.jar.JarFile.getInputStream(JarFile.java:412)
at sun.misc.JarIndex.getJarIndex(JarIndex.java:137)
at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:674)
at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:666)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.URLClassPath$JarLoader.ensureOpen(URLClassPath.java:665)
at sun.misc.URLClassPath$JarLoader.<init>(URLClassPath.java:638)
at sun.misc.URLClassPath$3.run(URLClassPath.java:366)
at sun.misc.URLClassPath$3.run(URLClassPath.java:356) …Run Code Online (Sandbox Code Playgroud) 我正在尝试测试使用标准 Spring Security API 保护的 web api。我已经通过实现 UserDetailService 实现了我自己的用户身份验证服务。但是,每当我登录到我的应用程序时,/login api 都会不断返回 302 重定向。我通过手动测试良好的凭据和错误的凭据来验证我的登录页面是否正常工作,并且根据凭据是否正确,它确实正确地对主页进行了正确的身份验证,但是它仍然为 /login 返回了 302。我想知道为什么 Spring/Thymeleaf 在执行 /login 请求时会返回 302 重定向。这阻止了我在使用 Spring Security 锁定时测试任何受保护端点的能力。
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(securedEnabled = true)
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private UserDetailsService userDetailsService;
@Bean
public BCryptPasswordEncoder bCryptPasswordEncoder() {
return new BCryptPasswordEncoder();
}
@Bean
public JwtTokenFilter jwtTokenFilter() {
return new JwtTokenFilter();
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.csrf()
.disable()
.cors()
.and()
.authorizeRequests().antMatchers("/profiles/**","/img/**","/resources","/v2/**","/users", "/login", "/error/**", "/keepalive", "/register").permitAll()
.anyRequest().authenticated()
.and()
.formLogin()
.loginPage("/login").permitAll() …Run Code Online (Sandbox Code Playgroud) java ×3
apache-spark ×2
maven ×2
apache-kafka ×1
async-await ×1
c# ×1
download ×1
jackson ×1
javascript ×1
jquery ×1
sharepoint ×1
spring ×1
spring-boot ×1
spring-mvc ×1