1 Reply Latest reply on May 12, 2006 3:15 PM by Ian Hunter

    Problem starting EJB3 ServiceBean

    Ian Hunter Newbie

      Created the simplest Session bean I can think of (listed at bottom), and I simply get the following exception on startup.

      Can anybody tell me what could be wrong here?

      [This is on a clean installation of 4.0.2SP1 with Ejb3, On WinXP]

      Many Thanks for any help
      Ian Hunter

      -------------------------------------------------------------------------
      Exception....

      08:41:06,500 INFO [SessionFactoryImpl] Checking 0 named queries
      08:41:06,500 INFO [Ejb3Deployment] Create EntityManager with JNDI name: omcrEjb
      ServerEjb3
      08:41:06,515 INFO [JaccHelper] JACC Policy Configuration for deployment has bee
      n put in service
      08:41:06,515 INFO [Ejb3Deployment] EJB3 deployment time took: 359
      08:41:06,531 WARN [ServiceController] Problem starting service jboss.j2ee:servi
      ce=EJB3,name=com.ipaccess.ejb3.session.ServerInfoServiceBean
      java.lang.ClassCastException: org.jboss.ejb3.stateless.StatelessContainer
      at org.jboss.util.naming.Util.createSubcontext(Util.java:54)
      at org.jboss.util.naming.Util.createSubcontext(Util.java:37)
      at org.jboss.ejb3.SessionContainer.start(SessionContainer.java:50)
      at org.jboss.ejb3.stateless.StatelessContainer.start(StatelessContainer.
      java:63)
      at org.jboss.ejb3.stateless.StatelessManager.startService(StatelessManag
      er.java:93)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
      upport.java:274)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
      eanSupport.java:230)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
      er.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:943)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:428)
      at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
      er.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy77.start(Unknown Source)
      at org.jboss.ejb3.Ejb3JmxDeployment.start(Ejb3JmxDeployment.java:258)
      at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:39)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
      upport.java:274)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
      eanSupport.java:230)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
      er.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:943)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:428)
      at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
      er.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy10.start(Unknown Source)
      at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:228)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
      er.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy11.start(Unknown Source)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:989)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:790)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
      at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
      er.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
      or.java:118)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
      BeanOperationInterceptor.java:127)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
      java:245)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
      tScanner.java:319)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
      canner.java:489)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      doScan(AbstractDeploymentScanner.java:192)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      loop(AbstractDeploymentScanner.java:203)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      run(AbstractDeploymentScanner.java:182)
      08:41:07,031 INFO [EJB3Deployer] Deployed: file:/C:/jboss-4.0.3SP1/server/defau
      lt/deploy/omcrEjbServerEjb3.ejb3
      08:41:07,515 INFO [TomcatDeployer] deploy, ctxPath=/admin, warUrl=.../tmp/deplo
      y/tmp49887admin-exp.war/
      08:41:07,984 INFO [TomcatDeployer] deploy, ctxPath=/omcrPerformance, warUrl=...
      /tmp/deploy/tmp49888omcrPerformance-exp.war/
      08:41:08,171 INFO [TomcatDeployer] deploy, ctxPath=/omcrTests, warUrl=.../tmp/d
      eploy/tmp49889omcrTests-exp.war/
      08:41:08,296 INFO [TomcatDeployer] deploy, ctxPath=/omcrTestsEjb3, warUrl=.../t
      mp/deploy/tmp49890omcrTestsEjb3-exp.war/
      08:41:08,375 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.j2ee:service=EJB3,name=com.ipaccess.ejb3.session.ServerInfoSer
      viceBean
      State: FAILED
      Reason: java.lang.ClassCastException: org.jboss.ejb3.stateless.StatelessContai
      ner
      -------------------------------------------------------------------------------

      Source code....

      package com.ipaccess.ejb3.session;
      import com.ipaccess.ejb3.entity.ServerInfo;
      public interface ServerInfoService {

      public void setInfo(ServerInfo info) throws Exception;
      public ServerInfo getInfo() throws Exception;

      }


      package com.ipaccess.ejb3.session;

      import java.util.ArrayList;

      import javax.ejb.Remote;
      import javax.ejb.Stateless;
      import javax.persistence.EntityManager;
      import javax.persistence.PersistenceContext;

      import org.apache.log4j.Logger;

      import com.ipaccess.common.ejb.exceptions.ApplicationDeadlockException;
      import com.ipaccess.ejb3.entity.ServerInfo;
      import com.ipaccess.omcr.server.utils.Constants;

      @Stateless
      @Remote({ServerInfoService.class})
      public class ServerInfoServiceBean implements ServerInfoService {

      public void setInfo(ServerInfo info) throws Exception {

      }

      public ServerInfo getInfo() throws Exception {
      return null;
      }

      @PersistenceContext
      protected EntityManager em;

      private static final Logger log =
      Logger.getLogger(ServerInfoServiceBean.class);

      }







      -------------------------------------------------------------------------------