泽西岛例外

时间:2013-04-24 17:41:51

标签: java jersey

有谁知道这个例外意味着什么?我正在使用GWT - Java 1.7。

控制台输出:

[WARN] failed jersey-servlet
javax.servlet.ServletException: com.sun.jersey.spi.inject.Errors$ErrorMessagesException
at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:437)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:256)
...

这是web.xml:

<servlet>
  <servlet-name>jersey-servlet</servlet-name>
  <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
  <init-param>
     <param-name>com.sun.jersey.config.property.packages</param-name>
     <param-value>de.mme2app.open.server, org.codehaus.jackson.jaxrs</param-value>
  </init-param>
  <init-param>
     <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
     <param-value>true</param-value>
  </init-param>
  <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
  <servlet-name>jersey-servlet</servlet-name>
  <url-pattern>/rest/*</url-pattern>
</servlet-mapping>

1 个答案:

答案 0 :(得分:0)

我没有确认这是否会导致该错误,但com.sun.jersey.config.property.packages参数应该只指向包含您的资源和提供程序的包。它似乎不属于org.codehaus.jackson.jaxrs。试试吧:

<init-param>
    <param-name>com.sun.jersey.config.property.packages</param-name>
    <param-value>de.mme2app.open.server</param-value>
</init-param>

假设de.mme2app.open.server是项目中包含资源/提供者的包。