1

I have moved a JSF netbeans project from one PC to a new PC (the program works correctly on the old pc). I have successfully restored the code and the database but I am having issues trying to get the two to work together. The issue seems to be that on more old PC I was using an older version of mySQL and the relevant connector. Now when trying to connect I am getting an error message

java.sql.sqlexception java.lang.classcastexception: java.math.bigInterger cannot be cast to java.lang.long

I have tried downloading the latest J connector and have copied the jar file into the project but that has not fixed the issue and I am still getting the error above.

Does anyone have any ideas on what I can do to fix this issue? I have checked the previous answer and have replaced the connector/j with the most recent one but to know avail

  • Check this question https://stackoverflow.com/questions/46131295/classcastexception-java-math-biginteger-cannot-be-cast-to-java-lang-long-on-con – Ivan Jan 10 '19 at 16:48
  • thanks , I have read that response and have already replaced the connector and I am still getting the issue. I suspect that I have missed something when replacing the connector - does anyone have a step by step guide? – Richard Faint Jan 10 '19 at 17:06
  • I have replaced the JAR file mysql-connector-java-5.1.23-bin with mysql-connector-java-8.0.13 in the following folder C:\Program Files\NetBeans 8.2\ide\modules\ext is there anything I still need to do as I am still getting the error. Any ideas? – Richard Faint Jan 11 '19 at 11:07
  • I can also connect to the database from netbeans itself. I am obviously missing something . Any help appreciated – Richard Faint Jan 11 '19 at 12:09
  • You need to update the MySQL Connector/J used by your application. Now you have only updated the MySQL Connector/J used by NetBeans itself. – Mark Rotteveel Jan 11 '19 at 13:28
  • Are you using Maven to build your project? How do you run your project? Using Tomcat or any other application server? – Ivan Jan 11 '19 at 14:05
  • I am not using maven (it is on my list of things to learn). Mark I am using glassfish where would I update connector/j used by the application? – Richard Faint Jan 11 '19 at 14:50

0 Answers0