masijade 1,351 Industrious Poster Team Colleague Featured Poster

I am attempting to run a junit test against a JAX-WS service method
using a simple client class and compiled generated sources from
ws-import.

When the test is run through surefire while doing either test or install
I get the error

java.lang.NoSuchMethodError:
com.sun.xml.ws.api.model.SEIModel.getJAXBContext()Lcom/sun/xml/bind/api/JAXBRIContext;

but when I inspect the xml in the surefire reports directory and use
java and junit directly on the command line using the classpath and
bootclasspath outlined in the xml file (and, of course, the same version
of junit and the same version of java) the test is successful.

Anyone have an idea of what the problem might be, or how it might be overcome?

P.S. "using the same classpath, etc" obviously means that I am using the same versions of all of the components as they are all pulled from the repository and the classpath points directly to the repository, the only things not included are whatever jars and the like used for the Junit4Provider and the other elements of surefire. My only guess is that one of these jars (the surefire jars, that is) also contains the above mentioned class, or includes another jar that contains it, in a version that is not compatible with the other JAX-XXX jars (i.e. a jaxb version that is not compatible with JAX-WS 2.2).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.