Error creating bean with name 'userAction' defined in class path resource

时间:2021-07-02 08:56:26
 Error creating bean with name 'userAction' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [action.AmlUserAction]: Constructor threw exception; nested exception is java.lang.NullPointerException 报的错误
applicationContext.xml配置文件如下:
<?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:tx="http://www.springframework.org/schema/tx"
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.5.xsd
       http://www.springframework.org/schema/tx
       http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
       http://www.springframework.org/schema/aop
       http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
    ">
<!-- hibernate 连接 以及优化-->
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:@localhost:1521:orcl" />
<property name="username" value="liuyong" />
<property name="password" value="accp" />
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
<property name="mappingResources">
<list>
<!-- 映射文件 -->
<value>entity/Amluser.hbm.xml</value>


</list>
</property>
</bean>
<!--事务管理器  -->
<bean id="txTranManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<tx:advice id="tranAdvice" transaction-manager="txTranManager">
<tx:attributes>
<tx:method name="get*" propagation="SUPPORTS" read-only="true" />
<tx:method name="load*" propagation="SUPPORTS" read-only="true" />
<tx:method name="search*" propagation="SUPPORTS" read-only="true" />
<tx:method name="*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="bizMethods" expression="execution(* biz.*.*(..))" />
<aop:advisor advice-ref="tranAdvice" pointcut-ref="bizMethods" />
</aop:config>
<!-- New java bean -->
<bean id="commonDao" class="dao.impl.AmlCommoDaoImpl">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="userBiz" class="biz.impl.AmlUserBizImpl">
<property name="dao" ref="commonDao" />
</bean>
<bean id="userAction" class="action.AmlUserAction">
<property name="userBiz" ref="userBiz"></property>
</bean>
</beans>
AmlUserAction部分代码:
public class AmlUserAction extends ActionSupport {

/**
 * 
 */
private static final long serialVersionUID = 1L;
private Amluser user;
private UserBiz userBiz =null;

求救啊,,,怎么解决这么个玩意,,

1 个解决方案

#1


在线等,,,,速求解决方案,,,

#1


在线等,,,,速求解决方案,,,