面孔-config.xml
- org.springframework.web.jsf.DelegatingVariableResolver
应用程序上下文.xml
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<tx:annotation-driven />
<context:component-scan base-package="com.test"/>
索引.xhtml
<h:outputText value="#{authBean.val}"/>
AuthBean.java
package com.test.ui;
@Component
@Scope("session")
public class AuthBean {
@Getter @Setter private String val;
@Transactional public void test(){} //works fine if @Transactional is removed
工作正常,但是当使用 @Transactional 注释方法时,会发生以下错误
16:23:13,906 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jbtst].[Faces Servlet]] (http-localhost-127.0.0.1-8080-1) Servlet.service() for servlet Faces Servlet threw exception: javax.el.PropertyNotFoundException: /index.xhtml @14,49 value="#{authBean.val}": The class '$Proxy28' does not have the property 'val'.
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:111) [jsf-impl-2.1.7-jbossorg-2.jar:]
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.component.UIOutput.getValue(UIOutput.java:169) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
使用 spring-3.1、hibernate3