tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cameron Currie" <ccur...@tamu.edu>
Subject Database Connection Error Cannot create PoolableConnectionFactory
Date Wed, 19 Jul 2006 18:23:42 GMT
Hello everyone,

Background:

I have a newly installed and configured Ubuntu server running
Tomcat5.5 and Mysql 5.0. This server was created in an attempt to
migrate from a Red Hat server in a similar configuration, running the
exact same webapp. Most of the configuration/classpath differences
between the two platforms have been ironed out.

The Problem:

When our webapp trys to connect to the database on localhost, an exception

'java.security.AccessControlException: access denied
(java.net.SocketPermission localhost resolve)'

is generated.

The server.xml configuration is below:

<Resource name="jdbc/EconDollarsDB"
auth="Container"
type="javax.sql.DataSource"
username="user"
password="pass"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/DBName?autoReconnect=true"
maxActive="20" maxIdle="5"
/>



I can connect to the database just fine using the command line client
and the same username/password combo. This configuration has been
working fine for at least a year on the older server. The only similar
problems I have found on the net (meaning the same exception is
generated) involve applets and attempts to connect to different hosts.
This case involves a webapp, connecting to localhost, using a
configuration that is known to work. I am simply baffled.

The following stacktrace is generated:

javax.servlet.ServletException: Database Connection Error
Cannot create PoolableConnectionFactory (Server connection failure
during transaction. Due to underlying exception:
'java.security.AccessControlException: access denied
(java.net.SocketPermission localhost resolve)'.

** BEGIN NESTED EXCEPTION **

java.security.AccessControlException
MESSAGE: access denied (java.net.SocketPermission localhost resolve)

STACKTRACE:

java.security.AccessControlException: access denied
(java.net.SocketPermission localhost 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:1031)
	at java.net.InetAddress.getAllByName0(InetAddress.java:1117)
	at java.net.InetAddress.getAllByName0(InetAddress.java:1098)
	at java.net.InetAddress.getAllByName(InetAddress.java:1061)
	at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:137)
	at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:276)
	at com.mysql.jdbc.Connection.createNewIO(Connection.java:2769)
	at com.mysql.jdbc.Connection.<init>(Connection.java:1531)
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
	at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)
	at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
	at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:877)
	at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:851)
	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
	at edu.tamu.erl.database.dblibrary.plugin.TomcatConnectionFactory.getConnection(TomcatConnectionFactory.java:102)
	at edu.tamu.erl.database.dblibrary.DBManager.getConnection(DBManager.java:70)
	at edu.tamu.erl.database.dblibrary.DBManager.getDBDataAccessObjectList(DBManager.java:318)
	at edu.tamu.erl.econdollars.middletire.SessionManager.getSessionStatus(SessionManager.java:157)
	at edu.tamu.erl.econdollars.middletire.SessionManager.retallyDB(SessionManager.java:637)
	at org.apache.jsp.admin.login_jsp._jspService(login_jsp.java:88)
	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:324)
	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:161)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:245)
	at org.apache.catalina.core.ApplicationFilterChain.access$0(ApplicationFilterChain.java:50)
	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(ApplicationFilterChain.java:152)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
	at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
	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(StandardValveContext.java:104)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
	at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.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(StandardValveContext.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.processConnection(Http11Protocol.java:705)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
	at java.lang.Thread.run(Thread.java:595)


** END NESTED EXCEPTION **

Any help would be greatly appreciated.

-- 
Cameron Currie
ccurrie@tamu.edu

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message