3 Replies Latest reply on Feb 7, 2009 12:10 PM by jayakrishna palla palla

    Problem with deployment of ejb3 SLSB (5.0.0 beta2)

    Per Newgro Newbie

      Hi *,

      we have a little problem here with deploying a bean.
      Our base interface looks like this
      package my.common.beans;

      import my.common.model.IPreSelectionModel;

      public interface IMaterializePreSelectionUseCase {

      IPreSelectionModel materialize();
      }


      The appropriate remote and local interfaces looks like this
      package my.common.beans;

      import javax.ejb.Remote;

      @Remote
      public interface IMaterializePreSelectionUseCaseRemote extends IMaterializePreSelectionUseCase {

      }

      package my.backend.usecases;

      import javax.ejb.Local;

      import my.common.beans.IMaterializePreSelectionUseCase;

      @Local
      public interface IMaterializePreSelectionUseCaseLocal extends IMaterializePreSelectionUseCase {

      }


      Our bean is this
      package my.backend.usecases;

      import java.util.Calendar;
      import java.util.List;

      import javax.ejb.Stateless;

      import my.common.beans.IMaterializePreSelectionUseCase;
      import my.common.model.IPreSelectionModel;
      import my.common.model.PreSelectionModel;

      @Stateless
      public class MaterializePreSelectionUseCase implements IMaterializePreSelectionUseCase {

      // @javax.annotation.Resource(mappedName="maxAdults")
      // Integer maxAdults;

      public IPreSelectionModel materialize() {
      return new PreSelectionModel();
      }
      }

      ejb-jar.xml
      <?xml version="1.0"?>

      <!DOCTYPE ejb-jar PUBLIC
      '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN'
      'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>

      <ejb-jar>
      <enterprise-beans>

      <ejb-name>MaterializePreSelectionUseCase</ejb-name>

      my.backend.usecases.IMaterializePreSelectionUseCaseLocal


      my.common.beans.IMaterializePreSelectionUseCaseRemote

      <ejb-class>
      my.backend.usecases.MaterializePreSelectionUseCase
      </ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

      </enterprise-beans>
      <!-- assembly-descriptor></assembly-descriptor-->
      </ejb-jar>

      jboss.xml
      <?xml version='1.0' encoding='UTF-8' ?>

      <enterprise-beans>

      <ejb-name>MaterializePreSelectionUseCase</ejb-name>
      <jndi-name>MaterializePreSelectionUseCase</jndi-name>

      </enterprise-beans>


      Now we deploy this all in our my.ear. But we get an exception and don't know what we did wrong.
      13:10:47,297 ERROR [AbstractKernelController] Error installing to Create: name=jboss.j2ee:jndiName=MaterializePreSelectionUseCase,service=EJB state=Co
      nfigured mode=Manual requiredState=Create
      java.lang.NoSuchMethodException: org.jboss.ejb.StatelessSessionContainer.materializeHome()
      at java.lang.Class.getMethod(Class.java:1581)
      at org.jboss.ejb.StatelessSessionContainer.setupHomeMapping(StatelessSessionContainer.java:132)
      at org.jboss.ejb.SessionContainer.createService(SessionContainer.java:169)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:260)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:243)
      at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      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:167)
      at $Proxy0.create(Unknown Source)
      at org.jboss.system.microcontainer.CreateDestroyLifecycleAction.installAction(CreateDestroyLifecycleAction.java:42)
      at org.jboss.system.microcontainer.ServiceControllerContextAction.install(ServiceControllerContextAction.java:46)
      at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:233)
      at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:238)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:724)
      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:445)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:555)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:489)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:335)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:205)
      at org.jboss.system.ServiceController.doChange(ServiceController.java:656)
      at org.jboss.system.ServiceController.create(ServiceController.java:393)
      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:585)
      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.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      at $Proxy34.create(Unknown Source)
      at org.jboss.ejb.EjbModule.createService(EjbModule.java:406)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:260)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:243)
      at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      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:167)
      at $Proxy0.create(Unknown Source)
      at org.jboss.system.microcontainer.CreateDestroyLifecycleAction.installAction(CreateDestroyLifecycleAction.java:42)
      at org.jboss.system.microcontainer.ServiceControllerContextAction.install(ServiceControllerContextAction.java:46)
      at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:233)
      at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:238)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:724)
      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:445)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:555)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:489)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:335)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:205)
      at org.jboss.system.ServiceController.doChange(ServiceController.java:656)
      at org.jboss.system.ServiceController.create(ServiceController.java:393)
      at org.jboss.system.ServiceController.create(ServiceController.java:358)
      at org.jboss.system.deployers.ServiceDeployer.create(ServiceDeployer.java:137)
      at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:100)
      at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
      at org.jboss.deployers.plugins.deployers.helpers.AbstractSimpleRealDeployer.deploy(AbstractSimpleRealDeployer.java:56)
      at org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer.commitDeploy(AbstractSimpleDeployer.java:52)
      at org.jboss.deployers.plugins.deployer.DeployerWrapper.commitDeploy(DeployerWrapper.java:170)
      at org.jboss.deployers.plugins.deployment.MainDeployerImpl.commitDeploy(MainDeployerImpl.java:592)
      at org.jboss.deployers.plugins.deployment.MainDeployerImpl.commitDeploy(MainDeployerImpl.java:603)
      at org.jboss.deployers.plugins.deployment.MainDeployerImpl.process(MainDeployerImpl.java:476)
      at org.jboss.deployers.plugins.deployment.MainDeployerImpl.process(MainDeployerImpl.java:406)
      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:585)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:121)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:110)
      at org.jboss.profileservice.aop.MainDeployerAspect.process(MainDeployerAspect.java:53)
      at org.jboss.aop.advice.org.jboss.profileservice.aop.MainDeployerAspect_z_process_381299.invoke(MainDeployerAspect_z_process_381299.java)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at AOPContainerProxy$0.process(AOPContainerProxy$0.java)
      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:371)
      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.bootstrap(ProfileServiceBootstrap.java:247)
      at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:89)
      at org.jboss.system.server.profileservice.ServerImpl.doStart(ServerImpl.java:403)
      at org.jboss.system.server.profileservice.ServerImpl.start(ServerImpl.java:342)
      at org.jboss.Main.boot(Main.java:210)
      at org.jboss.Main$1.run(Main.java:522)
      at java.lang.Thread.run(Thread.java:595)

      It would be nice if someone can push us to the right direction.
      Thanks for your help
      Per

        • 1. Re: Problem with deployment of ejb3 SLSB (5.0.0 beta2)
          Andrew Rubinger Master

          Your bean's implementation class does not explicitly designate any business interfaces; the container will not automatically scan for @Local and @Remote in the subclasses of the parent you've specified. I'd look there first (as it seems this is what you've intended).

          Try:

          @Stateless
          public class MaterializePreSelectionUseCase implements
          IMaterializePreSelectionUseCaseLocal, IMaterializePreSelectionUseCaseRemote


          The confusing point here, and perhaps unrelated to your problem, is that the container should assume that your "IMaterializePreSelectionUseCase" is the Local interface itself. EJB3 Spec 4.6.6, Bullet Point 4.1:

          If bean class implements a single interface, that interface is assumed to be the busi-
          ness interface of the bean. This business interface will be a local interface unless the
          interface is designated as a remote business interface by use of the Remote annota-
          tion on the bean class or interface or by means of the deployment descriptor.


          Mind posting back here with the outcome of the proposed fix? I'd like to look into the second issue if that does the trick. JBoss AS / EJB3 Version?

          S,
          ALR

          • 2. Re: Problem with deployment of ejb3 SLSB (5.0.0 beta2)
            Andrew Rubinger Master

            ...unless some of the the tags of your ejb.jar.xml was lost in formatting of your post? I do see you've put the names of your local and remote interfaces in there, though not enclosed in nodes.

            S,
            ALR

            • 3. Re: Problem with deployment of ejb3 SLSB (5.0.0 beta2)
              jayakrishna palla palla Newbie


              Hey you did the mistake here man
              @Stateless
              public class MaterializePreSelectionUseCase implements Serializable, IMaterializePreSelectionUseCaseRemote, IMaterializePreSelectionUseCaseLocal {

              // @javax.annotation.Resource(mappedName="maxAdults")
              // Integer maxAdults;
              @EJB

              private Somex somex;

              public IPreSelectionModel materialize() {
              return new PreSelectionModel();
              }
              }