com.sun.xml.internal.ws.developer.JAXWSProperties not found at compile

后端 未结 1 1515
一个人的身影
一个人的身影 2021-02-13 13:38

We used the class JAXWSProperties from the com.sun.* package in the code in order to set timeout properties like this:

import com.sun.x         


        
相关标签:
1条回答
  • 2021-02-13 14:11

    I've just had pretty much the same problem while converting one of our projects to run under Maven.

    The solution I found, isn't really an ideal solution, in fact it's more of a "cludge" than a "fix," although it does run through the compiler OK. Like you I did a bit of research on this issue, and found a comment from Sun saying that these packages are hidden from the compiler, but are available to the JVM.

    So, the solution I found was to simply find the string to which the constant was pointing, and use that locally.

    In your case it would be:

    final static String CONNECT_TIMEOUT = "com.sun.xml.internal.ws.connect.timeout";
    ....
    Map<String, Object> ctxt = ((BindingProvider) port).getRequestContext();
    ctxt.put(CONNECT_TIMEOUT, 10000);
    

    As I mentioned, this isn't ideal, and can not be guaranteed to work in future compiler releases, so use with care.

    0 讨论(0)
提交回复
热议问题