iuser
May 7th, 2008, 08:27 AM
Hi,
i am trying to get a spring bean to react to a changeValue in JSF-Page:
...
BeanFactory beanFactory = new ClassPathXmlApplicationContext("classpath*:backingBeans.xml");
ManageRoutingItemsBackBean bean = (ManageRoutingItemsBackBean)beanFactory.getBean("ManageRoutingItemsBackBean");
...
My configuration files are:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<!-- Beans are configured in different files:
- All GUI relevant beans are found in backingBeans.xml
- All business logic can be found in services.xml
- Data access object are located in daoSupport.xml
-->
<import resource="backingBeans.xml"/>
<import resource="services.xml"/>
<import resource="daoSupport.xml"/>
</beans>
and the resulting file is like:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="ManageRoutingItemsBackBean"
class="de.hansenet.lnp.backBeans.ManageRoutingItemsBackBe an"
scope="session">
<property name="serviceBean" ref="ManageRoutingItemsServiceBean"></property>
</bean>
</beans>
when i am trying to get the spring bean i got following error:
org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'ManageRoutingItemsBackBean' is defined
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.getBeanDefinition(DefaultListab leBeanFactory.java:387)
at org.springframework.beans.factory.support.Abstract BeanFactory.getMergedLocalBeanDefinition(AbstractB eanFactory.java:968)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:246 )
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.context.support.AbstractApplic ationContext.getBean(AbstractApplicationContext.ja va:881)
at de.hansenet.lnp.actionListener.CheckAllListener.pr ocessValueChange(CheckAllListener.java:26)
at javax.faces.event.ValueChangeEvent.processListener (ValueChangeEvent.java:103)
at javax.faces.component.UIComponentBase.broadcast(UI ComponentBase.java:641)
at javax.faces.component.UIInput.broadcast(UIInput.ja va:486)
at javax.faces.component.UIViewRoot.broadcastEvents(U IViewRoot.java:249)
at javax.faces.component.UIViewRoot.processValidators (UIViewRoot.java:343)
at com.sun.faces.lifecycle.ProcessValidationsPhase.ex ecute(ProcessValidationsPhase.java:78)
at com.sun.faces.lifecycle.LifecycleImpl.phase(Lifecy cleImpl.java:200)
at com.sun.faces.lifecycle.LifecycleImpl.execute(Life cycleImpl.java:90)
at javax.faces.webapp.FacesServlet.service(FacesServl et.java:197)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:199)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:145)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:596)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:955)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:139)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:596)
at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:446)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:594)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:955)
at org.apache.catalina.core.StandardContext.invoke(St andardContext.java:2460)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:596)
at org.apache.catalina.valves.ErrorDispatcherValve.in voke(ErrorDispatcherValve.java:119)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:594)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:594)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:955)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:596)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:955)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(Co yoteAdapter.java:157)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:595)
What am i doing wrong here? Can anybody help?
Regards,
ak
i am trying to get a spring bean to react to a changeValue in JSF-Page:
...
BeanFactory beanFactory = new ClassPathXmlApplicationContext("classpath*:backingBeans.xml");
ManageRoutingItemsBackBean bean = (ManageRoutingItemsBackBean)beanFactory.getBean("ManageRoutingItemsBackBean");
...
My configuration files are:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
<!-- Beans are configured in different files:
- All GUI relevant beans are found in backingBeans.xml
- All business logic can be found in services.xml
- Data access object are located in daoSupport.xml
-->
<import resource="backingBeans.xml"/>
<import resource="services.xml"/>
<import resource="daoSupport.xml"/>
</beans>
and the resulting file is like:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="ManageRoutingItemsBackBean"
class="de.hansenet.lnp.backBeans.ManageRoutingItemsBackBe an"
scope="session">
<property name="serviceBean" ref="ManageRoutingItemsServiceBean"></property>
</bean>
</beans>
when i am trying to get the spring bean i got following error:
org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'ManageRoutingItemsBackBean' is defined
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.getBeanDefinition(DefaultListab leBeanFactory.java:387)
at org.springframework.beans.factory.support.Abstract BeanFactory.getMergedLocalBeanDefinition(AbstractB eanFactory.java:968)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:246 )
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.context.support.AbstractApplic ationContext.getBean(AbstractApplicationContext.ja va:881)
at de.hansenet.lnp.actionListener.CheckAllListener.pr ocessValueChange(CheckAllListener.java:26)
at javax.faces.event.ValueChangeEvent.processListener (ValueChangeEvent.java:103)
at javax.faces.component.UIComponentBase.broadcast(UI ComponentBase.java:641)
at javax.faces.component.UIInput.broadcast(UIInput.ja va:486)
at javax.faces.component.UIViewRoot.broadcastEvents(U IViewRoot.java:249)
at javax.faces.component.UIViewRoot.processValidators (UIViewRoot.java:343)
at com.sun.faces.lifecycle.ProcessValidationsPhase.ex ecute(ProcessValidationsPhase.java:78)
at com.sun.faces.lifecycle.LifecycleImpl.phase(Lifecy cleImpl.java:200)
at com.sun.faces.lifecycle.LifecycleImpl.execute(Life cycleImpl.java:90)
at javax.faces.webapp.FacesServlet.service(FacesServl et.java:197)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:199)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:145)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:596)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:955)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:139)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:596)
at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:446)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:594)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:955)
at org.apache.catalina.core.StandardContext.invoke(St andardContext.java:2460)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:596)
at org.apache.catalina.valves.ErrorDispatcherValve.in voke(ErrorDispatcherValve.java:119)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:594)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:594)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:955)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:596)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:955)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(Co yoteAdapter.java:157)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:595)
What am i doing wrong here? Can anybody help?
Regards,
ak