tomcat6 postgresql

1. tomcat6 postgresql

Gabriel
gabrielramos

(usa CentOS)

Enviado em 05/09/2011 - 11:16h

Pessoal migrei um servidor centos 5.4 com tomcat5 e base de dados do postgresql para o centos 6.0 com tomcat6 e postgresql 8.4.7 a aplicação foi migrada e deu tudo certo. importei o banco tambem com todas as tabelas, etc.
mas quando tento autentica na aplicação com login e senha da erro de senha, porem o problema esta relacionado a conexao do tomcat6 com o banco postgres.
Este é o log de erro:


Sep 5, 2011 8:15:26 AM org.apache.catalina.realm.JDBCRealm authenticate
SEVERE: Exception performing authentication
java.sql.SQLException: org.postgresql.Driver
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:704)
at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:358)
at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:259)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:449)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:636)
Sep 5, 2011 8:15:26 AM org.apache.catalina.realm.JDBCRealm authenticate
SEVERE: Exception performing authentication
java.sql.SQLException: org.postgresql.Driver
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:704)
at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:358)
at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:259)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:449)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:636)



  


2. arquivo server.xml

Gabriel
gabrielramos

(usa CentOS)

Enviado em 05/09/2011 - 11:18h

<Server port="8005" shutdown="SHUTDOWN">

<GlobalNamingResources>
<!-- Used by Manager webapp -->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>

<Service name="Catalina">
<Connector port="8080" />

<!-- This is here for compatibility only, not required -->
<Connector port="8009" protocol="AJP/1.3" />

<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase" />
<Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="org.postgresql.Driver"
connectionURL="jdbc:postgresql://localhost/arqmaster"
connectionName="postgres" connectionPassword="info2001"
userTable="V_USUARIO"
userNameCol="usulogin"
userCredCol="ususenha"
userRoleTable="V_USUARIO_GRUPO" roleNameCol="usugrugrupo" />

<Host name="localhost" appBase="webapps" />
</Engine>

</Service>

</Server>



3. arquivo pg_hba

Gabriel
gabrielramos

(usa CentOS)

Enviado em 05/09/2011 - 11:19h

# TYPE DATABASE USER CIDR-ADDRESS METHOD
...

# "local" is for Unix domain socket connections only
local all all trust
#local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 ident
host all all 172.20.33.154/32 trust



4. Re: tomcat6 postgresql

Filippe
spolti

(usa Fedora)

Enviado em 05/09/2011 - 13:22h

Cara está faltando o driver de conexão com o banco postgree.


Coloque ele na pasta de libs do tomcat.

O erro está evidenciado nesta linha:
java.sql.SQLException: org.postgresql.Driver


Att.






Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts