小编Sre*_*ddy的帖子

java.lang.ClassNotFoundException:javax.net.ssl.SSLSocketFactory在WildFly8.2.0上使用JAVA 8时使用rest easy

我使用rest很容易从第三方URL获取和发布数据,当我使用下面的代码调用get服务时,我得到了ClassNotFoundException"javax.net.ssl.SSLSocketFactory"

final ClientRequest request = createRequest(url,acceptType,consumesType,body);
final byte[] encodedCredentials = (userName + ":" + password)
            .getBytes();
    final String encodedAuto = Base64.encodeBytes(encodedCredentials);
    request.header("Authorization", "Basic " + encodedAuto);
try {
        request.addAuthenticationHeaders(request, userName,
                password);
        response = request.get(String.class);
        if (response != null) {
            logger.info("Status of the REST Call:"
                    + response.getStatus());
        }
    } catch (final Exception e) {
        e.printStackTrace();
        logger.error("Failed the get the data from PM", e);
    }
Run Code Online (Sandbox Code Playgroud)

createRequest方法如下所示

public ClientRequest createRequest(final String urlString,
        final String acceptType, final String consumesType,
        final String body) {
    final …
Run Code Online (Sandbox Code Playgroud)

seam resteasy wildfly wildfly-8

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

标签 统计

resteasy ×1

seam ×1

wildfly ×1

wildfly-8 ×1