Salut à tous !!!
Voila je suis en train d'essayer d'utiliser jndi et j'obtient cette exception:
Code :
- Cannot create PoolableConnectionFactory (Communications link failure due to underlying exception:
- ** BEGIN NESTED EXCEPTION **
- java.net.SocketException
- MESSAGE: java.net.ConnectException: Connection refused
- STACKTRACE:
- java.net.SocketException: java.net.ConnectException: Connection refused
- at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
- at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:284)
- at com.mysql.jdbc.Connection.createNewIO(Connection.java:2555)
- at com.mysql.jdbc.Connection.<init>(Connection.java:1485)
- at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
- at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)
- at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
- at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877)
- at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851)
- at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
- at data.Test2.doGet(Test2.java:115)
- at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
- at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
- at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
- at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
- at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
- at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
- at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
- at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
- at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
- at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
- at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
- at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667)
- at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
- at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
- at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
- at java.lang.Thread.run(Thread.java:595)
- ** END NESTED EXCEPTION **
- Last packet sent to the server was 18 ms ago.)
|
enfin bref je vois vraiment pas !
pour info la base est mysql:
et server.xml:
<Resource auth="Container" driverClassName="com.mysql.jdbc.Driver" maxActive="100" maxIdle="30" maxWait="10000" name="jdbc/dbtest" password="test" type="javax.sql.DataSource" url="jdbc:mysql://localhost:3306/dbtest" username="celestin"/>
voila merci d'avance ...