项目与MiniDao整合时,一直报java.lang.NullPointerException
如题
java.lang.NullPointerException
at jeecg.photoManage.service.impl.photo.CompanyServiceImpl.insertCompany(CompanyServiceImpl.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
CompanyServiceImpl 类
@Service("companyService")
@Transactional
public class CompanyServiceImpl extends CommonServiceImpl implements CompanyServiceI {
private CompanyDao companyDao;
@Arguments("company")
public void insertCompany(CompanyEntity company) {
// TODO Auto-generated method stub
companyDao.insertCompany(company);
}
}
CompanyDao 类
public interface CompanyDao extends MiniDaoSupportHiber<CompanyEntity>{
@Arguments("company")
public void insertCompany(CompanyEntity company);
}
spring-minidao.xml文件
<!-- 注册MiniDao接口 -->
<bean class="org.jeecgframework.minidao.factory.MiniDaoBeanFactory">
<property name="packagesToScan">
<list>
<value>jeecg.cgreport.dao.*</value>
<value>jeecg.cgform.dao.*</value>
<value>jeecg.photoManage.dao.*</value>
</list>
</property>
</bean>
<!-- 注册CompanyDao接口 -->
<bean id="companyDao" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces" value="jeecg.photoManage.dao.CompanyDao" />
<property name="interceptorNames">
<list>
<value>miniDaoHandler</value>
</list>
</property>
</bean>
目录文件
QQ截图20131012081304.jpg (24.62 KB, 下载次数: 0)
http://www.jeecg.org/data/attachment/forum/201310/12/081425u31iyp1ppi8yzs3l.jpg
应该配置的都已经配置好了,但一直还是报空指针错,求高手指点
问题找到了,原来是配置的问题
spring-minidao.xml文件里
<!-- 注册MiniDao接口 -->
<bean id="proxyFactoryBean" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces" >
<list>
<value>jeecg.photoManage.dao.CompanyDao</value>
</list>
</property>
<property name="interceptorNames">
<list>
<value>miniDaoHandler</value>
</list>
</property>
</bean>
中<value>jeecg.photoManage.dao.CompanyDao</value>这个值一定要指定到具体的DAO
页:
[1]