java ssh框架项目,tomcat服务器出现java.lang.NullPointerException 求助
NIUBI 2015-08-06 01:19:19 HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
java.lang.NullPointerException
action.TstudentAction.findAll(TstudentAction.java:19)
显示在Action里的19行错误
//Action类
public class TstudentAction extends ActionSupport{
private static final long serialVersionUID = 1L;
TstudentServiceImpl ts;
public String findAll(){
System.out.println("Action===============");
List<Tstudent> list = ts.findAll(); //第十九行
ActionContext.getContext().getSession().put("list", list);
return "getStudent";
}
public TstudentServiceImpl getTs() {
return ts;
}
public void setTs(TstudentServiceImpl ts) {
this.ts = ts;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
}
//service类
public class TstudentServiceImpl implements TstudentService{
TstudentDAOImpl dao;
public List<Tstudent> findAll() {
System.out.println("TstudentService==========");
List<Tstudent> list = dao.finlAll();
return list;
}
public TstudentDAOImpl getDao() {
return dao;
}
public void setDao(TstudentDAOImpl dao) {
this.dao = dao;
}
}
DAO以及service 的接口就不列出来了
//还有Spring的配置文件
<!-- 获取session -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
<!-- 获取事务管理 -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<!-- 配置事务 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="del*" propagation="REQUIRED"/>
<tx:method name="select*" propagation="REQUIRED"/>
<tx:method name="find*" propagation="REQUIRED"/>
<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice>
<!-- 加人事物管理 -->
<aop:config>
<aop:pointcut expression="execution(* service.*.*(..))" id="page"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="page"/>
</aop:config>
<bean id="TstudentDAOImpl" class="dao.impl.TstudentDAOImpl">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<bean id="TstudentService" class="service.impl.TstudentServiceImpl">
<property name="dao">
<ref bean="TstudentDAOImpl"/>
</property>
</bean>
<bean id="TstudentAction" class="action.TstudentAction">
<property name="ts">
<ref bean="TstudentService"/>
</property>
</bean>
//struts里的配置
<struts>
<package name="login" extends="struts-default">
<action name="student" class="action.TstudentAction">
<result name="getStudent" type="redirect">/index.jsp</result>
</action>
</package>
</struts>
拜托大家帮帮忙,自己独自学习加班加点,求指导