-
Jul 7th, 2012, 01:55 AM
#1
No adapter for endpoint in wpring web service
I have this problem in spring web services with jaxb.
java.lang.IllegalStateException: No adapter for endpoint [public java.lang.String com.msoftgp.hr.ws.HolidayEndpoint.handleHolidayReq uest(org.jdom.Element) throws java.lang.Exception]: Is your endpoint annotated with @Endpoint, or does it implement a supported interface like MessageHandler or PayloadEndpoint?
at org.springframework.ws.server.MessageDispatcher.ge tEndpointAdapter(MessageDispatcher.java:298)
at org.springframework.ws.server.MessageDispatcher.di spatch(MessageDispatcher.java:232)
at org.springframework.ws.server.MessageDispatcher.re ceive(MessageDispatcher.java:173)
at org.springframework.ws.transport.support.WebServic eMessageReceiverObjectSupport.handleConnection(Web ServiceMessageReceiverObjectSupport.java:88)
at org.springframework.ws.transport.http.WebServiceMe ssageReceiverHandlerAdapter.handle(WebServiceMessa geReceiverHandlerAdapter.java:59)
at org.springframework.ws.transport.http.MessageDispa tcherServlet.doService(MessageDispatcherServlet.ja va:221)
at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:789)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:722)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:562)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:395)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:250)
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:188)
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:166)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProce ssor.run(JIoEndpoint.java:302)
at java.util.concurrent.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)
112559 ["http-bio-8080"-exec-9] DEBUG org.springframework.ws.server.MessageTracing.sent - Sent response [SaajSoapMessage {http://schemas.xmlsoap.org/soap/envelope/}Fault] for request [SaajSoapMessage {http://localhost:8080/com.msoftgp.hr/hr/schemas}HolidayRequest]
112562 ["http-bio-8080"-exec-9] DEBUG org.springframework.ws.transport.http.MessageDispa tcherServlet - Successfully completed request
My spring-ws-servlet.xml is,
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:sws="http://www.springframework.org/schema/web-services"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...-beans-3.0.xsd
http://www.springframework.org/schema/web-services http://www.springframework.org/schem...rvices-2.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:component-scan base-package="com.msoftgp.hr"/>
<sws:annotation-driven/>
<sws:dynamic-wsdl id="holiday"
portTypeName="HumanResource"
locationUri="/holiday/"
targetNamespace="http://localhost:8080/com.msoftgp.hr/hr/definitions">
<sws:xsd location="/WEB-INF/hr.xsd"/>
</sws:dynamic-wsdl>
<bean class="org.springframework.ws.server.endpoint.adap ter.GenericMarshallingMethodEndpointAdapter">
<constructor-arg ref="marshaller"/>
</bean>
<bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r">
<property name="classesToBeBound">
<list>
<value>com.msoftgp.hr.model.Employee</value>
<value>com.msoftgp.hr.model.HolidayRequest</value>
</list>
</property>
</bean></beans>
My Endpoint is,
@Endpoint
public class HolidayEndpoint{
static final Logger logger=Logger.getLogger(HolidayEndpoint.class);
private static final String NAMESPACE_URI = "http://localhost:8080/com.msoftgp.hr/hr/schemas";
private XPath startDateExpression;
private XPath endDateExpression;
private XPath nameExpression;
private XPath numberExpression;
@Autowired
private HumanResourceService humanResourceService;
@Autowired
public HolidayEndpoint(HumanResourceService humanResourceService)
throws JDOMException, IOException {
BasicConfigurator.configure();
this.humanResourceService = humanResourceService;
logger.info("inside holiday endpoint");
Namespace namespace = Namespace.getNamespace("hr", NAMESPACE_URI);
startDateExpression = XPath.newInstance("//hr:StartDate");
startDateExpression.addNamespace(namespace);
...
}
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "HolidayRequest")
@ResponsePayload
public String handleHolidayRequest(@RequestPayload Element holidayRequest)
throws Exception {
...
}
Any idea?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules