MySQL communication link failure

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

MySQL communication link failure

Stéphane Laurière
While trying to upgrade an XWiki installation from 0.9.793 to 0.9.840 I
face a MySQL connection problem.

My server config:
=======
MySQL 4.1.12
Tomcat 5.5.9
JDK 1.5
Mandrake Linux virtual server kernel 2.6.9-vs1.9.3
XWiki runs in non virtual mode
URL: http://www.edos-project.org
======

XWiki 0.9.793 works perfectly on that server since a while. When trying
to run the 0.9.840 version with the same Hibernate and XWiki
configuration files, I get the exception below. MySQL "skip-networking"
option is correctly set in /etc/my.cnf. I noticed that the error appears
in some of previous XWiki build reports such as this one:
http://build.xpertnet.biz/cc/buildresults/xwiki?log=log20050628171819Lbuild.57&tab=xmlLogFile

Any hint is welcome!


Note: getting a simple connection to MySQL with the lines below works
perfectly fine on the server.
======================
String url = "jdbc:mysql://localhost/xwiki";
String username = "xwiki";
String password = "passwd";
Connection conn = DriverManager.getConnection(url, username, password);
======================

Exception when running XWiki webapp:
21:32:16,675 WARN http-80-Processor25 http://www.edos-project.org/xwiki/
Configurator:configure:126 - No configuration found. Configuring ehcache
from ehcache-failsafe.xml found in the classpath:
jar:file:/usr/local/tomcat/jakarta-tomcat-5.5.9/webapps/xwiki/WEB-INF/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
21:32:21,112 WARN http-80-Processor25 http://www.edos-project.org/xwiki/
JDBCExceptionReporter:logExceptions:71 - SQL Error: 0, SQLState: 08S01
21:32:21,113 ERROR http-80-Processor25
http://www.edos-project.org/xwiki/
JDBCExceptionReporter:logExceptions:72 - Communications link failure due
to underlying exception:

** BEGIN NESTED EXCEPTION **

java.io.EOFException

STACKTRACE:

java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1842)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2288)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2784)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531)
at
com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1347)
at
com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:958)
at
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1705)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:118)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1239)
at org.hibernate.loader.Loader.doQuery(Loader.java:374)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:210)
at org.hibernate.loader.Loader.doList(Loader.java:1562)
at org.hibernate.loader.Loader.list(Loader.java:1545)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
at
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:840)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
============================

--
Stéphane Laurière
[hidden email]
Mandriva Club - http://club.mandriva.com

Mandrakesoft becomes Mandriva!




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: MySQL communication link failure

Marc Lijour
On September 23, 2005 17:03, Stéphane Laurière wrote:
> SQL Error: 0, SQLState: 08S01

It installed fine here, after some hand work, but I don't remember I had this
problem (my config is very similar although I use JBoss with embedded
Tomcat).

I found this link. Hope that can help in something, if ruling out some
possible issues.

link: http://dev.mysql.com/doc/mysql/en/cj-faq.html

--------------------- extract from the above link ------------------------
25.3.5.1.3:
Question:
 I'm trying to use MySQL Connector/J in an applet or application and I get an
exception similar to:
SQLException: Cannot connect to MySQL server on host:3306.
Is there a MySQL server running on the machine/port you
are trying to connect to?

(java.security.AccessControlException)
SQLState: 08S01
VendorError: 0
Answer:
 Either you're running an Applet, your MySQL server has been installed with
the "--skip-networking" option set, or your MySQL server has a firewall
sitting in front of it.
 Applets can only make network connections back to the machine that runs the
web server that served the .class files for the applet. This means that MySQL
must run on the same machine (or you must have some sort of port
re-direction) for this to work. This also means that you will not be able to
test applets from your local file system, you must always deploy them to a
web server.
 MySQL Connector/J can only communicate with MySQL using TCP/IP, as Java does
not support Unix domain sockets. TCP/IP communication with MySQL might be
affected if MySQL was started with the "--skip-networking" flag, or if it is
firewalled.
 If MySQL has been started with the "--skip-networking" option set (the Debian
Linux package of MySQL server does this for example), you need to comment it
out in the file /etc/mysql/my.cnf or /etc/my.cnf. Of course your my.cnf file
might also exist in the "data" directory of your MySQL server, or anywhere
else (depending on how MySQL was compiled for your system). Binaries created
by MySQL AB always look in /etc/my.cnf and [datadir]/my.cnf. If your MySQL
server has been firewalled, you will need to have the firewall configured to
allow TCP/IP connections from the host where your Java code is running to the
MySQL server on the port that MySQL is listening to (by default, 3306).



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: MySQL:: check/update your MySQL Driver

Marc Lijour
In reply to this post by Stéphane Laurière
I remember I had to update my JDBC driver for MySQL



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: MySQL communication link failure

Stéphane Laurière
In reply to this post by Marc Lijour
Marc Lijour wrote:

> On September 23, 2005 17:03, Stéphane Laurière wrote:
>
>> SQL Error: 0, SQLState: 08S01
>
>
> It installed fine here, after some hand work, but I don't remember I
> had this problem (my config is very similar although I use JBoss with
> embedded Tomcat).
>
> I found this link. Hope that can help in something, if ruling out
> some possible issues.
>
> link: http://dev.mysql.com/doc/mysql/en/cj-faq.html
Thanks Marc, but I actually just found a workaround: I downgraded to
MySQL4.1.11 and now it works fine. We'll have to figure out some time
what's getting wrong when using the DBCPConnectionProvider against
MySQL4.1.12 as there's an issue apparently.

Cheers

Stéphane

--
Stéphane Laurière
[hidden email]
Mandriva Club - http://club.mandriva.com

Mandrakesoft becomes Mandriva!




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: MySQL communication link failure

Marc Lijour

> Thanks Marc, but I actually just found a workaround: I downgraded to
> MySQL4.1.11 and now it works fine. We'll have to figure out some time
> what's getting wrong when using the DBCPConnectionProvider against
> MySQL4.1.12 as there's an issue apparently.

Did somebody find a solution to this issue?



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws