com.sun.xml.internal.ws.client does not exist
java
Solution
According to this FAQ it's a bad practice to directly call 'sun' packages. When I ran into the same problem it was fixed by catching `javax.xml.ws.WebServiceException` instead (as sugested by artbristol).
Problem
I'm trying to catch ClientTransportException and my program fails on compilation stage with the following exception ``` [ERROR]\workspace\rates\java\service\bundle1\src\main\java\com\connector\ws\TestClass1.java:[72,70] package com.sun.xml.internal.ws.client does not exist ``` As I know this package is from rt.jar and exist in jre If I add @SuppressWarnings("restriction") it compiles from Eclipse Maven Plugin, but not from IntelliJ Idea(via maven) or command line neither. When I remove @SuppressWarnings Eclipse show the following warning ``` Access restriction: The type ClientTransportException is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar ``` I've found similar question but it's answer isn't clear enough for me cause I can this class in rt.jar and my IntelliJ Idea can see it either. Can someone explain such behavior and possible solution for it?