1 Reply Latest reply on Dec 20, 2002 9:01 AM by Arto Pastinen

    What's the magic in StatelessSessionContainer?? please, help

    Arto Pastinen Newbie

      Hi

      When i try to deploy my UserData bean (Stateless), i get the following stack:
      15:43:12,080 DEBUG [StatelessSessionContainer] Mapping remove
      15:43:12,081 DEBUG [StatelessSessionContainer] Mapping remove
      15:43:12,081 DEBUG [StatelessSessionContainer] Mapping getHomeHandle
      15:43:12,081 DEBUG [StatelessSessionContainer] Mapping getEJBMetaData
      15:43:12,081 DEBUG [StatelessSessionContainer] Mapping create
      15:43:12,082 WARN [ServiceController] Problem creating service jboss.j2ee:jndiName=ejb/test/UserData,service=EJB
      java.lang.NoSuchMethodException
      at java.lang.Class.getMethod0(Native Method)
      at java.lang.Class.getMethod(Class.java:883)
      at org.jboss.ejb.StatelessSessionContainer.setupHomeMapping(StatelessSessionContainer.java:457)
      at org.jboss.ejb.StatelessSessionContainer.create(StatelessSessionContainer.java:165)
      at org.jboss.ejb.Container.invoke(Container.java:752)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy5.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:315)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy109.create(Unknown Source)
      at org.jboss.ejb.EjbModule.createService(EjbModule.java:386)
      at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:136)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)

      ... but if i define the UserData bean to Stateful, then it deploys correctly.

      The line in StatelessSessionContainer.setupHomeMapping is next:
      if (homeInterface != null)
      {
      Method[] m = homeInterface.getMethods();
      for (int i = 0; i < m.length; i++)
      {
      // Implemented by container
      if (debug)
      log.debug("Mapping "+m.getName());
      map.put(m
      , getClass().getMethod(m.getName()+"Home", m.getParameterTypes())); // this is line 457
      }
      }
      ,but the code in StatefulSessionContainer.setupHomeMapping is also very same kind:
      try {
      // Implemented by container
      if (isEJB1x == false && m.getName().startsWith("create"))
      map.put(m
      , getClass().getMethod("createHome", new Class[]
      { Invocation.class }));
      else
      map.put(m, getClass().getMethod(m.getName()+"Home", new Class[]
      { Invocation.class }));
      }
      catch (NoSuchMethodException e)
      {
      if (infoEnabled)
      log.info(m.getName() + " in bean has not been mapped");
      }

      .. so what's the problem???, and why it trys to get method createHome?? (if i read code correctly..)