Announcement Announcement Module
Collapse
No announcement yet.
got NoSuchBeanDefinitionException when SLSB deployed to WebSphere 5.1 Server Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • got NoSuchBeanDefinitionException when SLSB deployed to WebSphere 5.1 Server

    I created a SLSB by extending org.springframework.ejb.support.AbstractStatelessS essionBean, and override setSessionContext():
    Code:
        public void setSessionContext(SessionContext sessionContext)
        {
            super.setSessionContext(sessionContext);
            setBeanFactoryLocator(ContextSingletonBeanFactoryLocator.getInstance("cct-beanRefContext.xml");
            setBeanFactoryLocatorKey("service-context");
        }
    It works perfectly well on my local WSAD environment, and I can start server and run test EJB client to call SLSB on the server. But when everything deployed to AIX server, I got NoSuchBeanDefinitionException,

    Code:
    [3/8/06 8:43:08:023 MST] 104e933e ExceptionUtil E CNTR0019E: Non-application exception occurred while processing method "getCode". Exception data: com.ibm.ejs.container.CreateFailureException: ; nested exception is: 
    	java.lang.reflect.InvocationTargetException
    	at com.ibm.ejs.container.StatelessBeanO.<init>(StatelessBeanO.java:152)
    	at com.ibm.ejs.container.CMStatelessBeanO.<init>(CMStatelessBeanO.java:53)
    	at com.ibm.ejs.container.CMStatelessBeanOFactory.create(CMStatelessBeanOFactory.java:40)
    	at com.ibm.ejs.container.EJSHome.createBeanO(EJSHome.java:704)
    	at com.ibm.ejs.container.EJSHome.createBeanO(EJSHome.java:791)
    	at com.ibm.ejs.container.activator.UncachedActivationStrategy.atActivate(UncachedActivationStrategy.java:78)
    	at com.ibm.ejs.container.activator.Activator.activateBean(Activator.java:519)
    	at com.ibm.ejs.container.EJSContainer.preInvoke_internal(EJSContainer.java:2792)
    	at com.ibm.ejs.container.EJSContainer.preInvoke(EJSContainer.java:2503)
    	at com.ibm.ejs.container.EJSContainer.preInvoke(EJSContainer.java:2488)
    	at ca.ab.gov.health.cct.s2s.EJSRemoteStatelessCCTEJBService_f9d25238.getCode(EJSRemoteStatelessCCTEJBService_f9d25238.java:52)
    	at ca.ab.gov.health.cct.s2s._EJSRemoteStatelessCCTEJBService_f9d25238_Tie.getCode(_EJSRemoteStatelessCCTEJBService_f9d25238_Tie.java:179)
    	at ca.ab.gov.health.cct.s2s._EJSRemoteStatelessCCTEJBService_f9d25238_Tie._invoke(_EJSRemoteStatelessCCTEJBService_f9d25238_Tie.java:83)
    	at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:608)
    	at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:461)
    	at com.ibm.rmi.iiop.ORB.process(ORB.java:436)
    	at com.ibm.CORBA.iiop.ORB.process(ORB.java:1728)
    	at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2230)
    	at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:65)
    	at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:95)
    	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:936)
    Caused by: java.lang.reflect.InvocationTargetException
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
    	at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
    	at com.ibm.ejs.container.StatelessBeanO.<init>(StatelessBeanO.java:145)
    	... 20 more
    Caused by: org.springframework.beans.factory.access.BootstrapException: Unable to return specified BeanFactory instance: factory key [service-context], from group with resource name [classpath*:cct-beanRefContext.xml]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'service-context' is defined
    	at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:409)
    	at org.springframework.ejb.support.AbstractEnterpriseBean.loadBeanFactory(AbstractEnterpriseBean.java:117)
    	at org.springframework.ejb.support.AbstractStatelessSessionBean.ejbCreate(AbstractStatelessSessionBean.java:64)
    	... 26 more
    Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'service-context' is defined
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:352)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:671)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
    	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:555)
    	at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:399)
    	... 28 more
    The config file cct-beanRefContext.xml is very simple:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
            "http://www.springframework.org/dtd/spring-beans.dtd">
        
    <!-- load a hierarchy of contexts -->
    <beans>
        
      <bean id="service-context"
            class="org.springframework.context.support.ClassPathXmlApplicationContext">
        <constructor-arg>
          <list>
            <value>/cct-serviceContext.xml</value>
          </list>
        </constructor-arg>
      </bean>
    </beans>
    It seems spring could not load config file cct-beanRefContext.xml, so no bean named 'service-context' is defined.

    The folder with all config files are in classpath, and everything is readable for all. I'm using Spring 1.2.6 and WebSphere 5.1.

    Anyone has the problem before? Thanks.

  • #2
    Sorry, Please ignore it.

    I forgot to restart WebSphere Server after I changed file access mode.

    Comment

    Working...
    X