Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Configuring Eclipse Jetty 8.1.5, MySQL 5.1 aka (where the <bleep> does a <resource-ref> go?)

A bit of progress...that's great.

Okay, so jetty is starting, and trying to handle the request...but the sql connect is failing. The error I'm getting now is:

Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
(The more detailed stack trace for this is listed at the bottom.)

Mysql is up and running on port 3306.
I can log into it on the command line using the same username/password that are shown in the jetty-env.xml file (but see below).
The database exists, and contains tables.

Interesting points:
If I "telnet localhost 3306" the connection is immediately shut down (and the connection attempt is logged in /var/log/auth.log).

If I change the Url in jetty-env.xml to "jdbc:mysql://clicksafety.co.uk:3306/chat", and then try to connect, I get 4 messages in /var/log/auth.log saying that the connection was refused.

if I try "mysql -u root -h 127.0.0.1 -p" from the command line, I'm shutdown immediately with "reading initial communication packet", and it's logged into /var/log/auth.log

if I try "mysql -u root -h its.ec -p" from the command line, I'm shutdown immediately with "can't connect to MySQL server on 'its.ec'", and it is not logged into /var/log/auth.log

if I just try "mysql -u root -p" or (mysql -u root -h localhost -p), and give the correct password, I'm straight in.

I suspect the problem is an interaction between mysql's permissions and what JDBC is telling mysql its server is, but I can't configure the logging of either bit of software to tell me enough to diagnose.

-Ken

----------------------------------------------------------
2012-08-07 09:25:07.019:INFO:/:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
?at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
?at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ?at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
?at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
?at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
?at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1117)
?at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:668)
?at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1078)
?at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2397)
?at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2430)
?at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2215)
?at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:813)
?at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
?at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
?at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ?at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
?at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
?at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
?at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)
?at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334) ?at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:443) ?at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:141) ?at com.mysql.jdbc.jdbc2.optional.MysqlDataSource.getConnection(MysqlDataSource.java:111) ?at com.google.android.gcm.demo.server.Datastore.getDevices(Datastore.java:109) ?at com.google.android.gcm.demo.server.HomeServlet.doGet(HomeServlet.java:70)


Back to the top