Hi,
I've been away from my app for 3 months with only 4-5 tests in the interim
(lots of tests while I was working on it though). Now, I have a
"Connot create PoolableConnectionFactory" problem.
What I've done is at the end of the email.
Some new places to look at would be helpful.
Setup:
--------------------------------------------------------------------
Vista (with auto update--I should be ok)
Tomcat 6.0.18 (running in a window--not running as a service)
Mysql 5.0 (running as a service)
mysql-connector-java-5.1.7-bin.jar
java 1.6.0_07 and also jre6 (new)
No IDE yet.
No problem seen with mysql or the mysql command line utility.
Tomcat comes up and down alright.
--------------------------------------------------------------------
context.xml
--------------------------------------------------------------------
<Resource name="jdbc/blogdb"
auth="Container"
type="javax.sql.DataSource"
maxActive="20"
maxIdle="5"
maxWait="10000"
username="root"
password="xxxxx"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/nlocalhost"
removeAbandoned="true"
removeAbandonedTimeout="120" />
--------------------------------------------------------------------
HTTP Status 500 error report:
--------------------------------------------------------------------
java.lang.NullPointerException
PublicTopFrameset.doGet(PublicTopFrameset.java:109)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
--------------------------------------------------------------------
Tomcat error report:
--------------------------------------------------------------------
AbandonedObjectPool is used
(org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool&b8f8eb)
LogAbandoned: false
RemoveAbandoned: true
RemoveAbandonedTimeout: 120
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create
PoolableConnectionFactory (Communications link failure
Last packet sent to the server was 0 ms ago.)
-------------------------------------------------------------------
The failing servlet:
-------------------------------------------------------------------
...
private ServletContext servletContext = null;
private DataSource dataSource = null;
public void init(ServletConfig config)
throws ServletException
{
super.init(config);
servletContext = config.getServletContext();
dataSource = (DataSource)servletContext.getAttribute("dataSource");
//The dataSource is set by an initialization servlet running at no 1
}
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
Connection con = null;
...
try
{ //The error occurs here.
con = dataSource.getConnection();
}
catch (SQLException e){System.out.println(e.toString());}
...
}
-------------------------------------------------------------------
So far:
-------------------------------------------------------------------
.In the con = dataSource.getConnection(); line, dataSource is not null.
.I tested with my Norton firewall off. The problem persisted.
.When the mysql port is changed to 3308, the error message is the same.
I conclude that the error occurs before there is an attempt to use
the mysql port?
.I bit on a Sun Java upgrade popup several weeks ago but I believe I tested
ok after it was installed. Anyway, the upgrade left a CLASSPATH variable
containing only jre6. I temporarily removed the CLASSPATH variable but
the problem persisted. I copied some .jar files into the new
jre6/lib/ext folder from the jre1.6.0_07/lib/ext folder. No luck.
.A few days ago, my computer hung at "shutting down" (first time ever) and I
pulled the electrical plug and restarted. I don't belive I tested
my app after the restart but I didn't notice anything else wrong.
.I've not been able to resolve it through Internet search.
Thanks,
Mel McGuire
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]