tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "DeMZed" <dem...@gmail.com>
Subject Tomcat 5.5 / debian : Connection failed
Date Tue, 03 Oct 2006 22:07:51 GMT
Hi !
 
I've setup in my Tomcat 5.5's webapp this pool :
 
<Resource name="jdbc/mydb" scope="Shareable" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/mydb">
  <parameter>
     <name>factory</name>
     <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
  </parameter>
  <parameter>
     <name>url</name>
     <value>jdbc:postgresql://127.0.0.1/mydb</value>
  </parameter>
  <parameter>
     <name>driverClassName</name><value>org.postgresql.Driver</value>
  </parameter>
  <parameter>
    <name>username</name>
    <value>mydb</value>
  </parameter>
  <parameter>
     <name>password</name>
     <value>mydb</value>
  </parameter>
  <parameter>
     <name>maxWait</name>
     <value>3000</value>
  </parameter>
  <parameter>
     <name>maxIdle</name>
     <value>100</value>
  </parameter>
  <parameter>
     <name>maxActive</name>
     <value>10</value>
  </parameter>
</ResourceParams>
 
When I launch this JSP
 
<%
 
javax.naming.Context initCtx = new javax.naming.InitialContext();
javax.naming.Context envCtx = (javax.naming.Context)
initCtx.lookup("java:comp/env");
javax.sql.DataSource ds = (javax.sql.DataSource)
envCtx.lookup("jdbc/mydb");
 
java.sql.Connection conn = ds.getConnection();
 
if (conn!=null) {
out.println("Connexion OK");
} else {
  out.println("Connexion KO !");
}
%>
 
it gives me : 
 
2006-10-03 22:51:29 StandardWrapperValve[jsp]: "Servlet.service()" pour la
servlet jsp a généré une exception
org.apache.commons.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (Quelque chose d'inhabituel a provoqué l'échec du
pilote. Veuillez
 faire un rapport sur cette erreur.)
        at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav
a:855)
        at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:5
40)
        at org.apache.jsp.test_jsp._jspService(test_jsp.java:50)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
24)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        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:585)
        at
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
        at
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:272)
        at
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:16
1)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:245)
        at
org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterCh
ain.java:177)
        at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain
.java:156)
        at java.security.AccessController.doPrivileged(Native Method)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:152)
        at
org.securityfilter.filter.SecurityFilter.doFilter(SecurityFilter.java:188)
        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:585)
        at
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
        at
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:272)
        at
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:21
7)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:197)
        at
org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterCh
ain.java:177)
        at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain
.java:156)
        at java.security.AccessController.doPrivileged(Native Method)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:152)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:214)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.java:104)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext
Valve.java:198)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:152)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.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(StandardValveContex
t.java:104)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118
)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex
t.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(StandardValveContex
t.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.processConne
ction(Http11Protocol.java:705)
        at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:684)
        at java.lang.Thread.run(Thread.java:595)
Caused by: org.postgresql.util.PSQLException: Quelque chose d'inhabituel a
provoqué l'échec du pilote. Veuillez faire un rapport sur cette erreur.
        at org.postgresql.Driver.connect(Driver.java:263)
        at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConne
ctionFactory.java:37)
        at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnect
ionFactory.java:290)
        at
org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataS
ource.java:877)
        at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav
a:851)
        ... 59 more
Caused by: java.security.AccessControlException: access denied
(java.net.SocketPermission 127.0.0.1:5432 connect,resolve)
        at
java.security.AccessControlContext.checkPermission(AccessControlContext.java
:264)
        at
java.security.AccessController.checkPermission(AccessController.java:427)
        at
java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
        at java.lang.SecurityManager.checkConnect(SecurityManager.java:1034)
        at java.net.Socket.connect(Socket.java:510)
        at java.net.Socket.connect(Socket.java:466)
        at java.net.Socket.<init>(Socket.java:366)
        at java.net.Socket.<init>(Socket.java:179)
        at org.postgresql.core.PGStream.<init>(PGStream.java:60)
        at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFa
ctoryImpl.java:77)
        at
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:
65)
        at
org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.
java:116)
        at
org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.
java:30)
        at
org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
        at org.postgresql.Driver.makeConnection(Driver.java:369)
        at org.postgresql.Driver.connect(Driver.java:245)
        ... 63 more
 
Any idea ?
Is there a policy rule to fix somewhere ?
 
Than k s !



  _____  


Antivirus avast! <http://www.avast.com> : message Sortant sain. 


Base de donnees virale (VPS) : 0640-1, 03/10/2006
Analyse le : 04/10/2006 00:07:46
avast! - copyright (c) 1988-2006 ALWIL Software.



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message