geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jarek Gawor" <jga...@gmail.com>
Subject Re: does geronimo support RESTful Web Service with JAX-WS?
Date Tue, 02 Oct 2007 03:23:59 GMT
Yuan,

I was looking at this today and was able to replicate the problem you
saw. It looks like Geronimo did not handle HTTP GET correctly for such
web services. The spec is just not very clear on this topic. Anyway, I
opened a bug on that issue
(https://issues.apache.org/jira/browse/GERONIMO-3494) and wrote a test
case for it (http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/webservices-testsuite/jaxws-tests/jaxws-rest-war/).
Also, I just committed some fixes to trunk and branches/2.0 (so that
they will be included in the upcoming 2.0.2 release) that should make
this work better. There is still one issue that I have to look at. The
HTTP GET will only work if the Content-Type header is set to
"application/xml" (with Axis2).

Hope this helps,
Jarek

On 9/29/07, yuanyun <yuanyundg@163.com> wrote:
>
> Hi,Jarek
>
> Thanks for your response.
> I follow your instruction, and this link
> http://cwiki.apache.org/GMOxDOC20/simple-web-service-with-jax-ws.html.
> But I still can't make the sample work.
> When i access
> http://localhost:8080/jaxws-restful/addnumbers/num1/10/num2/20, it outputs
> the follwing error in server.log:
> ERROR [Axis2WebServiceContainer] Exception occurred while trying to invoke
> service method doService()
> org.apache.axis2.AxisFault: Cannot create DocumentElement without
> destination EPR
>         at
> org.apache.axis2.builder.XFormURLEncodedBuilder.processDocument(XFormURLEncodedBuilder.java:89)
>         at
> org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:160)
>         at
> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:111)
>         at
> org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:101)
>         at
> org.apache.geronimo.axis2.Axis2WebServiceContainer.processGETRequest(Axis2WebServiceContainer.java:307)
>         at
> org.apache.geronimo.axis2.Axis2WebServiceContainer.doService2(Axis2WebServiceContainer.java:243)
>         at
> org.apache.geronimo.axis2.Axis2WebServiceContainer.doService(Axis2WebServiceContainer.java:202)
>         at
> org.apache.geronimo.axis2.Axis2WebServiceContainer.invoke(Axis2WebServiceContainer.java:164)
>         at
> org.apache.geronimo.webservices.WebServiceContainerInvoker.service(WebServiceContainerInvoker.java:84)
>         at
> org.apache.geronimo.webservices.POJOWebServiceServlet.service(POJOWebServiceServlet.java:79)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>         at
> org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
>         at
> org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:351)
>         at
> org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>         at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
>         at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>         at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
>         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>         at java.lang.Thread.run(Unknown Source)
>
>         I also upload the application.
> http://www.nabble.com/file/p12953519/jaxws-restful.rar jaxws-restful.rar
>         I don't know whether there is anything i didn't do.
>         Thanks for any response in advance again.
>
> Yuan
>
>
> Jarek Gawor-2 wrote:
> >
> > Yuan,
> >
> > What's on that page should work but with some changes. For example,
> > you need to provide a slightly different web.xml descriptor. Try with
> > the following:
> >
> > <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
> >   <servlet>
> >     <servlet-name>restful-addnumbers</servlet-name>
> >     <servlet-class>restful.server.AddNumbersImpl</servlet-class>
> >     <load-on-startup>0</load-on-startup>
> >   </servlet>
> >   <servlet-mapping>
> >     <servlet-name>restful-addnumbers</servlet-name>
> >     <url-pattern>/addnumbers/*</url-pattern>
> >   </servlet-mapping>
> > </web-app>
> >
> > As to JSR 311, yes, we are thinking about it but right now we don't
> > have any concrete plans. As we've done with JAX-WS, most likely we
> > would work with projects such as Apache Axis2 or CXF and integrate
> > their JSR 311 implementations (assuming they will have one) into
> > Geronimo.
> >
> > Jarek
> >
> >
>
> --
> View this message in context: http://www.nabble.com/does-geronimo-support-RESTful-Web-Service-with-JAX-WS--tf4533415s134.html#a12953519
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>

Mime
View raw message