6 Replies Latest reply: Sep 8, 2011 10:06 AM by El Mentecato RSS

Can a WAR depend on a JNDI entry in JBoss 5.1?

Henrik Aronsen Novice

Hi.

 

As part of an upgrade from JBoss 4.0.4 to 5.1, I am trying to get a WAR to deploy after an EAR is successfully deployed.  JBoss 5.x does not support PrefixDeploymentSorter like 4.x did, which means that I have to use "depends" in the WAR's jboss-web.xml.

 

 

It seems I cannot depend on the EAR itself, so I pick the last deployed EJB instead.  This EJB provides a JNDI entry that the WAR needs.

 

Here's the EJB as it deploys when the WAR is absent from the deploy directory:

2010-03-25 10:47:30,348 INFO  [org.jboss.ejb3.session.SessionSpecContainer] (main) Starting jboss.j2ee:ear=my-ear.ear,jar=mypackage-ejb.jar,name=MyFacadeBean,service=EJB3
2010-03-25 10:47:30,350 INFO  [org.jboss.ejb3.EJBContainer] (main) STARTED EJB: my.package.MyFacadeBean ejbName: MyFacadeBean
2010-03-25 10:47:30,371 INFO  [org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase] (main) Binding the following Entries in Global JNDI:
    
      my/MyFacade/local - EJB3.x Default Local Business Interface
      my-ear/MyFacadeBean/local-my.package.MyFacade - EJB3.x Local Business Interface

 

And here's the depends snippet from jboss-web.xml:

<depends>jboss.j2ee:ear=my-ear.ear,jar=mypackage-ejb.jar,name=MyFacadeBean,service=EJB3</depends>

My problem is:  The WAR starts to deploy immediately after "STARTED EJB:", i.e. before MyFacadeBean is bound to JNDI, which causes bean deployments to fail:

2010-03-25 10:47:39,068 ERROR [my.facade.FacadeFactory] (main) MyFacade not bound
2010-03-25 10:47:39,069 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[my.host.no].[/]] (main) StandardWrapper.Throwable
  java.lang.ExceptionInInitializerError
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:164)
      at my.freemarker.servlet.FreemarkerController.setupPojoServiceFactory(FreemarkerController.java:621)
[...]
Caused by: java.lang.RuntimeException: javax.naming.NameNotFoundException: MyFacade not bound
      at my.facade.FacadeFactory.getFacade(FacadeFactory.java:61)

After the WAR has finished its deployment, MyFacade happily (mockingly?) continues its deployment and binds the JNDI entries.

 

If I hot-deploy the WAR after the EAR has deployed, everything works as intended.

 

I even thought of depending on a dummy EJB in the EAR, and using module-order: strict in  jboss-app.xml to force it to load as the last module.  But alas, JBoss 5.x does not support that either.  Doh!

 

Is there a way to depend on the JNDI entry itself?  Are there other ways of solving this?

 

 

  • 1. Re: Can a WAR depend on a JNDI entry in JBoss 5.1?
    jaikiran pai Master

    Can you please post the entire exception stacktrace and the contents of jboss-web.xml?

  • 2. Re: Can a WAR depend on a JNDI entry in JBoss 5.1?
    Henrik Aronsen Novice

    Sure.  Here's the stacktrace:

     

    2010-03-23 14:51:40,152 INFO  [org.jboss.ejb3.session.SessionSpecContainer] (main) Starting jboss.j2ee:ear=my-ear.ear,jar=mypackage-ejb.jar,name=MyFacadeBean,service=EJB3
    2010-03-23 14:51:40,153 INFO  [org.jboss.ejb3.EJBContainer] (main) STARTED EJB: my.package.ejb.facade.MyFacadeBean ejbName: MyFacadeBean
    2010-03-23 14:51:40,165 INFO  [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (main) deploy, ctxPath=/
    [...]
    2010-03-23 14:51:46,136 INFO  [my.util.freemarker.servlet.FreemarkerController] (main) LOADING CLASS my.package.SubscriptionServiceBean
    2010-03-23 14:51:46,142 ERROR [my.util.facade.FacadeFactory] (main) MyFacade not bound
    2010-03-23 14:51:46,142 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[mysite.no].[/]] (main) StandardWrapper.Throwable
    java.lang.ExceptionInInitializerError
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:169)
            at my.util.freemarker.servlet.FreemarkerController.setupPojoServiceFactory(FreemarkerController.java:621)
            at my.util.freemarker.servlet.FreemarkerController.init(FreemarkerController.java:508)
            at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
            at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950)
            at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4122)
            at org.apache.catalina.core.StandardContext.start(StandardContext.java:4421)
            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)
            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
            at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
            at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
            at $Proxy38.start(Unknown Source)
            at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
            at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
            at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
            at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
            at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
            at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
            at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
            at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
            at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:106)
            at org.jboss.ejb3.common.registrar.plugin.mc.Ejb3McRegistrar.install(Ejb3McRegistrar.java:394)
            at org.jboss.ejb3.common.registrar.plugin.mc.Ejb3McRegistrar.bind(Ejb3McRegistrar.java:245)
            at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.registerProxyFactory(JndiSessionRegistrarBase.java:1140)
            at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.createJndiReferenceBindingSet(JndiSessionRegistrarBase.java:492)
            at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.bindEjb(JndiSessionRegistrarBase.java:148)
            at org.jboss.ejb3.session.SessionContainer.lockedStart(SessionContainer.java:210)
            at org.jboss.ejb3.session.SessionSpecContainer.lockedStart(SessionSpecContainer.java:577)
            at org.jboss.ejb3.stateless.StatelessContainer.lockedStart(StatelessContainer.java:192)
            at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:884)
            at sun.reflect.GeneratedMethodAccessor308.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
            at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
            at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
            at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
            at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
            at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
            at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
            at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
            at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
            at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
            at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
            at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
            at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
            at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
            at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
            at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
            at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
            at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
            at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
            at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
            at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
            at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
            at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
            at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
            at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
            at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
            at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
            at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
            at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
            at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
            at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
            at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
            at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
            at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
            at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
            at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
            at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
            at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
            at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
            at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
            at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
            at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
            at org.jboss.Main.boot(Main.java:221)
            at org.jboss.Main$1.run(Main.java:556)
            at java.lang.Thread.run(Thread.java:637)
    Caused by: java.lang.RuntimeException: javax.naming.NameNotFoundException: MyFacade not bound
            at my.util.facade.FacadeFactory.getFacade(FacadeFactory.java:61)
            at my.util.facade.FacadeFactory.getFacadeLocal(FacadeFactory.java:32)
            at my.package.SubscriptionServiceBean.<clinit>(SubscriptionServiceBean.java:35)
            ... 106 more
    Caused by: javax.naming.NameNotFoundException: MyFacade not bound
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
            at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
            at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
            at org.jnp.server.NamingServer.lookup(NamingServer.java:399)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
            at javax.naming.InitialContext.lookup(InitialContext.java:392)
            at my.util.facade.FacadeFactory.lookupFacade(FacadeFactory.java:45)
            at my.util.facade.FacadeFactory.getFacade(FacadeFactory.java:57)
            ... 108 more
    
    [...]
    
    2010-03-23 14:51:49,023 INFO  [org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase] (main) Binding the following Entries in Global JNDI:
             my/MyFacade/local - EJB3.x Default Local Business Interface
             my-ear/MyFacadeBean/local-my.package.facade.MyFacade - EJB3.x Local Business Interface
    

     

     

     

    And here's jboss-web.xml:

     

    <?xml version="1.0" encoding="UTF-8"?>
    <jboss-web>
    <depends>jboss.j2ee:ear=my-ear.ear,jar=mypackage-ejb.jar,name=MyFacadeBean,service=EJB3</depends>
    </jboss-web>
  • 3. Re: Can a WAR depend on a JNDI entry in JBoss 5.1?
    jaikiran pai Master
    2010-03-23 14:51:46,142 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[mysite.no].[/]] (main) StandardWrapper.Throwable
    java.lang.ExceptionInInitializerError
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:169)
            at my.util.freemarker.servlet.FreemarkerController.setupPojoServiceFactory(FreemarkerController.java:621)
            at my.util.freemarker.servlet.FreemarkerController.init(FreemarkerController.java:508)
            at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
            at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950)
            at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4122)
            at org.apache.catalina.core.StandardContext.start(StandardContext.java:4421)
            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)
            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
            at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
            at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
            at $Proxy38.start(Unknown Source)
            at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
            at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
            at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
            at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
            at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
            at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
            at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
            at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
            at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
            at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
            at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:106)
            at org.jboss.ejb3.common.registrar.plugin.mc.Ejb3McRegistrar.install(Ejb3McRegistrar.java:394)
            at org.jboss.ejb3.common.registrar.plugin.mc.Ejb3McRegistrar.bind(Ejb3McRegistrar.java:245)
            at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.registerProxyFactory(JndiSessionRegistrarBase.java:1140)
            at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.createJndiReferenceBindingSet(JndiSessionRegistrarBase.java:492)
            at org.jboss.ejb3.proxy.impl.jndiregistrar.JndiSessionRegistrarBase.bindEjb(JndiSessionRegistrarBase.java:148)
            at org.jboss.ejb3.session.SessionContainer.lockedStart(SessionContainer.java:210)
            at org.jboss.ejb3.session.SessionSpecContainer.lockedStart(SessionSpecContainer.java:577)
            at org.jboss.ejb3.stateless.StatelessContainer.lockedStart(StatelessContainer.java:192)
            at org.jboss.ejb3.EJBContainer.start(EJBContainer.java:884)
    
    
    

     

    Hmm, this one looks tricky to fix! This looks like a (sort of known) MC issue actually. The web deployment is adding a dependency on the session bean. The bean container is deployed as a MC bean which on its start lifecycle does:

     

    1) Start lifecycle of EJB container is invoked

    2) That creates JNDI proxy factories

    3) Then deploys these JNDI proxy factories as MC beans

    4) And finally binds the proxies to JNDI

     

    But it appears that when step#3 is done, MC starts resolving unrelated context (the load on startup servlet). While doing so, it identifies the EJB container dependency to have been resolved (because the start lifecycle method was already called?) and starts moving the servlet to the next state and ends up running into jndi lookup issues because the JNDI entries to be bound as part of #4 hasn't yet been completed.

     

    Right now, I can't see a way around this. Let me see if I can think of a workaround. I'll also check with the MC team whether this is the expected behaviour.

  • 4. Re: Can a WAR depend on a JNDI entry in JBoss 5.1?
    Henrik Aronsen Novice

    Right now, I can't see a way around this. Let me see if I can think of a workaround. I'll also check with the MC team whether this is the expected behaviour.

     

     

     

    Thanks, it's very appreciated

  • 5. Re: Can a WAR depend on a JNDI entry in JBoss 5.1?
    El Mentecato Newbie

    Sorry to resurrect this old post, but I don't see a solution to this. Has anyone found a solution or a nice workaround (better than what's proposed out there?). Running JBoss AS 5.1.0 and latest RESTeasy as of yesterday and this is still a problem.

  • 6. Re: Can a WAR depend on a JNDI entry in JBoss 5.1?
    El Mentecato Newbie

    Actually, I solved my problem the other day, although it might not be the same as the original issue here. My issue was related to integrating EJBs with RESTeasy services. Following their example here:

    http://docs.jboss.org/resteasy/docs/2.2.1.GA/userguide/html_single/index.html#RESTEasy_EJB_Integration

    they're missing the ear file name in the web.xml configuration where you specify the jndi resource which is the name of your EJB that has become the RESTful service. All I had to do was specify "my-ear/MyBean/local" instead of "MyBean/local" as their manual says. I noticed the missing piece after looking at their ejb-integration sample (http://resteasy.svn.sourceforge.net/viewvc/resteasy/trunk/jaxrs/examples/ejb-integration/).

    Not including the ear file name in the resteasy.jndi.resources in web.xml produced exactly the same exception as shown in the original post.

     

    And I didn't have to include a jboss-web.xml file as specified above.