javaEE javax.xml.bind.MarshalException

Posted by sandeep on Stack Overflow See other posts from Stack Overflow or by sandeep
Published on 2010-05-09T01:38:27Z Indexed on 2010/05/09 4:18 UTC
Read the original article Hit count: 338

Filed under:
|
|

Hi, I am getting javax.xml.bind.MarshalException error. I am sending List from my webservice to the backingbean and I have this error. Here is my code:

Errors WARNING: invocation error on ejb endpoint Login_webservice at /Login_webserviceService/Login_webservice : javax.xml.bind.MarshalException - with linked exception: [javax.xml.bind.JAXBException: class JPA.Cantable nor any of its super class is known to this context.] javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException - with linked exception: [javax.xml.bind.JAXBException: class JPA.Cantable nor any of its super class is known to this context.] at com.sun.xml.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.java:325) at com.sun.xml.ws.message.AbstractMessageImpl.writeTo(AbstractMessageImpl.java:142) at com.sun.xml.ws.encoding.StreamSOAPCodec.encode(StreamSOAPCodec.java:109) at com.sun.xml.ws.encoding.SOAPBindingCodec.encode(SOAPBindingCodec.java:278) at com.sun.xml.ws.transport.http.HttpAdapter.encodePacket(HttpAdapter.java:380) at com.sun.xml.ws.transport.http.HttpAdapter.access$100(HttpAdapter.java:92) at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:525) at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:285) at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:143) at org.glassfish.webservices.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:116) at org.glassfish.webservices.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:87) at org.glassfish.webservices.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:196) at org.glassfish.webservices.EjbWebServiceServlet.service(EjbWebServiceServlet.java:127)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

Backing bean

@WebServiceRef(wsdlLocation = "http://localhost:26565/Login_webserviceService/Login_webservice?WSDL")
public String login() {
    System.out.println("Login Phase entered");
    int result = 0;
    List list;
    List finalList = null;
    try {
        Weblogin.LoginWebserviceService service = new Weblogin.LoginWebserviceService();
        Weblogin.LoginWebservice port = service.getLoginWebservicePort();
        result = port.login(voterID, password);
        Weblogin.LoginWebservice port1 = service.getLoginWebservicePort();
        list = port1.candDetails(1);
        finalList = list;
        this.setList(finalList);
    } catch (Exception e) {
        e.printStackTrace();
    }
    if (result == 1)
        return "polling";
    else
        return "login";
}

Webservice

public List candDetails(int pollEvent) {
    List resultList = null;
    List finalList = null;
    try {
        if (pollEvent == 1) {
            resultList = em.createNamedQuery("Cantable.findAll").getResultList();
            finalList = resultList;
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    return resultList;
}

© Stack Overflow or respective owner

Related posts about java-ee

Related posts about jsf