Fala galera…to com o seguinte problema: quando clico em ‘consultar’ e o código (id) é inválido, o programa funciona direito, mas quando eu coloco um ‘id’ válido, ele da erro…já tentei de tudo e o erro persiste. Me falaram para retirar o collection atual, estanciar um novo e apontar para o TABLE_DATA_ATTRIBUTE, mas eu não entendi nada disso rs
Será que alguém pode me ajudar?
O que que acontece é o seguinte:
Descrição: null
Detalhes: URL: http://localhost:8080/blankProject/cadSoftware.do
Referrer: http://localhost:8080/blankProject/cadSoftware.do?metodo=showAction&clean=true
Parâmetro:
metodo: pesquisar
resetForm: undefined
auxId: 12
lastMethod: showAction
pagePaginateBean: 1
id: 12
path: /blankProject
intervalPaginateBean: 1
Stack Trace:
java.lang.ClassCastException at gpbr.web.blankproject.view.action.cadastros.cadsoftware.SoftwareAction.pesquisar(SoftwareAction.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280) at gpbr.web.action.BasicAction.dispatchMethod(BasicAction.java:155) at gpbr.web.action.BasicAction.dispatch(BasicAction.java:128) at gpbr.web.filter.FilterChain.doChain(FilterChain.java:60) at gpbr.web.filter.paginate.PaginateFilter.doFilter(PaginateFilter.java:34) at gpbr.web.filter.FilterChain.doChain(FilterChain.java:58) at gpbr.web.action.BasicAction.execute(BasicAction.java:84) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:534)
e meu action, que chama o ‘pesquisar’, está assim:
public ActionForward pesquisar(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws WebActionException {
try {
SoftwareBusinessDelegate softwareBusinessDelegate = (SoftwareBusinessDelegate) getBusinessDelegate();
Collection listSoft = (Collection) softwareBusinessDelegate.findSoftwareById(((FormBean)form).getPersistentObj());
request.setAttribute(BasicAction.TABLE_DATA_ATTRIBUTE, listSoft);
} catch (GpbrPersistException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return mapping.findForward("showCadSoftware");
}
Alguma ajuda?