Announcement Announcement Module
Collapse
No announcement yet.
Problem with Spring v1.2RC2 and MyFaces 1.0.9 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with Spring v1.2RC2 and MyFaces 1.0.9

    Hello,
    i've a problem with the jsf.DelegatingVariableResolver using Spring v1.2RC2 and MyFaces 1.0.9.

    I've registered the DelegatingVariableResolver in faces-config.

    I've configured both listeners in my web-xml.
    org.apache.myfaces.webapp.StartupServletContextLis tener and
    org.springframework.web.context.ContextLoaderListe ner.

    i've registered my JSF Backing-Bean in faces-config:
    <managed-bean>
    <description>User bean</description>
    <managed-bean-name>userBean</managed-bean-name>
    <managed-bean-class>de.mit.saturn.web.beans.UserBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>userService</property-name>
    <value>#{userService}</value>
    </managed-property>
    </managed-bean>

    i've registered my userService class in applicationContext file:

    <bean id="userService" parent="txProxyTemplate">
    <property name="target">
    <bean class="de.mit.saturn.service.impl.UserServiceImpl" >
    <property name="userDAO"><ref bean="userDAO"/></property>
    </bean>
    </property>
    </bean>

    txProxyTemplate :
    <bean id="txProxyTemplate" abstract="true"
    class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
    <property name="transactionManager"><ref bean="transactionManager"/></property>
    <property name="transactionAttributes">
    <props>
    <prop key="save*">PROPAGATION_REQUIRED</prop>
    <prop key="remove*">PROPAGATION_REQUIRED</prop>
    <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
    </props>
    </property>
    </bean>

    last but not least i've registered the userDAO in applicationContext-hibernate

    <bean id="userDAO" class="de.mit.saturn.dao.hibernate.UserDAOImpl">
    <property name="sessionFactory">
    <ref bean="sessionFactory"/>
    </property>
    </bean>

    i sticked to the hibernate setup told in spring's manual
    ..

    And now my ERROR
    when i access my userList.jsp

    11:29:29,423 ? DEBUG BeanDefinitionValueResolver:159 - Resolving reference from property 'userService' in bean 'pageBean' to bean '#{userService}'

    11:29:29,423 ? ERROR ValueBindingImpl:457 - Cannot get value for expression '#{userBean.users}'

    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'userBean' defined in ServletContext resource [/WEB-INF/faces-config.xml]:
    Can't resolve reference to bean '#{userService}' while setting property 'userService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named '#{userService}' is defined:

    org.springframework.beans.factory.support.DefaultL istableBeanFactory defining beans [dataSource,sessionFactory,transactionManager,userD AO,testDAO,sectionDAO,pageDAO,pagePartDAO,question DAO,propertyConfigurer,txProxyTemplate,userService ,testService,sectionService,pageService,pagePartSe rvice,questionService]; root of BeanFactory hierarchy

    org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named '#{userService}' is defined: org.springframework.beans.factory.support.DefaultL istableBeanFactory defining beans [dataSource,sessionFactory,transactionManager,userD AO,testDAO,sectionDAO,pageDAO,pagePartDAO,question DAO,propertyConfigurer,txProxyTemplate,userService ,testService,sectionService,pageService,pagePartSe rvice,questionService]; root of BeanFactory hierarchy


    Help me
    maybe someone had a simliar error.

    Thx

  • #2
    Problem with Spring v1.2RC2 and MyFaces 1.0.9

    I switched to Spring v1.15 and Hibernate2 and now i workts with the same setup.

    It seems, that Spring v1.2 has some problems with JSF integration?

    Comment

    Working...
    X