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"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="datasource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver">
</property>
<property name="url"
value="jdbc:sqlserver://localhost:1433;databaseName=epet">
</property>
<property name="username" value="sa"></property>
<property name="password" value="sa"></property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="datasource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
<prop key="show_sql">true</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>entity/CstCustomer.hbm.xml</value>
<value>entity/CstLinkman.hbm.xml</value>
<value>entity/CstService.hbm.xml</value>
<value>entity/CstActivity.hbm.xml</value>
<value>entity/CstLost.hbm.xml</value>
<value>entity/BasDict.hbm.xml</value>
<value>entity/SalChance.hbm.xml</value>
<value>entity/SalPlan.hbm.xml</value>
<value>entity/SysRoleRight.hbm.xml</value>
<value>entity/SysUser.hbm.xml</value>
<value>entity/SysRight.hbm.xml</value>
<value>entity/SysRole.hbm.xml</value>
<value>entity/Storage.hbm.xml</value>
<value>entity/Product.hbm.xml</value>
<value>entity/OrdersLine.hbm.xml</value>
<value>entity/Orders.hbm.xml</value>
<value>entity/Sysdiagrams.hbm.xml</value></list>
</property>
</bean> <bean id="logindao" class="dao.impl.Logindao" abstract="false"
lazy-init="default" autowire="default" dependency-check="default">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="loginbiz" class="biz.impl.LoginbizImpl" abstract="false"
lazy-init="default" autowire="default" dependency-check="default">
<property name="login">
<ref bean="logindao" />
</property>
</bean>
<bean name="/login" class="com.crm.struts.action.LoginAction"
abstract="false" lazy-init="default" autowire="default"
dependency-check="default">
<property name="loginbiz">
<ref bean="loginbiz" />
</property>
</bean>
</beans>
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"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="datasource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver">
</property>
<property name="url"
value="jdbc:sqlserver://localhost:1433;databaseName=epet">
</property>
<property name="username" value="sa"></property>
<property name="password" value="sa"></property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="datasource" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
<prop key="show_sql">true</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>entity/CstCustomer.hbm.xml</value>
<value>entity/CstLinkman.hbm.xml</value>
<value>entity/CstService.hbm.xml</value>
<value>entity/CstActivity.hbm.xml</value>
<value>entity/CstLost.hbm.xml</value>
<value>entity/BasDict.hbm.xml</value>
<value>entity/SalChance.hbm.xml</value>
<value>entity/SalPlan.hbm.xml</value>
<value>entity/SysRoleRight.hbm.xml</value>
<value>entity/SysUser.hbm.xml</value>
<value>entity/SysRight.hbm.xml</value>
<value>entity/SysRole.hbm.xml</value>
<value>entity/Storage.hbm.xml</value>
<value>entity/Product.hbm.xml</value>
<value>entity/OrdersLine.hbm.xml</value>
<value>entity/Orders.hbm.xml</value>
<value>entity/Sysdiagrams.hbm.xml</value></list>
</property>
</bean> <bean id="logindao" class="dao.impl.Logindao" abstract="false"
lazy-init="default" autowire="default" dependency-check="default">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="loginbiz" class="biz.impl.LoginbizImpl" abstract="false"
lazy-init="default" autowire="default" dependency-check="default">
<property name="login">
<ref bean="logindao" />
</property>
</bean>
<bean name="/login" class="com.crm.struts.action.LoginAction"
abstract="false" lazy-init="default" autowire="default"
dependency-check="default">
<property name="loginbiz">
<ref bean="loginbiz" />
</property>
</bean>
</beans>
解决方案 »
- 如何防止action提交后刷新页面的重复提交
- hibernate 怎么实现嵌套子查询 ?
- 请问这条语句什么意思?在哪里实现这条语句呢?jdbc:oracle:thin:@126.21.44.172:8022:cissdev
- IBATIS 复杂类型属性(即自定义类型的属性)问题各位帮帮小弟,搞了好久没有找到问题原因
- 在s2sh中使用hibernate注解测试时报错
- hibernate的延迟初始化错误
- 大家推荐下有哪些实用的JAVA工具类
- 这个类为什么执行最后不是打印after change!请指教!
- struts
- 开发struts遇到的问题,请指教啊
- 请教spring的事务控制问题
- 求助,hibernate建表问题,在线等,急。。。
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation">
<value>classpath:hibernate.cfg.xml</value>
</property>
</bean> 你的不清楚!