Why is "method is not applicable for the arguments"

I am trying to create a new .jsp page by copying a similar page.

I've been hobbling along by making small changes here and there so a pretty good sense of what is going on, but I have a compile error that I have no clue how to figure out.

This is a simple page that displays a list of 20 data loads, for a given day. Then the user can scroll back and forth, day by day.

Here's the error:
"The method getProcessName() in the type ProcessControlTable is not applicable for the arguments (String)"

My java pieces are:
- Domain: ProcessControlTable.java
- DAO:
   - DailyLoadDetailsDAO.java
   - DailyLoadDetailsDAOImpl.java
- Web: DailyLoadDetailsController
 
I've compared the working system with mine and can't find the difference.

I know this is a debugging exercise but I am dead in the water.
================== ProcessControlTable.java ============
package com.carefirst.edw.domain;

import java.util.Date;
import java.util.List;

public class ProcessControlTable {
	private String subjArea;
	private String srceName;
	private String processName;
	private Date runDate;
	private Date pullFromDate;
	private Date pullThruDate;
	private String runFreq;
		
	public String getSubjArea() {
		return subjArea;
	}
	public void setSubjArea(String subjArea) {
		this.subjArea = subjArea;
	}

	public String getSrceName() {
		return srceName;
	}
	public void setSrceName(String srceName) {
		this.srceName = srceName;
	}

	public String getProcessName() {
		return processName;
	}
	public void setProcessName(String processName) {
		this.processName = processName;
	}

	public Date getRunDate() {
		return runDate;
	}
	public void setRunDate(Date runDate) {
		this.runDate = runDate;
	}

	public Date getPullFromDate() {
		return pullFromDate;
	}
	public void setPullFromDate(Date pullFromDate) {
		this.pullFromDate = pullFromDate;
	}

	public Date getPullThruDate() {
		return pullThruDate;
	}
	public void setPullThruDate(Date pullThruDate) {
		this.pullThruDate = pullThruDate;
	}

	public String getRunFreq() {
		return runFreq;
	}
	public void setRunFreq(String runFreq) {
		this.runFreq = runFreq;
	}
	
}

================== DailyLoadDetailsDAO.java ============
package com.carefirst.edw.dao;

import java.util.Date;
import java.util.List;

public interface DailyLoadDetailsDAO {
	public abstract List getLoadDetails(Date date);
}


================== DailyLoadDetailsDAOImpl.java (this is where the errors are, see .jpg) ============
package com.carefirst.edw.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Types;
import java.util.Date;
import java.util.List;

import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport;

import com.carefirst.edw.domain.ProcessControlTable;

public class DailyLoadDetailsDAOImpl extends NamedParameterJdbcDaoSupport implements DailyLoadDetailsDAO {
	private static final String LOAD_DETAILS_SQL = 
		
	"select lk.subj_area, lk.srce_sys_cd_desc||' - '||lk.srce_sys_cd as source, cl.prcs_nm, cl.run_dt, to_char(cl.data_pull_from_dt_tm,'MM/DD/YYYY') as data_from, " +
	"       to_char(cl.data_pull_thru_dt_tm,'MM/DD/YYYY') as data_thru, cl.prcs_freq " +
	" from  edm_sys.edm_srce_sys_lkup lk " +
    "	    left join edm_sys.edm_cntl cl on lk.edm_srce_sys_skey = cl.edm_srce_sys_skey and trunc(cl.aud_insrt_tmstp) = :date " +
    " order by 1,2, 3 ";
	
	public List getLoadDetails(Date date) {
		MapSqlParameterSource map = new MapSqlParameterSource();
		map.addValue("date", date);
		
		List history = getNamedParameterJdbcTemplate().query(LOAD_DETAILS_SQL, map, new DailyDetailsRowMapper()); 
		
		return history;
	}

    private class DailyDetailsRowMapper implements RowMapper {
        public Object mapRow(ResultSet rs, int arg1) throws SQLException {
        	ProcessControlTable detail = new ProcessControlTable();
        	detail.getSubjArea(rs.getString("subj_area"));
        	detail.getSrceName(rs.getString("source"));
        	detail.getProcessName(rs.getString("prcs_nm"));
        	detail.getRunDate(rs.getDate("run_dt"));
        	detail.getPullFromDate(rs.getDate("data_from"));
        	detail.getPullThruDate(rs.getDate("data_thru"));
        	detail.getRunFreq(rs.getString("prcs_freq"));            
        	return detail;
        }
    }
}

================== DailyLoadDetailsController ============
package com.carefirst.edw.web;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import com.carefirst.edw.dao.DailyLoadDetailsDAO;

public class DailyLoadDetailsController extends MonthSelectorController implements Controller {
	protected final Log logger = LogFactory.getLog(getClass());
	private DailyLoadDetailsDAO dao = null;
	
	public ModelAndView handleRequest(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		String date = request.getParameter("DATE");
		String subject = request.getParameter("SUBJ");
		SimpleDateFormat sdf = new SimpleDateFormat("MMddyyyy");
		Date reportDate = sdf.parse(date);
		Date previousDate = getPreviousDate(reportDate);
		Date nextDate = getNextDate(reportDate);
		
		List details = dao.getLoadDetails(reportDate);
		
		Map model = new HashMap();
		model.put("currentDate", reportDate);
		model.put("prevDate", previousDate);
		model.put("nextDate", nextDate);
		model.put("subjectArea", subject);
		model.put("date", reportDate);
		model.put("details", details);
		return new ModelAndView("dailyLoadDetails" + subject, "model", model);
	}

	public void setDailyLoadDetailsDAO(DailyLoadDetailsDAO dao) {
		this.dao = dao;
	}
}

Open in new window

DAO-error.bmp
LVL 1
Alaska CowboyAsked:
Who is Participating?
 
objectsCommented:
               detail.getSubjArea(rs.getString("subj_area"));
                detail.getSrceName(rs.getString("source"));
                detail.getProcessName(rs.getString("prcs_nm"));
                detail.getRunDate(rs.getDate("run_dt"));
                detail.getPullFromDate(rs.getDate("data_from"));
                detail.getPullThruDate(rs.getDate("data_thru"));
                detail.getRunFreq(rs.getString("prcs_freq"));            


the should all be setXyz (not getXyz)
0
 
Alaska CowboyAuthor Commented:
.pdf of screen print
compile-error.pdf
0
 
Alaska CowboyAuthor Commented:
Oh, oops, still getting my feet wet on this.

Thanks, I'll try tonight and let you know.
0
 
Alaska CowboyAuthor Commented:
did the trick ! thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.