Hi Every one,
I'm Trying to use a mix of JSF for view and Spring for middle tier, I suscesfully setup a working spring app (from the manager to the dao part) but I'm now stuck in the JSF-Spring Integration I follow the instructions from the ref manual, but I stil gettin null Spring Objects in faces context..
Here is my faces-config.xml
and my application-contextCode:<!-- Spring VariableResolver for JSF --> <application> <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver> <locale-config> <default-locale>es</default-locale> <supported-locale>en</supported-locale> <supported-locale>es</supported-locale> </locale-config> <message-bundle>messages</message-bundle> </application> <managed-bean> <managed-bean-name>TIPOPERFILUSUARIOForm</managed-bean-name> <managed-bean-class>co.com.quipux.entapp.qxvehiculos.web.TIPOPERFILUSUARIOForm</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> <managed-property> <property-name>tipoperfilusuarioManager</property-name> <value>#{tipoperfilusuarioManager}</value> </managed-property> </managed-bean>
The Form has :Code:<beans:bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <!-- results in a setDriverClassName(String) call --> <beans:property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" /> <beans:property name="url" value="jdbc:oracle:thin:@127.0.1.107:1521:BDHONDU" /> <beans:property name="username" value="username" /> <beans:property name="password" value="*****"/> <beans:property name="defaultAutoCommit" value="true" /> <beans:property name="maxActive" value="30"/> <beans:property name="maxIdle" value="10"/> <beans:property name="maxWait" value="1000"/> </beans:bean> <beans:bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <beans:property name="dataSource" ref="dataSource"/> </beans:bean> <!-- Enable @Transactional support --> <tx:annotation-driven/> <!-- Enable @AspectJ support --> <aop:aspectj-autoproxy/> <aop:config> <aop:advisor id="managerTx" advice-ref="txAdvice" pointcut="execution(* *..service.*Manager.*(..))"/> </aop:config> <tx:advice id="txAdvice"> <tx:attributes> <tx:method name="get*" read-only="true"/> <tx:method name="*"/> </tx:attributes> </tx:advice> <!-- Scans for @Repository, @Service and @Component --> <context:component-scan base-package="co.com.quipux.entapp"/>
and no new() initialization for the TIPOPERFILUSUARIOManager so IOC from Spring is needed..public TIPOPERFILUSUARIOManager tipoperfilusuarioManager;
the manager implementation class has:
I debug thee application and see how the managerimpl is correctly initialized but something is happening and the instance is not being binded to the Form class, any ideas?Code:@Service(value = "tipoperfilusuarioManager") public class TIPOPERFILUSUARIOManagerImpl implements TIPOPERFILUSUARIOManager {
by the way, this is the Stack Trace, that kicks out when in the form constructor I try to acces a function of the null property tipoperfilusuarioManager
Code:Aug 28, 2008 11:33:27 AM org.apache.catalina.core.ApplicationContext log SEVERE: Cant instantiate class: co.com.quipux.entapp.qxvehiculos.web.TIPOPERFILUSUARIOForm. com.sun.faces.mgbean.ManagedBeanCreationException: Cant instantiate class: co.com.quipux.entapp.qxvehiculos.web.TIPOPERFILUSUARIOForm. at com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:191) at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:106) at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:368) at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:230) at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:88) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)


Reply With Quote
