Getting JAXBException: <class> is not known to this context.

classic Classic list List threaded Threaded
1 message Options
kx
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Getting JAXBException: <class> is not known to this context.

kx
Hi,

I am trying to deploy a very simple JAXWS service using Axis2.war on tomcat server. The service is packaged in a jar, and placed under webapps\axis2\WEB-INF\servicejars\.

I keep getting the JAXBException : IntContainer is not known to this context.
However, the same service jar works just fine when used with AXIS2 binary distribution (using axis2server.bat).

Any help would be appreciated!

Following is the brief outline of the classes in the service jar:
1.
@WebService(...)
public interface EchoInteger {
        @WebMethod
        @WebResult(...)
        public int echo(@WebParam(...) IntContainer element);
}

2.
@WebService(...)
public class EchoIntegerImpl implements EchoInteger {
        public int echo(IntContainer element) {
                return element.x;
        }
}

3.
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(...)
@XmlType(...)
public class IntContainer {
        @XmlElement
        public int x;
}

P.S.: I do not encounter the issue when using primitive types as method arguments (e.g. using 'int element' instead of 'IntContainer element' in the above code, works...!)
Loading...