Two things to try
1) verify your EJB only implements 1 interface -- I seem to remember
running into issues when I attempted to use multiple interfaces.
2) try removing the @Local from the interface and declare the local from the EJB
@Local(ResfulLocal.class)
@Stateless...

I have run into cases with unrelated frameworks where the extra
annotations have thrown it off. I don't know why it should break or
work doing it the way you have it, but all my EJB interfaces are
defined without @Local on the actual interface class.

On Thu, May 24, 2012 at 6:04 PM, Rogelio Flores
<rogelio.flo...@gmail.com> wrote:
> Ok, looks like I have a problem others have reported before, but still can't
> make it work (I also didn't see how to search this mailing list for old
> messages).
>
> I have a RESTful service running off a SLSB as explained here:
> http://docs.jboss.org/resteasy/docs/2.0.0.GA/userguide/html/RESTEasy_EJB_Integration.html
>
> The worst thing is that I had it working before, but this project got
> converted to Spring and then back to JEE again, and as far as I can tell,
> this is the same config and code I had when it was running correctly, but
> obviously I might have missed something.
>
> This is my web.xml:
>
>    <context-param>
>       <param-name>resteasy.jndi.resources</param-name>
>       <param-value>VOLTP/RestfulBean/local</param-value>
>    </context-param>
>    <listener>
>       <listener-class>
>          org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
>       </listener-class>
>    </listener>
>    <servlet>
>       <servlet-name>Resteasy</servlet-name>
>       <servlet-class>
>          org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
>       </servlet-class>
>    </servlet>
>    <servlet-mapping>
>       <servlet-name>Resteasy</servlet-name>
>       <url-pattern>/*</url-pattern>
>    </servlet-mapping>
>    <context-param>
>       <param-name>resteasy.scan</param-name>
>       <param-value>true</param-value>
>    </context-param>
>
> My Bean is declared with:
> @Stateless
> public class RestfulBean implements RestfulLocal {...
>
> and ResfulLocal looks like this:
>
> @Local
> @Path("/")
> public interface RestfulLocal {
>
>
> The error I get:
>
> 2012-05-24 17:41:15,217 ERROR
> [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/webservices]]
> (main) Exception sending context initialized event to listener instance of
> class org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
> java.lang.RuntimeException: Class is not a root resource.  It, or one of its
> interfaces must be annotated with @Path: $Proxy409 implements:
>  com.acme.session.RestfulLocal
>         at
> org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:104)
>         at
> org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:83)
>         at
> org.jboss.resteasy.core.ResourceMethodRegistry.addJndiResource(ResourceMethodRegistry.java:57)
>         at
> org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.java:350)
>         at
> org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:225)
>         at
> org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap.contextInitialized(ResteasyBootstrap.java:28)
>         at
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
>         at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4393)
>         at
> org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
>         at
> org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
>         at
> org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
>         at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
>         at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at
> org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
> ...
>
>
> I also added a jboss-web.xml as suggested here (I didn't use it before
> although I remember playing with it at some point when I first had this app
> working):
> https://community.jboss.org/thread/165368
>
> <?xml version="1.0" encoding="UTF-8"?>
> <jboss-web>
>
>  <depends>jboss.j2ee:ear=VOLTP.ear,jar=voltp-ejbs-1.0-SNAPSHOT.jar,name=RestfulBean,service=EJB3</depends>
> </jboss-web>
>
> but didn't work; I get the message above. Actually, before adding this file,
> I got a "Resource not bound", but I also got the message above.
>
> I can see that the SLSB is registered correctly with JNDI when the error
> above happens, and it obviously has the Path annotation.
>
>
>
> Can anyone suggest something else? I've tried everything I can think of and
> getting nowhere. Thanks.
>
> Using JBoss 5.1.0.GA
>
>
> BTW, this app was also working fine with Spring (web.xml was different
> because it was sourcing the spring config and was using Spring Beans
> instead, etc).
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Resteasy-users mailing list
> Resteasy-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>



-- 
jim stafford
SRA I&S | JHU

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users

Reply via email to