Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: "com.mysql.jdbc.exceptions.jdbc4.Communication sExc eption: Communications link failure

  1. #1
    Member
    Join Date
    Jul 2011
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default "com.mysql.jdbc.exceptions.jdbc4.Communication sExc eption: Communications link failure

    I'm trying to run my jsp page but netbean ide keep giving me this error:-

    root cause

    javax.servlet.ServletException: javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "com.mysql.jdbc.exceptions.jdbc4.CommunicationsExc eption: 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."
    org.apache.jasper.runtime.PageContextImpl.doHandle PageException(PageContextImpl.java:862)
    org.apache.jasper.runtime.PageContextImpl.handlePa geException(PageContextImpl.java:791)
    org.apache.jsp.DisplayData_jsp._jspService(Display Data_jsp.java:141)
    org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    org.netbeans.modules.web.monitor.server.MonitorFil ter.doFilter(MonitorFilter.java:393)

    root cause

    javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "com.mysql.jdbc.exceptions.jdbc4.CommunicationsExc eption: 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."
    org.apache.taglibs.standard.tag.common.sql.QueryTa gSupport.getConnection(QueryTagSupport.java:276)
    org.apache.taglibs.standard.tag.common.sql.QueryTa gSupport.doStartTag(QueryTagSupport.java:159)
    org.apache.jsp.DisplayData_jsp._jspx_meth_sql_005f query_005f0(DisplayData_jsp.java:191)
    org.apache.jsp.DisplayData_jsp._jspService(Display Data_jsp.java:93)
    org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    org.netbeans.modules.web.monitor.server.MonitorFil ter.doFilter(MonitorFilter.java:393)

    So, i thought I would add the MySQL connector jar file again. I added in relative file at the add library there.

    ..\..\Mysqlconnector\mysql-connector-java-5.1.15\

    Not sure why still can't get connected.

    Hope someone can advise me how to make it work. Thanks.


  2. #2
    Member
    Join Date
    Oct 2011
    Posts
    36
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default Re: "com.mysql.jdbc.exceptions.jdbc4.Communication sExc eption: Communications link fa


  3. #3
    Member
    Join Date
    Jul 2011
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: "com.mysql.jdbc.exceptions.jdbc4.Communication sExc eption: Communications link f

    Quote Originally Posted by luck999 View Post
    Thank you luck999. After I add in the resources reference, they don't give me the error already. However, I am still exploring other areas of errors. :-(

  4. #4
    Junior Member
    Join Date
    Oct 2011
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: "com.mysql.jdbc.exceptions.jdbc4.Communication sExc eption: Communications link fa

    Hi,
    Please check the version of database and use the correct jar , I think that may be the cause.

Similar Threads

  1. java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
    By i4ba1 in forum JDBC & Databases
    Replies: 2
    Last Post: August 23rd, 2011, 12:41 PM
  2. Replies: 7
    Last Post: August 13th, 2011, 01:22 AM
  3. Replies: 1
    Last Post: June 15th, 2011, 01:27 PM
  4. Communications Link Failure
    By aussiemcgr in forum Java Theory & Questions
    Replies: 1
    Last Post: June 14th, 2011, 07:03 PM
  5. com.mysql.jdbc.exceptions.MySQLIntegrityConstraint ViolationException:
    By bobbyraj2003 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: May 25th, 2011, 09:10 AM