There are identical classes of java WebServices API & IMPL in those packages groups, only package names are different.
Which ones should I use in my code? I would prefer NON-com.sun.* as per java conventions, but still my dependencies ( e.g. Spring ) are using implementations from com.sun.* OR I can't find an implementation package in javax.xml
Does anyone have any experience on this?
javax.xml packages - the
com.sun packages are not part of the public Java API and may change between Java versions, or they don't even exist if you use someone else's than Sun's Java implementation.
I don't know what exactly you're trying to do, but you normally do not need to deal with the implementation packages directly. Usually there are factory classes and methods to get an instance of for example an XML parser, and your program does not need to know what implementation is used behind the scenes. For example, to get a SAX parser you do:
import javax.xml.parsers.*; SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser parser = factory.newSAXParser();