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

China☆狼群 提交于 2020-04-30 07:49:38

问题


I can't resolve this problem, i try to do import com.sun.xml.internal.ws.client.ClientTransportException but i can't import it.

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)

回答1:


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

Really though, you'll want to use the publicly available parts of the API, not the internal.




回答2:


You should check WSDL url is a valid or not It means, in Web service client class. 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. 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




回答3:


You can use jaxws-rt.jar for this purpose. rt.jar in jre system library will restrict compiler to access some of its packages.



来源:https://stackoverflow.com/questions/13632398/import-com-sun-xml-internal-ws-client-clienttransportexception-cant-read-this

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!