1

代码:JBoss 7.1.1.Final,JEE6,JSF2,使用 resteasy oauth:

在 web.xml 上:

   <context-param>
        <param-name>oauth.provider.provider-class</param-name>
        <param-value>com.ostudio.dbo.rest.OAuthMyProvider</param-value>
    </context-param>

    <servlet>
      <servlet-name>OAuth</servlet-name>
      <servlet-class>org.jboss.resteasy.auth.oauth.OAuthServlet</servlet-class>
    </servlet>

    <servlet-mapping>
      <servlet-name>OAuth</servlet-name>
      <url-pattern>/oauth/*</url-pattern>
    </servlet-mapping> 

在我的 project.war 上:WEB-INF/classes/com/ostudio/dbo/rest/OAuthMyProvider.class

当我调用 localhost:8080/dbo/oauth 服务器显示:

javax.servlet.ServletException: oauth.provider.provider-class class com.ostudio.dbo.rest.OAuthMyProvider not found
    org.jboss.resteasy.auth.oauth.OAuthUtils.getOAuthProvider(OAuthUtils.java:176)
    org.jboss.resteasy.auth.oauth.OAuthServlet.init(OAuthServlet.java:105)
    org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)
    org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
    java.lang.Thread.run(Thread.java:619)

请帮我解决这个问题而不把类放在 jboss/lib 上

4

1 回答 1

1
<context-param>
    <param-name>oauth.provider.provider-class</param-name>
    <param-value>org.jboss.resteasy.auth.oauth.OAuthMemoryProvider</param-value>
</context-param>
于 2012-12-04T15:08:21.813 回答