"PeterJ" wrote:
In your first post you also listed the contents of the WAR file. I hope that the servlet is now at
WEB-INF/classes/com/trails/xxx/web/XXXServlet.class
By the way, you never posted the XXXServlet class source code. What other classes is XXServlet using? It could be that one of those classes is missing.
Yes, the servlet is at: WEB-INF/classes/com/trails/xxx/web/XXXServlet.class
~$ jar -tf <folder-jboss_deploy>/xxx.war
...
WEB-INF/classes/com/trails/xxx/util/XXXUtil.class
WEB-INF/classes/com/trails/xxx/web/XXXConst.class
WEB-INF/classes/com/trails/xxx/web/XXXServlet.class
WEB-INF/classes/com/trails/xxx/web/XXXValueFormatter.class
WEB-INF/classes/com/trails/xxx/web/CacheHolder.class
...
Follow the code of the XXXServlet:
package com.trails.xxx.web;
import javax.servlet.ServletException;
import org.apache.log4j.Category;
import com.trails.xxx.web.collection.ActionContaCollection;
import com.trails.xxx.web.collection.ActionPontosCriticosCollection;
import com.trails.xxx.web.collection.AllowedOperationsCollection;
import com.trails.xxx.web.collection.AssuntosParaConselhoCollection;
import com.trails.xxx.web.collection.CenarioCollection;
import com.trails.xxx.web.collection.ColunaRelatorioCollection;
import com.trails.xxx.web.collection.ComentarioContaCollection;
import com.trails.xxx.web.collection.ContaCollection;
import com.trails.xxx.web.collection.EmpresaCollection;
import com.trails.xxx.web.collection.EndividamentoCollection;
import com.trails.xxx.web.collection.EstiloCollection;
import com.trails.xxx.web.collection.FinanciamentoCollection;
import com.trails.xxx.web.collection.GiveOperationCollection;
import com.trails.xxx.web.collection.GiveRoleCollection;
import com.trails.xxx.web.collection.GrupoContaCollection;
import com.trails.xxx.web.collection.GrupoRelatorioCollection;
import com.trails.xxx.web.collection.ListComentarioContaCollection;
import com.trails.xxx.web.collection.OperationCollection;
import com.trails.xxx.web.collection.OperationRoleCollection;
import com.trails.xxx.web.collection.PaginaRelatorioCollection;
import com.trails.xxx.web.collection.PapelCollection;
import com.trails.xxx.web.collection.PasswordCollection;
import com.trails.xxx.web.collection.PeriodoCollection;
import com.trails.xxx.web.collection.PlanoCollection;
import com.trails.xxx.web.collection.PlanoContaCollection;
import com.trails.xxx.web.collection.PlanoContaRelatorioCollection;
import com.trails.xxx.web.collection.PontosCriticosCollection;
import com.trails.xxx.web.collection.PontosRelevantesCollection;
import com.trails.xxx.web.collection.TipoPlanoCollection;
import com.trails.xxx.web.collection.UserRoleCollection;
import com.trails.xxx.web.collection.UsuarioCollection;
import com.trails.xxx.web.command.XXXUpdateSession;
import com.trails.xxx.web.command.CalculaPeriodoCommand;
import com.trails.xxx.web.command.ConferirPeriodoCommand;
import com.trails.xxx.web.command.DeletePeriodoCommand;
import com.trails.xxx.web.command.DesoficializarPeriodoCommand;
import com.trails.xxx.web.command.InserirValoresCommand;
import com.trails.xxx.web.command.InternalTest;
import com.trails.xxx.web.command.MostraValoresCommand;
import com.trails.xxx.web.command.OficializarPeriodoCommand;
import com.trails.xxx.web.command.ShortcutCommand;
import com.trails.xxx.web.command.TrocaPasswordIdaCommand;
import com.trails.xxx.web.command.TrocaPasswordVoltaCommand;
import com.trails.xxx.web.command.VerificaPeriodoCommand;
import com.trails.xxx.web.command.VerificaPlanoContaCommand;
import com.trails.xxx.web.items.XXXCollectionTable;
import com.trails.xxx.web.items.XXXPage;
import com.trails.xxx.web.report.command.CalculateReportCommand;
import com.trails.xxx.web.report.command.CalculateReportMonthCommand;
import com.trails.xxx.web.report.command.GenerateReportCommand;
import com.trails.xxx.web.report.command.ReportFormCommand;
import com.trails.xxx.web.report.command.ResumoMenu;
import com.trails.xxx.web.report.items.ReportFormIntervaloMensalItem;
import com.trails.xxx.web.report.items.ReportFormMesItem;
import com.trails.engine.web.collection.ValueObjectCollection;
import com.trails.engine.web.command.DeleteCommand;
import com.trails.engine.web.command.InsertCommand;
import com.trails.engine.web.command.NullCommand;
import com.trails.engine.web.command.PageCommand;
import com.trails.engine.web.command.UpdateCommand;
import com.trails.engine.web.items.DeleteForm;
import com.trails.engine.web.items.ErrorPage;
import com.trails.engine.web.items.InsertForm;
import com.trails.engine.web.items.Page;
import com.trails.engine.web.items.PageItem;
import com.trails.engine.web.items.UpdateForm;
import com.trails.engine.web.items.ViewForm;
import com.trails.engine.web.servlet.OutputParameters;
import com.trails.engine.web.servlet.PageServlet;
public class XXXServlet extends PageServlet {
// Pega a instancia para o LOG4J
private static Category logger = Category.getInstance(XXXServlet.class);
public static final String APPLICATION_NAME = "XXX - Opportunity";
public static final String APPLICATION_STYLESHEET = "/estilo.css";
public XXXServlet() {
super();
// Adiciona acoes
addAction("view", XXXConst.ACTION_VIEW);
addAction("executeUpdateSession",
XXXConst.ACTION_EXECUTE_SESSION_UPDATE);
addAction("list", XXXConst.ACTION_LIST);
addAction("insert", XXXConst.ACTION_INSERT);
addAction("executeInsert", XXXConst.ACTION_EXECUTE_INSERT);
addAction("update", XXXConst.ACTION_UPDATE);
addAction("executeUpdate", XXXConst.ACTION_EXECUTE_UPDATE);
addAction("delete", XXXConst.ACTION_DELETE);
addAction("executeDelete", XXXConst.ACTION_EXECUTE_DELETE);
addAction("report", XXXConst.ACTION_REPORT);
addAction("executeReport", XXXConst.ACTION_EXECUTE_REPORT);
addAction("executeVerificarPlanoConta",
XXXConst.ACTION_EXECUTE_VERIFICAR_PLANO_CONTA);
addAction("executeVerificarPeriodo",
XXXConst.ACTION_EXECUTE_VERIFICAR_PERIODO);
addAction("executeCalculaPeriodo",
XXXConst.ACTION_EXECUTE_CALCULA_PERIODO);
addAction("calculateReport", XXXConst.ACTION_CALCULATE_REPORT);
addAction("executeCalculateReport",
XXXConst.ACTION_EXECUTE_CALCULATE_REPORT);
addAction("deletePeriodo", XXXConst.ACTION_DELETE_PERIODO);
addAction("viewMultiValue", XXXConst.ACTION_VIEW_MULTI_VALUE);
addAction("insertMultiValue", XXXConst.ACTION_INSERT_MULTI_VALUE);
addAction("test", XXXConst.ACTION_TEST);
addAction("resumo", XXXConst.ACTION_RESUMO);
addAction("executeConferirPeriodo",
XXXConst.ACTION_EXECUTE_CONFERIR_PERIODO);
addAction("oficializarPeriodo", XXXConst.ACTION_OFICIALIZAR_PERIODO);
addAction("executeOficializarPeriodo",
XXXConst.ACTION_EXECUTE_OFICIALIZAR_PERIODO);
addAction("executeDesoficializarPeriodo",
XXXConst.ACTION_EXECUTE_DESOFICIALIZAR_PERIODO);
addAction("executeTrocaSenhaIda",
XXXConst.ACTION_EXECUTE_TROCA_SENHA_IDA);
addAction("executeTrocaSenhaVolta",
XXXConst.ACTION_EXECUTE_TROCA_SENHA_VOLTA);
addAction("pdf", XXXConst.ACTION_EXECUTE_GERA_PDF);
addAction("shortcut", XXXConst.ACTION_SHORTCUT);
addAction("listShortcut", XXXConst.ACTION_LIST_SHORTCUT);
addAction("calculateReportMonth",
XXXConst.ACTION_CALCULATE_REPORT_MONTH);
addAction("executeCalculateReportMonth",
XXXConst.ACTION_EXECUTE_CALCULATE_REPORT_MONTH);
// Adiciona classes
addClass("Cenario", XXXConst.CLASS_CENARIO);
addClass("Conta", XXXConst.CLASS_CONTA);
addClass("Empresa", XXXConst.CLASS_EMPRESA);
addClass("GrupoConta", XXXConst.CLASS_GRUPO_CONTA);
addClass("Plano", XXXConst.CLASS_PLANO);
addClass("PlanoConta", XXXConst.CLASS_PLANO_CONTA);
addClass("PlanoContaRelatorio", XXXConst.CLASS_PLANO_CONTA_RELATORIO);
addClass("Periodo", XXXConst.CLASS_PERIODO);
addClass("TipoPlano", XXXConst.CLASS_TIPOPLANO);
addClass("Usuario", XXXConst.CLASS_USUARIO);
addClass("Papel", XXXConst.CLASS_PAPEL);
addClass("Operacao", XXXConst.CLASS_OPERACAO);
addClass("Allowed", XXXConst.CLASS_ALLOWED);
addClass("UserRole", XXXConst.CLASS_USERROLE);
addClass("GiveRole", XXXConst.CLASS_GIVEROLE);
addClass("OperationRole", XXXConst.CLASS_OPERATIONROLE);
addClass("GiveOperation", XXXConst.CLASS_GIVEOPERATION);
addClass("Password", XXXConst.CLASS_PASSWORD);
addClass("ColunaRelatorio", XXXConst.CLASS_COLUNARELATORIO);
addClass("GrupoRelatorio", XXXConst.CLASS_GRUPO_RELATORIO);
addClass("PaginaRelatorio", XXXConst.CLASS_PAGINARELATORIO);
addClass("Estilo", XXXConst.CLASS_ESTILO);
addClass("ListComentarioConta", XXXConst.CLASS_LISTCONTACOMENTARIO);
addClass("ComentarioConta", XXXConst.CLASS_CONTACOMENTARIO);
addClass("ActionConta", XXXConst.CLASS_ACAOCONTA);
addClass("AssuntosParaConselho", XXXConst.CLASS_ASSUNTOCONSELHO);
addClass("PontosCriticos", XXXConst.CLASS_PONTOSCRITICOS);
addClass("ActionPontosCriticos", XXXConst.CLASS_ACAOPONTOSCRITICOS);
addClass("PontosRelevantes", XXXConst.CLASS_PONTOSRELEVANTES);
addClass("Endividamento", XXXConst.CLASS_ENDIVIDAMENTO);
addClass("Financiamento", XXXConst.CLASS_FINANCIAMENTO);
addClass("Pdf", XXXConst.CLASS_PDF);
}
protected PageCommand getCommand(int actionDescriptor,
OutputParameters parameters) throws ServletException {
PageCommand command = null;
switch (actionDescriptor) {
case XXXConst.ACTION_EXECUTE_SESSION_UPDATE:
command = new XXXUpdateSession();
break;
case XXXConst.ACTION_EXECUTE_INSERT:
command = new InsertCommand();
break;
case XXXConst.ACTION_EXECUTE_UPDATE:
command = new UpdateCommand();
break;
case XXXConst.ACTION_EXECUTE_DELETE:
command = new DeleteCommand();
break;
case XXXConst.ACTION_VIEW_MULTI_VALUE:
command = new MostraValoresCommand();
break;
case XXXConst.ACTION_INSERT_MULTI_VALUE:
command = new InserirValoresCommand();
break;
case XXXConst.ACTION_EXECUTE_VERIFICAR_PLANO_CONTA:
command = new VerificaPlanoContaCommand();
break;
case XXXConst.ACTION_REPORT:
command = new ReportFormCommand();
break;
case XXXConst.ACTION_EXECUTE_REPORT:
command = new GenerateReportCommand();
break;
case XXXConst.ACTION_EXECUTE_VERIFICAR_PERIODO:
command = new VerificaPeriodoCommand();
break;
case XXXConst.ACTION_EXECUTE_CONFERIR_PERIODO:
command = new ConferirPeriodoCommand();
break;
case XXXConst.ACTION_EXECUTE_CALCULA_PERIODO:
command = new CalculaPeriodoCommand();
break;
case XXXConst.ACTION_EXECUTE_CALCULATE_REPORT:
command = new CalculateReportCommand();
break;
case XXXConst.ACTION_EXECUTE_CALCULATE_REPORT_MONTH:
command = new CalculateReportMonthCommand();
break;
case XXXConst.ACTION_DELETE_PERIODO:
command = new DeletePeriodoCommand();
break;
case XXXConst.ACTION_TEST:
command = new InternalTest(); // fixme
break;
case XXXConst.ACTION_OFICIALIZAR_PERIODO:
case XXXConst.ACTION_EXECUTE_OFICIALIZAR_PERIODO:
command = new OficializarPeriodoCommand();
break;
case XXXConst.ACTION_EXECUTE_TROCA_SENHA_IDA:
command = new TrocaPasswordIdaCommand();
break;
case XXXConst.ACTION_EXECUTE_DESOFICIALIZAR_PERIODO:
command = new DesoficializarPeriodoCommand();
break;
case XXXConst.ACTION_EXECUTE_TROCA_SENHA_VOLTA:
command = new TrocaPasswordVoltaCommand();
break;
case XXXConst.ACTION_RESUMO:
command = new ResumoMenu();
break;
case XXXConst.ACTION_EXECUTE_GERA_PDF:
// command = new GeneratePDFReportCommand();
break;
case XXXConst.ACTION_SHORTCUT:
command = new ShortcutCommand();
break;
default:
command = new NullCommand();
}
return command;
}
protected Page getPage(int actionDescriptor, OutputParameters parameters)
throws ServletException {
String styleSheet = parameters.getRequest().getContextPath()
+ APPLICATION_STYLESHEET;
XXXPage page = new XXXPage(APPLICATION_NAME, styleSheet);
switch (actionDescriptor) {
case XXXConst.ACTION_LIST:
case XXXConst.ACTION_EXECUTE_INSERT:
case XXXConst.ACTION_EXECUTE_UPDATE:
case XXXConst.ACTION_EXECUTE_DELETE:
case XXXConst.ACTION_LIST_SHORTCUT:
XXXCollectionTable table = new XXXCollectionTable(0, 3, 3);
table.setStyle("table");
page.addItem(table);
break;
case XXXConst.ACTION_VIEW:
page.addItem(new ViewForm());
break;
case XXXConst.ACTION_INSERT:
page.addItem(new InsertForm());
break;
case XXXConst.ACTION_UPDATE:
page.addItem(new UpdateForm());
break;
case XXXConst.ACTION_DELETE:
page.addItem(new DeleteForm());
break;
case XXXConst.ACTION_CALCULATE_REPORT:
page.addItem(new ReportFormIntervaloMensalItem());
break;
case XXXConst.ACTION_CALCULATE_REPORT_MONTH:
page.addItem(new ReportFormMesItem());
break;
case XXXConst.ACTION_REPORT:
case XXXConst.ACTION_EXECUTE_REPORT:
case XXXConst.ACTION_EXECUTE_VERIFICAR_PLANO_CONTA:
case XXXConst.ACTION_EXECUTE_VERIFICAR_PERIODO:
case XXXConst.ACTION_EXECUTE_CONFERIR_PERIODO:
case XXXConst.ACTION_OFICIALIZAR_PERIODO:
case XXXConst.ACTION_EXECUTE_OFICIALIZAR_PERIODO:
case XXXConst.ACTION_EXECUTE_DESOFICIALIZAR_PERIODO:
case XXXConst.ACTION_EXECUTE_CALCULA_PERIODO:
case XXXConst.ACTION_EXECUTE_CALCULATE_REPORT:
case XXXConst.ACTION_EXECUTE_CALCULATE_REPORT_MONTH:
case XXXConst.ACTION_INSERT_MULTI_VALUE:
case XXXConst.ACTION_VIEW_MULTI_VALUE:
case XXXConst.ACTION_DELETE_PERIODO:
case XXXConst.ACTION_TEST:
case XXXConst.ACTION_SHORTCUT:
case XXXConst.ACTION_EXECUTE_SESSION_UPDATE:
case XXXConst.ACTION_RESUMO:
case XXXConst.ACTION_EXECUTE_TROCA_SENHA_IDA:
case XXXConst.ACTION_EXECUTE_TROCA_SENHA_VOLTA:
if (parameters.getResult().getResultData() != null)
page.addItem((PageItem) parameters.getResult().getResultData());
break;
case PageServlet.ACTION_NO_ACTION:
break;
}
return page;
}
protected ValueObjectCollection getCollection(int classDescriptor,
int actionDescriptor, boolean loadCollection,
OutputParameters parameters) throws ServletException {
ValueObjectCollection collection = null;
try {
switch (classDescriptor) {
case XXXConst.CLASS_CENARIO:
collection = new CenarioCollection();
break;
case XXXConst.CLASS_CONTA:
collection = new ContaCollection();
break;
case XXXConst.CLASS_EMPRESA:
collection = new EmpresaCollection();
break;
case XXXConst.CLASS_GRUPO_CONTA:
collection = new GrupoContaCollection();
break;
case XXXConst.CLASS_PLANO:
collection = new PlanoCollection();
break;
case XXXConst.CLASS_PLANO_CONTA:
collection = new PlanoContaCollection();
break;
case XXXConst.CLASS_PLANO_CONTA_RELATORIO:
collection = new PlanoContaRelatorioCollection();
break;
case XXXConst.CLASS_USUARIO:
collection = new UsuarioCollection();
break;
case XXXConst.CLASS_PAPEL:
collection = new PapelCollection();
break;
case XXXConst.CLASS_PERIODO:
collection = new PeriodoCollection();
break;
case XXXConst.CLASS_OPERACAO:
collection = new OperationCollection();
break;
case XXXConst.CLASS_TIPOPLANO:
collection = new TipoPlanoCollection();
break;
case XXXConst.CLASS_ALLOWED:
collection = new AllowedOperationsCollection();
break;
case XXXConst.CLASS_USERROLE:
collection = new UserRoleCollection();
break;
case XXXConst.CLASS_GIVEROLE:
collection = new GiveRoleCollection();
break;
case XXXConst.CLASS_OPERATIONROLE:
collection = new OperationRoleCollection();
break;
case XXXConst.CLASS_GIVEOPERATION:
collection = new GiveOperationCollection();
break;
case XXXConst.CLASS_ESTILO:
collection = new EstiloCollection();
break;
case XXXConst.CLASS_COLUNARELATORIO:
collection = new ColunaRelatorioCollection();
break;
case XXXConst.CLASS_PAGINARELATORIO:
collection = new PaginaRelatorioCollection();
break;
case XXXConst.CLASS_LISTCONTACOMENTARIO:
collection = new ListComentarioContaCollection();
break;
case XXXConst.CLASS_CONTACOMENTARIO:
collection = new ComentarioContaCollection();
break;
case XXXConst.CLASS_ASSUNTOCONSELHO:
collection = new AssuntosParaConselhoCollection();
break;
case XXXConst.CLASS_PONTOSCRITICOS:
collection = new PontosCriticosCollection();
break;
case XXXConst.CLASS_PONTOSRELEVANTES:
collection = new PontosRelevantesCollection();
break;
case XXXConst.CLASS_ACAOCONTA:
collection = new ActionContaCollection();
break;
case XXXConst.CLASS_ACAOPONTOSCRITICOS:
collection = new ActionPontosCriticosCollection();
break;
case XXXConst.CLASS_ENDIVIDAMENTO:
collection = new EndividamentoCollection();
break;
case XXXConst.CLASS_PASSWORD:
collection = new PasswordCollection();
break;
case XXXConst.CLASS_GRUPO_RELATORIO:
collection = new GrupoRelatorioCollection();
break;
case XXXConst.CLASS_FINANCIAMENTO:
collection = new FinanciamentoCollection();
break;
case PageServlet.CLASS_NO_CLASS:
break;
default:
throw new ServletException("Classe não definida");
}
} catch (Exception e) {
logger.debug("Excecao de construtor de ValueObjectCollection", e);
throw new ServletException(e.getMessage());
}
try {
if (collection != null)
collection.initialize(actionDescriptor, loadCollection,
parameters);
return collection;
} catch (Exception e) {
logger
.debug("Excecao de inicializacao de ValueObjectCollection",
e);
throw new ServletException(e.getMessage());
}
}
/**
* Obtem uma página de erro padrão.
*
* @return Retorna uma página de erro.
* @param parameters
* Parâmetros para processamento.
*/
protected ErrorPage getErrorPage(OutputParameters parameters) {
String styleSheet = parameters.getRequest().getContextPath()
+ APPLICATION_STYLESHEET;
return new XXXPage(APPLICATION_NAME, styleSheet);
}
}