警告: Unable to proxy method [public final void org.springframework.orm.hibernate3.support.HibernateDaoSupport.setSessionFactory(org.hibernate.SessionFactory)] because it is final: All calls to this method via a proxy will be routed directly to the proxy.
2010-1-5 6:22:27 org.springframework.aop.framework.Cglib2AopProxy doValidateClass2010-1-5 6:22:28 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
警告: no default parameter defined for result of type json配置的版本
struts2.1.8.1
spring-framework-2.5.6.SEC01
hibernate-distribution-3.3.2.GA
spring.xml<bean id="placeholderConfig"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>classpath:com/flexoa/config/spring/hibernate.properties
</value>
</property>
</bean> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close">
<property name="jdbcUrl"
value="jdbc:mysql://127.0.0.1:3306/extJsTest?useUnicode=true&amp;characterEncoding=utf-8" />
<property name="driverClass" value="${hibernate.connection.driver_class}" />
<property name="user" value="${hibernate.connection.username}" />
<property name="password" value="${hibernate.connection.password}" />
<property name="acquireIncrement" value="${c3p0.acquireIncrement}" />
<property name="initialPoolSize" value="${c3p0.initialPoolSize}" />
<property name="minPoolSize" value="${c3p0.minPoolSize}" />
<property name="maxPoolSize" value="${c3p0.maxPoolSize}" />
<property name="maxStatements" value="${c3p0.maxStatements}" />
<property name="numHelperThreads" value="${c3p0.numHelperThreads}" />
<property name="maxIdleTime" value="${c3p0.maxIdleTime}" />
</bean> <!--
Hibernate SessionFactory
-->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource" />
</property>
<!--  -->
<property name="mappingResources">
<list>
<value>com/flexoa/model/UserInfo.hbm.xml</value>
<value>com/flexoa/model/Category.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.generate_statistics">true</prop>
<prop key="hibernate.connection.release_mode">auto</prop>
<prop key="hibernate.autoReconnect">true</prop>
<prop key="hibernate.use_sql_comments">false</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">true</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
</props>
</property>
</bean> <!--
Transaction manager for a single Hibernate SessionFactory (alternative
to JTA)
-->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager"
p:sessionFactory-ref="sessionFactory" /> <!--
事务配置 XML的aop/tx配置比采用标注更方面,因为不用到处打注解 
-->
<aop:config proxy-target-class="true">
<aop:advisor pointcut="execution(* com.flexoa.hibernate.impl.*.*(..))"
advice-ref="txAdvice" />
</aop:config> <tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!--  -->
<tx:method name="find*" read-only="true" />
<tx:method name="save*" />
<tx:method name="delete*" />
<tx:method name="*" no-rollback-for="java.lang.Throwable" />
</tx:attributes>
</tx:advice> <bean id="freeerConfig"
class="org.springframework.web.servlet.view.freeer.FreeMarkerConfigurer">
<property name="freeerSettings">
<props>
<prop key="classic_compatible">true</prop>
</props>
</property>
</bean>
请教,会不会有问题,该怎么解决,我本地测试crud都没问题

解决方案 »

  1.   

    这是是事务转移问题,你如果在控制层加入事务就不会有提示了,也没有警告,一般很多人在final DAO里加入事务那是有警告的,你可以无视它,也没有问题。但是如果配置多了,警告很多,那么启动速度很慢。先把第一个解决看看第二个警告是否还出。
      

  2.   

    All calls to this method via a proxy will be routed directly to the proxy.会产生脏数据的.
    这是spring事物管理报的错,如果不处理你的数据就很危险了,because it is final,去看看你的方法是不是final的.
    spring的事物代理是继承你写的类,然后在你的基础上加事物管理,final的他继承不了
      

  3.   

    2楼说的不错 另外 你缺少包
    2010-1-5 6:22:28 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn 
    警告: no default parameter defined for result of type json 少 commons 的包  commons有很多包 ,  另外  你还整合json了把, Struts2整合json的时候需要注意版本  不同的Struts2版本需要对应不同的整合Json包。 一定注意。
      

  4.   

    但我没有在哪里定义final啊?网上也大致这样说,不解