SORU
10 Aralık 2010, Cuma


ResourceConfig örneği herhangi bir kök kaynak sınıfları içermez

Gidiyor burada yanlış olan ne ?

The ResourceConfig instance does not contain any root resource classes. 
Dec 10, 2010 10:21:24 AM com.sun.jersey.spi.spring.container.servlet.SpringServlet initiate 
SEVERE: Exception occurred when intialization 
com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes. 
        at com.sun.jersey.server.impl.application.RootResourceUriRules.<init>(RootResourceUriRules.java:103) 
        at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1182) 
        at com.sun.jersey.server.impl.application.WebApplicationImpl.access$600(WebApplicationImpl.java:161) 
        at com.sun.jersey.server.impl.application.WebApplicationImpl$12.f(WebApplicationImpl.java:698) 
        at com.sun.jersey.server.impl.application.WebApplicationImpl$12.f(WebApplicationImpl.java:695) 
        at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:197) 
        at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:695) 
        at com.sun.jersey.spi.spring.container.servlet.SpringServlet.initiate(SpringServlet.java:117) 

Filtre:

<filter>

    <filter-name>JerseyFilter</filter-name>
    <filter-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</filter-class>

    <init-param>
        <param-name>com.sun.jersey.config.feature.Redirect</param-name>
        <param-value>true</param-value>
    </init-param>

    <init-param>
        <param-name>com.sun.jersey.config.property.JSPTemplatesBasePath</param-name>
        <param-value>/views/</param-value>
    </init-param>

    <init-param>
        <param-name>com.sun.jersey.config.property.WebPageContentRegex</param-name>
        <param-value>/(images|css|jsp)/.*</param-value>
    </init-param>

</filter>

<filter-mapping>
    <filter-name>JerseyFilter</filter-name>
    <url-pattern>/myresource/*</url-pattern>
</filter-mapping> 

Kod:

@Path ("/admin") 
public class AdminUiResource { 

  @GET 
  @Produces ("text/html") 
  @Path ("/singup") 
  public Viewable getSignUp () { 
    return new Viewable("/public/signup", "Test"); 
  } 

}

CEVAP
10 Aralık 2010, Cuma


Eklemeyi denediniz

<init-param>
  <param-name>com.sun.jersey.config.property.packages</param-name>
  <param-value>my.package.name</param-value>
</init-param>

senin SpringServlet tanımı? Açıkçası benim değiştirin.paket.AdminUiResource olan paket adı ve sınıf içinde olduğundan emin olun.

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Bryan Smith

    Bryan Smith

    12 Mart 2006
  • Elliot Davin

    Elliot Davin

    28 Kasım 2008
  • spyib

    spyib

    9 Ocak 2007