0

I'm trying to create a Java Server CRUD application for a MySQL database in Netbeans as demonstrated here:

https://netbeans.org/kb/docs/web/jsf20-crud.html

but this is the error I get:

In-place deployment at

C:\Users\john\Documents\Java Practice\CustomerService\build\web GlassFish Server 4.1.1, deploy, null, false

C:\Users\john\Documents\Java Practice\CustomerService\nbproject\build-impl.xml:1048: The module has not been deployed.

Looking at the Glassfish server log I see:

java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long

My current connection uses the Connector/J 8.0.20.jar driver located at C:\Program Files (x86)\MySQL\Connector J 8.0.20\mysql-connector-java-8.0.20.jar. The admin properties are:

Path/URL to admin tool:

C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqladmin.exe

Path to start command:

C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe

Path to stop command:

C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqladmin.exe

Is this a compatibility issue? Any help would be greatly appreciated, thanks!

pradosh nair
  • 913
  • 1
  • 16
  • 28
  • 1
    Does this answer your question? [ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long on connect to MySQL](https://stackoverflow.com/questions/46131295/classcastexception-java-math-biginteger-cannot-be-cast-to-java-lang-long-on-con) – Dmitry Pisklov Jun 08 '20 at 18:20
  • Hi, I've looked at the earlier question and I've tried putting several different versions of the MySQL Connector/J driver into the Databases setting under "servers", but unfortunately the result is always the same. Thanks for your help! – John Gribble Jun 08 '20 at 19:13
  • The drivers under 'servers' are not the drivers used by your application. You need to update the libraries in the build/class path of your application – Mark Rotteveel Jun 09 '20 at 16:55

0 Answers0