Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by sriharsha vardhan
, 1 year ago
tag 'select', field 'list', name 'pid': The requested list key 'projectidList' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location] //SprintAction.java package
org.apache.jasper.JasperException: tag 'select', field 'list', name 'pid': The requested list key 'projectidList' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location]     //SprintAction.java
    package com.bits.sprintanalyzer.action;
        import java.util.List;
        import org.apache.log4j.Logger;
        import com.bits.sprintanalyzer.ResourceException;
        import com.bits.sprintanalyzer.dao.SprintDAO;
        import com.opensymphony.xwork2.ActionSupport;
        public class SprintAction extends ActionSupport {
            private static final Logger LOG = Logger.getLogger(SprintAction.class);
            /**
             * 
             */
            private static final long serialVersionUID = -6257623073537028210L;
            private String title;
            private String begindate;
            private String enddate;
            private String pid;
            private String sprintowner;
            private String state;
            private int targetestimatedpoints;
            private int totalestimatedpoints;
            private int totaldefaultestimatedhours;
            private int todohours;
            private String description;
            public String getPid() {
                return pid;
            }
            public void setPid(String pid) {
                this.pid = pid;
            }
            public String getSprintowner() {
                return sprintowner;
            }
            public void setSprintowner(String sprintowner) {
                this.sprintowner = sprintowner;
            }
            public String getState() {
                return state;
            }
            public void setState(String state) {
                this.state = state;
            }
            public int getTargetestimatedpoints() {
                return targetestimatedpoints;
            }
            public void setTargetestimatedpoints(int targetestimatedpoints) {
                this.targetestimatedpoints = targetestimatedpoints;
            }
            public int getTotalestimatedpoints() {
                return totalestimatedpoints;
            }
            public void setTotalestimatedpoints(int totalestimatedpoints) {
                this.totalestimatedpoints = totalestimatedpoints;
            }
            public int getTotaldefaultestimatedhours() {
                return totaldefaultestimatedhours;
            }
            public void setTotaldefaultestimatedhours(int totaldefaultestimatedhours) {
                this.totaldefaultestimatedhours = totaldefaultestimatedhours;
            }
            public int getTodohours() {
                return todohours;
            }
            public void setTodohours(int todohours) {
                this.todohours = todohours;
            }
            public String getDescription() {
                return description;
            }
            public void setDescription(String description) {
                this.description = description;
            }
            public String display() throws Exception {
                return INPUT;
            }
            public String getBegindate() {
                return begindate;
            }
            public void setBegindate(String begindate) {
                this.begindate = begindate;
            }
            public String getEnddate() {
                return enddate;
            }
            public void setEnddate(String enddate) {
                this.enddate = enddate;
            }
            public String getTitle() {
                return title;
            }
            public void setTitle(String title) {
                this.title = title;
            }
            **public List<String> getpidList() throws ResourceException {
                return SprintDAO.getpidList();
            }
            public List<String> getOwnerList() throws ResourceException {
                return SprintDAO.getOwnerList();
            }**
            @Override
            public void validate() {
            }
            @Override
            public String execute() throws Exception {
                LOG.info("title" + title);
                LOG.info("begindate" + begindate);
                LOG.info("enddate" + enddate);
                LOG.info("pid" + pid);
                LOG.info("sprintowner" + sprintowner);
                LOG.info("state" + state);
                LOG.info("targetestimatedpoints" + targetestimatedpoints);
                LOG.info("totalestimatedpoints" + totalestimatedpoints);
                LOG.info("totaldefaultestimatedhours" + totaldefaultestimatedhours);
                LOG.info("todohours" + todohours);
                LOG.info("description" + description);
                int i = SprintDAO.save(this);
                if (i > 0) {
                    return "success";
                }
                return "error";
            }
        }
    //SPrintDAO
    package com.bits.sprintanalyzer.dao;
        import java.sql.Connection;
        import java.sql.PreparedStatement;
        import java.sql.ResultSet;
        import java.sql.SQLException;
        import java.util.ArrayList;
        import java.util.List;
        import com.bits.sprintanalyzer.ResourceException;
        import com.bits.sprintanalyzer.action.SprintAction;
        import com.bits.sprintanalyzer.util.ConnectionUtil;
        public class SprintDAO {
            private static final String PROJECTQUERY = "select pid from project";
            private static final String USERQUERY = "select name from userdetail";
            public static List<String> getpidList() throws ResourceException{
                List<String> projectidList = new ArrayList<String>();
                // this should be populated from DB
                try (Connection con = ConnectionUtil.INSTANCE.getConnection();
                        PreparedStatement st = con.prepareStatement(PROJECTQUERY)){
                        ResultSet rs =st.executeQuery();
                        while(rs.next()){
                            projectidList.add(rs.getString(1));
                        }
                return projectidList;
        }
                catch (SQLException | ResourceException e) {
                    throw new ResourceException("Failed to validate project id", e);
                }
        }
            public static List<String> getOwnerList() throws ResourceException{
                List<String> sprintownerList = new ArrayList<String>();
                // this should be populated from DB
                try (Connection con = ConnectionUtil.INSTANCE.getConnection();
                        PreparedStatement st = con.prepareStatement(USERQUERY)){
                        ResultSet rs =st.executeQuery();
                        while(rs.next()){
                            sprintownerList.add(rs.getString(1));
                        }
                return sprintownerList;
        }
                catch (SQLException | ResourceException e) {
                    throw new ResourceException("Failed to validate productowner", e);
                }
        }
            //insert into database
                public static int save(SprintAction SA) throws Exception{ 
                    int status=0;
                    try{
                    Connection con = ConnectionUtil.INSTANCE.getConnection();
                    PreparedStatement ps = con.prepareStatement("insert into sprint(pid,title,begindate,enddate,owner,state,targetestimatedpoints,totalestimatedpoints,totaldefaultestimatedhours,todohours,description) values(?,?,?,?,?,?,?,?,?,?,?)");
                    ps.setString(1, SA.getPid());
                    ps.setString(2, SA.getTitle());
                    ps.setString(3, SA.getBegindate());
                    ps.setString(4, SA.getEnddate());
                    ps.setString(5, SA.getSprintowner());
                    ps.setString(6, SA.getState());
                    ps.setInt(7, SA.getTargetestimatedpoints()); 
                    ps.setInt(8, SA.getTotalestimatedpoints());
                    ps.setInt(9, SA.getTotaldefaultestimatedhours());
                    ps.setInt(10, SA.getTodohours());
                    ps.setString(11, SA.getDescription());
                    status=ps.executeUpdate();
                }catch(Exception e){
                e.printStackTrace();}  
                return status;  
                }  
        }
    // struts.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts PUBLIC
        "-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN"
        "/WEB-INF/classes/struts-2.1.7.dtd">
    <struts>
        <!--
        You could also set the constants in the struts.properties file
        placed in the same directory as struts.xml
        -->
        <constant name="struts.devMode" value="true" />
        <package name="sprintanalyzer" extends="struts-default" namespace="/">
            <!--
            If no class attribute is specified the framework will assume success and
            render the result index.jsp
            If no name value for the result node is specified the success value is the default
            -->
            <action name="">
                <result>/jsp/login.jsp</result>
            </action>
            <!--
            If the URL is hello.action then call the execute method of class HelloWorldAction.
            If the result returned by the execute method is success render the HelloWorld.jsp
            -->
            <action name="login" class="com.bits.sprintanalyzer.action.LoginAction"
                method="execute">
                <result name="success">/jsp/sprintanalyzer.jsp</result>
                <result name="input">/jsp/login.jsp</result>
            </action>
            <action name="projectform" class="com.bits.sprintanalyzer.action.ProjectAction"
                method="display">
                <result name="input">/jsp/projectform.jsp</result>
            </action>
            <action name="projectInsert" class="com.bits.sprintanalyzer.action.ProjectAction"
                method="execute">
                <result name="success">/jsp/sprintanalyzer.jsp</result>
            </action>   
                <action name="sprintform" class="com.bits.sprintanalyzer.action.SprintAction"
                method="display">
                <result name="input">/jsp/sprintform.jsp</result>
            </action>
            <action name="sprintInsert" class="com.bits.sprintanalyzer.action.SprintAction"
                method="execute">
                <result name="success">/jsp/sprintanalyzer.jsp</result>
            </action>   
        enter code here
        </package>
    </struts>
        // stacktrace
    2016-10-01T18:55:04.396+0530|Warning: Servlet.service() for servlet jsp threw exception
        tag 'select', field 'list', name 'pid': The requested list key 'projectidList' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location]	at org.apache.struts2.components.Component.fieldError(Component.java:237)	at org.apache.struts2.components.Component.findValue(Component.java:358)	at org.apache.struts2.components.ListUIBean.evaluateExtraParams(ListUIBean.java:80)	at org.apache.struts2.components.Select.evaluateExtraParams(Select.java:105)	at org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:856)	at org.apache.struts2.components.UIBean.end(UIBean.java:510)	at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)	at org.apache.jsp.jsp.sprintform_jsp._jspx_meth_s_select_0(sprintform_jsp.java:236)	at org.apache.jsp.jsp.sprintform_jsp._jspx_meth_s_form_0(sprintform_jsp.java:144)	at org.apache.jsp.jsp.sprintform_jsp._jspService(sprintform_jsp.java:88)	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)	at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:875)	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:739)	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:575)	at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:546)	at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:428)	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:378)	at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:154)	at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)	at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:362)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:266)	at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)	at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)	at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)	at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)	at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)	at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)	at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)	at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)	at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)	at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)	at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)	at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)	at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)	at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)	at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)	at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)	at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)	at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)	at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)	at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)	at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)	at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)	at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)	at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)	at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)	at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)	at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)	at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)	at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)	at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)	at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)	at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)	at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)	at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)	at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)	at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)	at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)	at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)	at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)	at java.lang.Thread.run(Thread.java:745)