Tomcat 6 MySQL -> strange connection error -
i have ubuntu server apache -> mod_jk -> tomcat 6 -> mysql. everytime tomcat loads new *.war or restarted, gives me error:
com.mysql.jdbc.exceptions.jdbc4.communicationsexception: communications link failure last packet sent server 0 milliseconds ago. driver has not received packets server. @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:57) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:45) @ java.lang.reflect.constructor.newinstance(constructor.java:532)
and strange thing: after time (sometimes minutes or hours) , doing nothing, applications works charm - without other errors.
the connection set tomcat (with context-container) , goes 127.0.0.1 there no problem phpmyadmin.
remy, issue unfortunately not have "simple" answer, varies on many things. error receiving general communication error tomcat hands signifying communication issue, without being verbose issue is.
to start with, suggest checking mysql listening on 127.0.0.1, not localhost. reasoning differentiation servers have ipv6 (even if local ::1) try prefer connection first.
if netstat -an | grep listen, should see port 3306. socket listening on? make sure matches specifying in tomcat settings , proceed there.
Comments
Post a Comment