简体   繁体   English

导入com.sun.xml.internal.ws.client.ClientTransportException,无法读取此导入

[英]import com.sun.xml.internal.ws.client.ClientTransportException, can't read this import

I can't resolve this problem, i try to do import com.sun.xml.internal.ws.client.ClientTransportException but i can't import it. 我无法解决此问题,我尝试导入com.sun.xml.internal.ws.client.ClientTransportException,但无法导入。

Exception in thread "main" com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 404: Not Found

at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCode(HttpTransportPipe.java:296)

at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.createResponsePacket(HttpTransportPipe.java:245)

at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.j
ava:203)

at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:122)

at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:95)

at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:626)

at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:585)

at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:570)

at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:467)   

at com.sun.xml.internal.ws.client.Stub.process(Stub.java:308)

at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(SEIStub.java:146)

at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:98)

at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)

at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:129)

You shouldn't try to import the "internal" package. 您不应该尝试导入“内部”包。 It's not available by design. 它不是设计上可用的。

See this similar question for more details, and a way to override the missing import temporarily for testing, or if you have special requirements: com.sun.xml.internal.ws.client does not exist 有关更多详细信息,请参见类似的问题,以及一种临时覆盖缺少的导入以进行测试的方法,或者如果您有特殊要求,请执行以下操作: com.sun.xml.internal.ws.client不存在

Really though, you'll want to use the publicly available parts of the API, not the internal. 不过,实际上,您将要使用API​​的公开可用部分,而不是内部。

You should check WSDL url is a valid or not It means, in Web service client class. 您应该检查WSDL URL是否有效,这意味着在Web服务客户端类中。 see above code. 参见上面的代码。

static {
    URL url = null;
    WebServiceException e = null;
    try {
        url = new 
        URL("http://localhost:8084/SoapServer_test_4/CustomerService?wsdl");
    } catch (MalformedURLException ex) {
        e = new WebServiceException(ex);
    }
    CUSTOMERSERVICE_WSDL_LOCATION = url;
    CUSTOMERSERVICE_EXCEPTION = e;
}

in above code, check the WSDL url is a valid or not, or check WSDL is already hosted in that url. 在上面的代码中,检查WSDL URL是否有效,或者检查WSDL已经在该URL中托管。 if your wsdl file is in your local pc, check it run like below image you can see the wsdl url in your browser like this when you test the webservice 如果您的wsdl文件位于本地计算机中,请检查它是否如下面的图像所示运行, 当您测试网络服务时,您可以在浏览器中看到wsdl网址,如下所示

在此处输入图片说明

You can use jaxws-rt.jar for this purpose. 您可以为此目的使用jaxws-rt.jar rt.jar in jre system library will restrict compiler to access some of its packages. jre系统库中的rt.jar将限制编译器访问其某些软件包。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 JAX WS com.sun.xml.internal.ws.client.ClientTransportException:HTTP 传输错误:java.net.ConnectException:连接被拒绝 - JAX WS com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport error: java.net.ConnectException: Connection refused 线程“ main” com.sun.xml.internal.ws.client.ClientTransportException中的异常:服务器发送了HTTP状态代码502:代理错误 - Exception in thread “main” com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 502: Proxy Error com.sun.xml.internal.ws.client.ClientTransportException:HTTP传输错误:java.net.SocketException:连接重置 - com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport error: java.net.SocketException: Connection reset 连接到 web 服务导致 com.sun.xml.internal.ws.client.ClientTransportException:服务器发送 HTTP 状态码 200 - Connecting to webservice results in com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 200: OK Glassfish抛出com.sun.xml.ws.client.ClientTransportException:服务器发送了HTTP状态代码500:内部服务器错误 - Glassfish throws com.sun.xml.ws.client.ClientTransportException: The server sent HTTP status code 500: Internal Server Error com.sun.xml.ws.client.ClientTransportException:请求需要HTTP身份验证:未经授权 - com.sun.xml.ws.client.ClientTransportException: request requires HTTP authentication: Unauthorized com.sun.xml.ws.client.ClientTransportException:HTTP传输错误:java.lang.ClassCastException - com.sun.xml.ws.client.ClientTransportException: HTTP transport error: java.lang.ClassCastException com.sun.xml.internal.ws.client 不存在 - com.sun.xml.internal.ws.client does not exist 使用CXF从Java消耗Web服务会导致com.sun.xml.ws.client.ClientTransportException:服务器发送了HTTP状态代码200:确定 - Consuming webservice from java using CXF results in com.sun.xml.ws.client.ClientTransportException: The server sent HTTP status code 200: OK com.sun.xml.internal.ws.fault.ServerSOAPFaultException:客户端从服务器收到SOAP错误 - com.sun.xml.internal.ws.fault.ServerSOAPFaultException: Client received SOAP Fault from server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM