You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by yuanyun <yu...@163.com> on 2007/09/28 11:59:31 UTC

does geronimo support RESTful Web Service with JAX-WS?

Hi, does geronimo support RESTful Web Service with JAX-WS? 
when i follow this link-
http://weblogs.java.net/blog/kohlert/archive/2006/01/publishing_a_re.html
http://weblogs.java.net/blog/kohlert/archive/2006/01/publishing_a_re.html ,
 
and try to migrate it to geronimo,it can't work.
 i don't know how to configure it in geronimo. does anyone have any idea?
and whether geronimo has plans to implement JAX-RS (JSR 311).

Thanks for any response in advance.:clap:



Yuan
-- 
View this message in context: http://www.nabble.com/does-geronimo-support-RESTful-Web-Service-with-JAX-WS--tf4533415s134.html#a12937533
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.

Re: does geronimo support RESTful Web Service with JAX-WS?

Posted by yuanyun <yu...@163.com>.
Hi Jarek :
   Thanks for your warmhearted response and also for the solutions to this
problem. 
   It's so kind of you, and i just can't wait to see and try geronimo 2.0.2
release):clap:
    Thanks again.
   
Yuan   

Jarek Gawor-2 wrote:
> 
> 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
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/does-geronimo-support-RESTful-Web-Service-with-JAX-WS--tf4533415s134.html#a13031534
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Re: does geronimo support RESTful Web Service with JAX-WS?

Posted by Jarek Gawor <jg...@gmail.com>.
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 <yu...@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.
>
>

Re: does geronimo support RESTful Web Service with JAX-WS?

Posted by yuanyun <yu...@163.com>.
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.


Re: does geronimo support RESTful Web Service with JAX-WS?

Posted by Jarek Gawor <jg...@gmail.com>.
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

On 9/28/07, yuanyun <yu...@163.com> wrote:
>  Hi, does geronimo support RESTful Web Service with JAX-WS?
> when i follow this link- http://weblogs.java.net/blog/kohlert/archive/2006/01/publishing_a_re.html,
> and try to migrate it to geronimo,it can't work.
>  i don't know how to configure it in geronimo. does anyone have any idea?
> and whether geronimo has plans to implement JAX-RS (JSR 311).
> Thanks for any response in advance.
>
>   Yuan
> ________________________________
 View this message in context: does geronimo support RESTful Web
Service with JAX-WS?
>  Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>