小编bbr*_*no5的帖子

org.apache.http.ssl.TrustStrategy上的ClassNotFoundException

我正在尝试运行一个发出HTTP/HTTPS POST请求的插件.在它上面声明了所需的依赖关系,即httpclienthttpcore.我分别使用版本4.5.3和4.4.6.尽管导入正确(我的意思是),我在执行时遇到了这个错误:

Caused by: java.lang.NoClassDefFoundError: 
org/apache/http/ssl/TrustStrategy
25.06 19:59:12 [Server] INFO at 
com.b5team.postrequest.Main.onCommand(Main.java:77) ~[?:?]
25.06 19:59:12 [Server] INFO at 
org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~
[Spigot.jar:git-Spigot-3fb9445-6e3cec8]
25.06 19:59:12 [Server] INFO ... 10 more
25.06 19:59:12 [Server] INFO Caused by: 
java.lang.ClassNotFoundException: org.apache.http.ssl.TrustStrategy
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

package com.b5team.postrequest;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;

import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import …
Run Code Online (Sandbox Code Playgroud)

java httpclient minecraft bukkit apache-httpclient-4.x

6
推荐指数
1
解决办法
1万
查看次数

错误:类不是抽象的,不会覆盖抽象方法

好吧,我正在尝试为Bukkit/Spigot编译一个java插件,但是我收到以下错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project Websend: Compilation failure
[ERROR] /home/bruno/spigot/Websend/src/main/java/com/github/websend/WebsendPlayerCommandSender.java:[24,7] error: WebsendPlayerCommandSender is not abstract and does not override abstract method sendTitle(String,String,int,int,int) in Player
Run Code Online (Sandbox Code Playgroud)

文件的各个部分是错误(我的意思):

public class WebsendPlayerCommandSender implements Player {
/* This class allows tapping into command output from plugins
 * if the output is sent through the commandsender.
 * Note to anyone having compilation problems: Compile against Bukkit, not CraftBukkit.
 *
 * Tap this method(1.6.4): sendRawMessage, sendMessage(String), sendMessage(String[])
 */

    private final Player baseObject; …
Run Code Online (Sandbox Code Playgroud)

java plugins minecraft bukkit

1
推荐指数
1
解决办法
5414
查看次数