Re: "getHibernateTemplate()" returns null
 
Hi,
I am not sure but I think that there is issue in
RequestProcessorHelper.java because of that getHibernateTemplate()
returns null.
I am using Struts, Spring and Hibernate in my project. I customized
the RequestProcessor, Whenever request comes controller
"CRTrackerRequestProcessor" is called instead of "RequestProcessor".
Please check struts config as mentioned below.
------------ struts-config.xml -------------
<struts-config>
    ...
    ..
    <controller
processorClass="com.mycomp.crtracker.controller.CRTrackerRequestProcessor"/
    ..
    ...
</struts-config>
---------------
com.mycomp.crtracker.controller.CRTrackerRequestProcessor
----------------
public class CRTrackerRequestProcessor extends RequestProcessor {
    private RequestProcessorHelper helper = null;
    public CRTrackerRequestProcessor(){
        super();
        helper = new RequestProcessorHelper();
    }
    public void process(HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException{
        if(helper.checkMember(request, response)){
            super.process(request, response);
        }
    }
}
In "RequestProcessorHelper" I created a new bean using "new" operator
for MemberDAOImpl. When doing this, MemberDAOImpl bean isn't managed
by spring.
--------------- com.mycomp.crtracker.controller.RequestProcessorHelper
----------------
public class RequestProcessorHelper {
public boolean checkMember(HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException{
    if(memberVO == null){
            try{
                ...
                MemberDAOImpl memberDAO = new MemberDAOImpl();
           ...
        }catch(Exception ex){}
        }
}
If this is the cause, I don't know how to fix this problem. Could
anyone help me.
Thanks in advance,
Amit Jain