Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 720735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:47:34+00:00 2026-05-14T05:47:34+00:00

I get a communication link failure while application tries to establish a connection with

  • 0

I get a communication link failure while application tries to establish a connection with DB.

[#|2010-04-08T20:09:57.825+0300|SEVERE|glassfish3.0|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=24;_ThreadName=Thread-1;|Cannot connect to database server = 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.|#]

Precisely at this string:

Statement s = conn.createStatement();

where conn is defined as follows:

private static java.sql.Connection conn;

For this app I have set a connection pool with default parameters and currently it (app) uses both JPA and direct JDBC queries. Recreation of connection pool gave nothing, connection pool ping gave next message:

Ping Connection Pool for pool is Failed. Ping failed Exce
ption - Connection could not be allocated because: Communications lin
k failure%%%EOL%%%%%%EOL%%%The last packet sent successfully to the s
erver was 0 milliseconds ago. The driver has not received any packets
from the server. Please check the server.log for more details.%%%EOL
%%%Ping failed Exception - Connection could not be allocated because:
Communications link failure

and flushing the connection pool gave:

com.sun.enterprise.admin.cli.CommandException: remote failure: Failed to flush connection pool ...

However I can connect to the database from a terminal. Besides I have the same app working on my local machine with identical connection pool settings.

Any one has an idea on whats going on or how to solve the trouble?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T05:47:35+00:00Added an answer on May 14, 2026 at 5:47 am

    Such problem could be if you have mysql server & glassfish server on the same host, and in mysql configuration you have option bind to some public address (for example 192.168.0.1 of eth0 interface) that normally successfully working with simple jdbc/jpa using user@localhost, but they don`t in a case of glassfish JTA, instead to bind to some of local address you getting link failure. As rule you could not bind to any local (localhost/127.0.0.1) addresses of such mysql host if public address presented.

    Example:

    my.cnf

    bind-address = 127.0.0.1

    bind-address = 192.168.0.1

    127.0.0.1 – assign to lo interface

    192.168.0.1 – assign to eth0 interface

    It is glassfish-mysql bug.

    Currently in order to use JTA, you should not bind mysql to such address. (remove "bind-address=192.168.0.1" from my.cnf). Or use user@192.168.0.1 what is less secure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 372k
  • Answers 372k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Look to the semantic-ia-fast-jump function, defined in semantic-ia. For C… May 14, 2026 at 7:22 pm
  • Editorial Team
    Editorial Team added an answer Use the LocalParams class to represent LocalParams in Solr: solr.Query(new… May 14, 2026 at 7:22 pm
  • Editorial Team
    Editorial Team added an answer You have two options that are similar to SSI Use… May 14, 2026 at 7:22 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.