olivier
(usa Debian)
Enviado em 08/01/2008 - 17:49h
Ola comunidade
Estou com uma aplicacao em java a ser colocada no tomcat 5.5 do debian etch.
A aplicacao precisa de um dataSource para autenticar os usuarios, e configurei da seguinte maneira:
o server.xml é o basicao do Debian.
o Context é dado por um arquivo minha-app/META-INF/context.xmll listado mais abaixo.
O web.xml da aplicacao contem a referencia ao resource definido no context (ver abaixo)
O problema é que ao iniciar a aplicacao, o Tomcat reclama que nao consegue ver o dataSource, mandando pelo log a seguinte mensagem:
08/01/2008 16:16:30 org.apache.commons.modeler.Registry registerComponent
SEVERE: Null component Catalina:type=DataSource,path=/sgi,host=localhost,class=javax.sql.DataSource,name="jdbc/SgiDB"
Aparentemente o data source nao esta sendo acessado. Ja verifiquei o jdbc, o login no banco(postgres), e pior, tenho uma instalacao em Tomcat 6 no Mandriva que funciona.
apreciaria que alguma alma caridosa e expert em tomcat pudesse me dar uma luz, já faz 3 dias que estou travado com este problema.
Obrigado
Olivier
context.xml
++++++++++++++++++++++
<?xml version="1.0" encoding="utf-8"?>
<Context path="/sgi" debug="1">
<Loader delegate="true"/>
<Resource
auth="Container"
name="jdbc/SgiDB"
type="javax.sql.DataSource"
driverClassName="org.postgresql.Driver"
password="xxxxxxxxxx"
maxIdle="2"
maxWait="5000"
username="usu_opr_sgi"
url="jdbc:postgresql://127.0.0.1:5432/sgi_db"
maxActive="4" />
<Realm className='org.apache.catalina.realm.DataSourceRealm' debug='99'
dataSourceName='jdbc/SgiDB' localDataSource='true' digest="MD5"
userTable='usuario_tb'
userNameCol='username'
userCredCol='password'
userRoleTable='usuario_tb'
roleNameCol='role_name' />
</Context>
+++++++++++++++++
o decritor da aplicaçao (web.xml) é o seguinte:
+++++++++++++++++
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<display-name>SGI - Sistema para Gestão de Informações</display-name>
<description>SGI</description>
<security-role><role-name>sgi.usuario</role-name></security-role>
<security-role><role-name>sgi.admin</role-name></security-role>
<security-constraint>
<web-resource-collection>
<web-resource-name>PrimeiroLvlPermissaoUsuario</web-resource-name>
<url-pattern>/pages/*</url-pattern>
<url-pattern>/dwr/*</url-pattern>
<url-pattern>*.sgi</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>sgi.usuario</role-name>
<role-name>sgi.admin</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>SegundoLvlPermissaoAdmininstracao</web-resource-name>
<url-pattern>/dwr/test/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>sgi.admin</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>SGIRealm</realm-name>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/login.jsp</form-error-page>
</form-login-config>
</login-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<resource-ref>
<res-ref-name>jdbc/SgiDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<servlet>
<servlet-name>Main</servlet-name>
<servlet-class>ibase.sgi.controller.comum.Main</servlet-class>
<init-param><param-name>/main.sgi</param-name><param-value>/pages/frmMain.jsp</param-value></init-param>
<init-param><param-name>/bwNfx.sgi</param-name><param-value>/pages/mensagem/bwNfx.jsp</param-value></init-param>
<init-param><param-name>/projeto.sgi</param-name><param-value>/pages/orcamento/frmProjeto.jsp</param-value></init-param>
<init-param><param-name>/prjCadastro.sgi</param-name><param-value>/pages/orcamento/frmPrjManu.jsp</param-value></init-param>
<init-param><param-name>/prjFinancCfg.sgi</param-name><param-value>/pages/orcamento/frmPrjFinancCfg.jsp</param-value></init-param>
<init-param><param-name>/prjReceitaCfg.sgi</param-name><param-value>/pages/orcamento/frmPrjReceitaCfg.jsp</param-value></init-param>
<init-param><param-name>/prjCfgEquipe.sgi</param-name><param-value>/pages/orcamento/frmPrjCfgEquipe.jsp</param-value></init-param>
<init-param><param-name>/prjPesquisa.sgi</param-name><param-value>/pages/orcamento/frmPrjPesquisa.jsp</param-value></init-param>
<init-param><param-name>/prjAnexo.sgi</param-name><param-value>/pages/orcamento/frmPrjAnexo.jsp</param-value></init-param>
<init-param><param-name>/prjRateioCfg.sgi</param-name><param-value>/pages/orcamento/frmPrjRateioCfg.jsp</param-value></init-param>
<init-param><param-name>/prjOrcamento.sgi</param-name><param-value>/pages/orcamento/frmPrjOrcamento.jsp</param-value></init-param>
<init-param><param-name>/prjPlanFluxoCaixa.sgi</param-name><param-value>/pages/orcamento/frmPrjPlanFluxoCaixa.jsp</param-value></init-param>
<init-param><param-name>/prjContas.sgi</param-name><param-value>/pages/orcamento/frmPrjConta.jsp</param-value></init-param>
<init-param><param-name>/prjMemoriaCalc.sgi</param-name><param-value>/pages/orcamento/frmPrjMemoriaCalc.jsp</param-value></init-param>
<init-param><param-name>/prjPlanExec.sgi</param-name><param-value>/pages/orcamento/frmPrjPlaExe.jsp</param-value></init-param>
<init-param><param-name>/prjPlanEquipe.sgi</param-name><param-value>/pages/orcamento/frmPlanejamentoCfgEquipe.jsp</param-value></init-param>
<init-param><param-name>/prjConsultaRateio.sgi</param-name><param-value>/pages/administracao/frmConsultaRateio.jsp</param-value></init-param>
<init-param><param-name>/prjProcessaRateio.sgi</param-name><param-value>/pages/administracao/frmProcessaRateio.jsp</param-value></init-param>
<init-param><param-name>/prjCancelaRateio.sgi</param-name><param-value>/pages/administracao/frmCancelaRateio.jsp</param-value></init-param>
<init-param><param-name>/prjProcessaFolha.sgi</param-name><param-value>/pages/administracao/frmProcessaImportacaoFolha.jsp</param-value></init-param>
<init-param><param-name>/prjCancelaFolha.sgi</param-name><param-value>/pages/administracao/frmCancelaImportacaoFolha.jsp</param-value></init-param>
<init-param><param-name>/exeLancDesPrj.sgi</param-name><param-value>/pages/orcamento/frmLancDespPrj.jsp</param-value></init-param>
<init-param><param-name>/exeLancDespParcela.sgi</param-name><param-value>/pages/orcamento/frmLancDespPrjParcela.jsp</param-value></init-param>
<init-param><param-name>/exeLancDesIns.sgi</param-name><param-value>/pages/orcamento/frmLancDespInst.jsp</param-value></init-param>
<init-param><param-name>/exeLancRecPrj.sgi</param-name><param-value>/pages/orcamento/frmLancReceitaPrj.jsp</param-value></init-param>
<init-param><param-name>/exeRateio.sgi</param-name><param-value>/pages/orcamento/frmExeRateio.jsp</param-value></init-param>
<init-param><param-name>/exeExportaContab.sgi</param-name><param-value>/pages/administracao/frmExeExportaContab.jsp</param-value></init-param>
<init-param><param-name>/exportacaoContab.sgi</param-name><param-value>/exportacaoContab</param-value></init-param>
<init-param><param-name>/cadContaPdrao.sgi</param-name><param-value>/pages/orcamento/frmCadContaPdrao.jsp</param-value></init-param>
<init-param><param-name>/cadFinanciador.sgi</param-name><param-value>/pages/orcamento/frmCadFinanciador.jsp</param-value></init-param>
<init-param><param-name>/cadRhFuncao.sgi</param-name><param-value>/pages/orcamento/frmCadRhFuncao.jsp</param-value></init-param>
<init-param><param-name>/cadPais.sgi</param-name><param-value>/pages/orcamento/frmCadPais.jsp</param-value></init-param>
<init-param><param-name>/cadUi.sgi</param-name><param-value>/pages/orcamento/frmCadUi.jsp</param-value></init-param>
<init-param><param-name>/cadGerente.sgi</param-name><param-value>/pages/orcamento/frmCadGerente.jsp</param-value></init-param>
<init-param><param-name>/cadRhEventoFolha.sgi</param-name><param-value>/pages/orcamento/frmCadRhEventoFolha.jsp</param-value></init-param>
<init-param><param-name>/cadRhFuncionario.sgi</param-name><param-value>/pages/orcamento/frmCadRhFuncionario.jsp</param-value></init-param>
<init-param><param-name>/cadUsuario.sgi</param-name><param-value>/pages/administracao/frmCadUsuario.jsp</param-value></init-param>
<init-param><param-name>/REL0000.sgi</param-name><param-value>/pages/relatorio/REL0000.jsp</param-value></init-param>
<init-param><param-name>/REL1000.sgi</param-name><param-value>/pages/relatorio/REL1000.jsp</param-value></init-param>
<init-param><param-name>/REL1100.sgi</param-name><param-value>/pages/relatorio/REL1100.jsp</param-value></init-param>
<init-param><param-name>/REL1110.sgi</param-name><param-value>/pages/relatorio/REL1110.jsp</param-value></init-param>
<init-param><param-name>/REL1120.sgi</param-name><param-value>/pages/relatorio/REL1120.jsp</param-value></init-param>
<init-param><param-name>/REL1200.sgi</param-name><param-value>/pages/relatorio/REL1200.jsp</param-value></init-param>
<init-param><param-name>/REL1210.sgi</param-name><param-value>/pages/relatorio/REL1210.jsp</param-value></init-param>
<init-param><param-name>/REL1220.sgi</param-name><param-value>/pages/relatorio/REL1220.jsp</param-value></init-param>
<init-param><param-name>/REL1230.sgi</param-name><param-value>/pages/relatorio/REL1230.jsp</param-value></init-param>
<init-param><param-name>/REL2000.sgi</param-name><param-value>/pages/relatorio/REL2000.jsp</param-value></init-param>
<init-param><param-name>/REL2100.sgi</param-name><param-value>/pages/relatorio/REL2100.jsp</param-value></init-param>
<init-param><param-name>/REL2110.sgi</param-name><param-value>/pages/relatorio/REL2110.jsp</param-value></init-param>
<init-param><param-name>/REL2200.sgi</param-name><param-value>/pages/relatorio/REL2200.jsp</param-value></init-param>
<init-param><param-name>/REL2210.sgi</param-name><param-value>/pages/relatorio/REL2210.jsp</param-value></init-param>
<init-param><param-name>/REL2220.sgi</param-name><param-value>/pages/relatorio/REL2220.jsp</param-value></init-param>
<init-param><param-name>/REL2300.sgi</param-name><param-value>/pages/relatorio/REL2300.jsp</param-value></init-param>
<init-param><param-name>/REL2310.sgi</param-name><param-value>/pages/relatorio/REL2310.jsp</param-value></init-param>
<init-param><param-name>/REL3000.sgi</param-name><param-value>/pages/relatorio/REL3000.jsp</param-value></init-param>
<init-param><param-name>/REL3100.sgi</param-name><param-value>/pages/relatorio/REL3100.jsp</param-value></init-param>
<init-param><param-name>/REL4000.sgi</param-name><param-value>/pages/relatorio/REL4000.jsp</param-value></init-param>
<init-param><param-name>/REL5000.sgi</param-name><param-value>/pages/relatorio/REL5000.jsp</param-value></init-param>
<init-param><param-name>/REL6000.sgi</param-name><param-value>/pages/relatorio/REL6000.jsp</param-value></init-param>
<init-param><param-name>/REL7000.sgi</param-name><param-value>/pages/relatorio/REL7000.jsp</param-value></init-param>
<init-param><param-name>/REL8000.sgi</param-name><param-value>/pages/relatorio/REL8000.jsp</param-value></init-param>
<init-param><param-name>/REL8100.sgi</param-name><param-value>/pages/relatorio/REL8100.jsp</param-value></init-param>
<init-param><param-name>/REL9000.sgi</param-name><param-value>/pages/relatorio/REL9000.jsp</param-value></init-param>
<init-param><param-name>/novoRelatorio.sgi</param-name><param-value>/pages/relatorio/frmRelatorioUpload.jsp</param-value></init-param>
<init-param><param-name>/frmRelatorio.sgi</param-name><param-value>/pages/relatorio/frmRelatorio.jsp</param-value></init-param>
<init-param><param-name>/uploadPrjAnexo.sgi</param-name><param-value>/uploadPrjAnexoCtr</param-value></init-param>
<init-param><param-name>/importacaoFolha.sgi</param-name><param-value>/importacaoFolhaCtr</param-value></init-param>
<init-param><param-name>/downloadPrjAnexo.sgi</param-name><param-value>/downloadPrjAnexoCtr</param-value></init-param>
<init-param><param-name>/uploadRelatorio.sgi</param-name><param-value>/uploadRelatorio</param-value></init-param>
<init-param><param-name>/prjContaContabil.sgi</param-name><param-value>/pages/orcamento/frmContaContabilPrj.jsp</param-value></init-param>
<init-param><param-name>/erro.sgi</param-name><param-value>/pages/mensagem/erro.jsp</param-value></init-param>
<!-- Tesouraria -->
<init-param><param-name>/cadContaTipo.sgi</param-name><param-value>/pages/tesouraria/frmCadContaTipo.jsp</param-value></init-param>
<init-param><param-name>/cadTipoDocumento.sgi</param-name><param-value>/pages/tesouraria/frmCadTipoDocumento.jsp</param-value></init-param>
<init-param><param-name>/cadContaCaixa.sgi</param-name><param-value>/pages/tesouraria/frmCadContaCaixa.jsp</param-value></init-param>
<init-param><param-name>/cadBanco.sgi</param-name><param-value>/pages/tesouraria/frmCadBanco.jsp</param-value></init-param>
<init-param><param-name>/cadDespInst.sgi</param-name><param-value>/pages/tesouraria/frmCadDespInstitucional.jsp</param-value></init-param>
<init-param><param-name>/cadFornecedor.sgi</param-name><param-value>/pages/tesouraria/frmCadFornecedor.jsp</param-value></init-param>
<init-param><param-name>/cadMoeda.sgi</param-name><param-value>/pages/tesouraria/frmCadMoeda.jsp</param-value></init-param>
<init-param><param-name>/pagamentos.sgi</param-name><param-value>/pages/tesouraria/frmPagamentos.jsp</param-value></init-param>
<init-param><param-name>/recebimentos.sgi</param-name><param-value>/pages/tesouraria/frmRecebimentos.jsp</param-value></init-param>
</servlet>
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet>
<description>Exportacao Contabilidade</description>
<servlet-name>exportacaoContab</servlet-name>
<servlet-class>ibase.sgi.controller.administracao.ExportaContabilidade</servlet-class>
</servlet>
<servlet>
<description>Importacao Folha</description>
<servlet-name>importacaoFolhaCtr</servlet-name>
<servlet-class>ibase.sgi.controller.orcamento.folha.UploadImportacaoFolhaCtr</servlet-class>
</servlet>
<servlet>
<description>UpLoad Prj Anexo</description>
<servlet-name>uploadPrjAnexoCtr</servlet-name>
<servlet-class>ibase.sgi.controller.orcamento.planejamento.UploadPrjAnexoCtr</servlet-class>
</servlet>
<servlet>
<description>Download Prj Anexo</description>
<servlet-name>downloadPrjAnexoCtr</servlet-name>
<servlet-class>ibase.sgi.controller.orcamento.planejamento.DownloadPrjAnexoCtr</servlet-class>
</servlet>
<servlet>
<description>Upload Relatorio</description>
<servlet-name>uploadRelatorio</servlet-name>
<servlet-class>ibase.sgi.controller.relatorio.UploadRelatorio</servlet-class>
</servlet>
<servlet>
<description>Relatorios</description>
<servlet-name>relGeral</servlet-name>
<servlet-class>ibase.sgi.controller.orcamento.relatorio.GeraRelatorio</servlet-class>
</servlet>
<!--
<servlet>
<description>Jasper Report</description>
<servlet-name>jasper</servlet-name>
<servlet-class>testes.luciano02.jasper_report.JasperWeb</servlet-class>
</servlet>
-->
<!-- MAPPING SERVLET-->
<!--
<servlet-mapping>
<servlet-name>jasper</servlet-name>
<url-pattern>/jasper</url-pattern>
</servlet-mapping>
-->
<servlet-mapping>
<servlet-name>Main</servlet-name>
<url-pattern>*.sgi</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>exportacaoContab</servlet-name>
<url-pattern>/exportacaoContab</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>importacaoFolhaCtr</servlet-name>
<url-pattern>/importacaoFolhaCtr</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>uploadPrjAnexoCtr</servlet-name>
<url-pattern>/uploadPrjAnexoCtr</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>downloadPrjAnexoCtr</servlet-name>
<url-pattern>/downloadPrjAnexoCtr</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>uploadRelatorio</servlet-name>
<url-pattern>/uploadRelatorio</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>relGeral</servlet-name>
<url-pattern>/relGeral</url-pattern>
</servlet-mapping>
<servlet>
<description>SGI</description>
<servlet-name>sgi</servlet-name>
<servlet-class>ibase.sgi.controller.comum.Sgi</servlet-class>
</servlet>
</web-app>
++++++