Chinaunix首页 | 论坛 | 博客
  • 博客访问: 868859
  • 博文数量: 322
  • 博客积分: 6688
  • 博客等级: 准将
  • 技术积分: 3626
  • 用 户 组: 普通用户
  • 注册时间: 2010-09-19 11:26
文章分类

全部博文(322)

文章存档

2013年(5)

2012年(66)

2011年(87)

2010年(164)

分类: 系统运维

2010-11-12 13:30:46

Details

Description:

My goal is to embed Jetty 7 with the ability to serve WebService (SOAP) requests.
All works fine when using Jetty 6 and the org.mortbay.jetty.j2se6 package from
jetty-contrib.

The supplied code was ported to Jetty 7 as follows:

  • replace org.mortbay.jetty imports with matching org.eclipse.jetty packages
    This made it compilable but there were exceptions thrown at runtime.

First there is an IllegalStateException

2009-11-06 17:37:22.182:DBUG::Container ContextHandlerCollection@29700391 + J2SE6ContextHandler@172fb0af@172fb0af/calc,null as handler
Exception in thread "main" com.sun.xml.internal.ws.server.ServerRtException: Server Runtime Error: java.lang.IllegalStateException: STARTED

JettyHttpServer.createContext() used to start the jettyContextHandler
in the original code. I disabled this. The state of the handler is already
started.

The next obstacle was the now volatile _handlers in
org.eclipse.jetty.server.handler._handlers. I tried to solve this by
using the first found Handler in the HandlerCollection in
JettyHttpServer.createContext(). This way a client doesn't get 404.

Nonetheless something still must be wrong. A SOAP request like this






3
4



adressing now returns


HTTP/1.1 302 Found
Location: htt://localhost:8080/calc/
Content-Length: 0
Server: Jetty(7.0.0.v20091005)

Using jetty6 lib (path lib/ in my sample Eclipse project) and using
the unmodified org.mortbay.jetty.j2se6 code I get the expected

HTTP/1.1 200 OK



7



If you like to regenerate the WSDL or XSD files you must have JAX-WS
somethere and use the generate-wsdl.sh script.

Thanks for looking into this
Axel

My goal is to embed Jetty 7 with the ability to serve WebService (SOAP) requests. All works fine when using Jetty 6 and the org.mortbay.jetty.j2se6 package from jetty-contrib. The supplied code was ported to Jetty 7 as follows:
  • replace org.mortbay.jetty imports with matching org.eclipse.jetty packages This made it compilable but there were exceptions thrown at runtime.
First there is an IllegalStateException — 2009-11-06 17:37:22.182:DBUG::Container ContextHandlerCollection@29700391 + J2SE6ContextHandler@172fb0af@172fb0af/calc,null as handler Exception in thread "main" com.sun.xml.internal.ws.server.ServerRtException: Server Runtime Error: java.lang.IllegalStateException: STARTED — JettyHttpServer.createContext() used to start the jettyContextHandler in the original code. I disabled this. The state of the handler is already started. The next obstacle was the now volatile _handlers in org.eclipse.jetty.server.handler._handlers. I tried to solve this by using the first found Handler in the HandlerCollection in JettyHttpServer.createContext(). This way a client doesn't get 404. Nonetheless something still must be wrong. A SOAP request like this — 3 4 — adressing now returns — HTTP/1.1 302 Found Location: htt://localhost:8080/calc/ Content-Length: 0 Server: Jetty(7.0.0.v20091005) — Using jetty6 lib (path lib/ in my sample Eclipse project) and using the unmodified org.mortbay.jetty.j2se6 code I get the expected — HTTP/1.1 200 OK 7 — If you like to regenerate the WSDL or XSD files you must have JAX-WS somethere and use the generate-wsdl.sh script. Thanks for looking into this Axel

Attachments

  1. jetty-jaxws2-spi.zip(12 kB)Ludovic Orban08/Nov/09 6:56 AM
  2. webservice-jetty7.zip(4.62 MB)Axel Rose06/Nov/09 10:54 AM
阅读(681) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~