Wednesday, April 4, 2012

WenLogic: EJB service ERROR: Two classes have the same XML type name

<Apr 4, 2012 3:39:04 PM BDST> <Error> <HTTP> <BEA-101216> <Servlet: "WSEE_SERVLET" 
failed to preload on startup in Web application: "/HelloEjbServiceBean".
javax.xml.ws.WebServiceException: Unable to create JAXBContext
at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:164)
at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:94)
at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:265)
at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:363)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:202)
Truncated. see log file for complete stacktrace

Caused By: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException:
1 counts of IllegalAnnotationExceptions
Two classes have the same XML type name ....

This is a common EJB error for the beginners like me..;)...Very often I forget the fact that EJB creates an XML type with the name [METHOD+"Response"] so there should not be any bean for service request/response with  this name.