java.sql.SQLException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

MySQL doesn't support some types of characters (such as emojis) with the utf8 encoding. You need to be on MySQL 5.5+ and force utf8mb4 (everywhere, client and server). You can do this sending the query "SET NAMES utf8mb4". Check this https://goo.gl/3E2qzg

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • I've created a new Appfuse project using appfuse-basic-struts archetype and version 2.0-m4-SNAPSHOT. During running the "mvn integration-test" I got the following Exception: ------------------------------------------------------------------------------------------------------- [INFO] Configuration Properties file loaded: C:\Java\Appfuse\m4\target\classes\j dbc.properties [ERROR] SchemaExport - schema export unsuccessful <java.sql.SQLException: Unknow n initial character set index '48' received from server. Initial client characte r set can be forced via the 'characterEncoding' property.>java.sql.SQLException: Unknown initial character set index '48' received from server. Initial client c haracter set can be forced via the 'characterEncoding' property. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910) at com.mysql.jdbc.Connection.configureClientCharacterSet(Connection.java :2345) at com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:3 913) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2683) at com.mysql.jdbc.Connection.<init>(Connection.java:1531) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java :266) at java.sql.DriverManager.getConnection(DriverManager.java:582) at java.sql.DriverManager.getConnection(DriverManager.java:154) at org.hibernate.connection.DriverManagerConnectionProvider.getConnectio n(DriverManagerConnectionProvider.java:110) at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(Ma nagedProviderConnectionHelper.java:28) at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:180 ) at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133) at org.codehaus.mojo.hibernate3.exporter.Hbm2DDLExporterMojo.doExecute(H bm2DDLExporterMojo.java:112) at org.codehaus.mojo.hibernate3.HibernateExporterMojo.execute(HibernateE xporterMojo.java:139) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi nManager.java:420) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi fecycle(DefaultLifecycleExecutor.java:480) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau ltLifecycleExecutor.java:459) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan dleFailures(DefaultLifecycleExecutor.java:311) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen ts(DefaultLifecycleExecutor.java:278) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi fecycleExecutor.java:143) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123) at org.apache.maven.cli.MavenCli.main(MavenCli.java:272) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [WARNING] 1 errors occurred while performing <hbm2ddl>. [ERROR] Error #1: java.sql.SQLException: Unknown initial character set index '48 ' received from server. Initial client character set can be forced via the 'char acterEncoding' property. [INFO] [compiler:testCompile] [INFO] Compiling 1 source file to C:\Java\Appfuse\m4\target\test-classes [INFO] [dbunit:operation {execution: test-compile}] [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error executing database operation: CLEAN_INSERT Embedded error: Unknown initial character set index '48' received from server. I nitial client character set can be forced via the 'characterEncoding' property. [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1 minute 3 seconds [INFO] Finished at: Mon Mar 19 21:42:24 CET 2007 [INFO] Final Memory: 16M/30M [INFO] ------------------------------------------------------------------------ C:\Java\Appfuse\m4> ---------------------------------------------------------------------------------------- There is a problem with the mysql-connector-java driver version 5.0.4. Please see: http://forums.mysql.com/read.php?39,139534,139889#msg-139889 After downgrading to 5.0.3 like in Milestone3 every thing went fine. Afterwords I tried to upgrade it do the version 5.0.5. I got an exception because the version 5.0.5 is not yet available in the maven remote repository. So installed it to my local maven repository. Now every thing runs fine. Pls decide weather to update or to downgrade. Pls find attached the to patches. Best Regards
    via by Sebastian Lenk,
  • I've created a new Appfuse project using appfuse-basic-struts archetype and version 2.0-m4-SNAPSHOT. During running the "mvn integration-test" I got the following Exception: ------------------------------------------------------------------------------------------------------- [INFO] Configuration Properties file loaded: C:\Java\Appfuse\m4\target\classes\j dbc.properties [ERROR] SchemaExport - schema export unsuccessful <java.sql.SQLException: Unknow n initial character set index '48' received from server. Initial client characte r set can be forced via the 'characterEncoding' property.>java.sql.SQLException: Unknown initial character set index '48' received from server. Initial client c haracter set can be forced via the 'characterEncoding' property. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910) at com.mysql.jdbc.Connection.configureClientCharacterSet(Connection.java :2345) at com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:3 913) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2683) at com.mysql.jdbc.Connection.<init>(Connection.java:1531) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java :266) at java.sql.DriverManager.getConnection(DriverManager.java:582) at java.sql.DriverManager.getConnection(DriverManager.java:154) at org.hibernate.connection.DriverManagerConnectionProvider.getConnectio n(DriverManagerConnectionProvider.java:110) at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(Ma nagedProviderConnectionHelper.java:28) at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:180 ) at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133) at org.codehaus.mojo.hibernate3.exporter.Hbm2DDLExporterMojo.doExecute(H bm2DDLExporterMojo.java:112) at org.codehaus.mojo.hibernate3.HibernateExporterMojo.execute(HibernateE xporterMojo.java:139) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi nManager.java:420) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi fecycle(DefaultLifecycleExecutor.java:480) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau ltLifecycleExecutor.java:459) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan dleFailures(DefaultLifecycleExecutor.java:311) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen ts(DefaultLifecycleExecutor.java:278) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi fecycleExecutor.java:143) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123) at org.apache.maven.cli.MavenCli.main(MavenCli.java:272) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [WARNING] 1 errors occurred while performing <hbm2ddl>. [ERROR] Error #1: java.sql.SQLException: Unknown initial character set index '48 ' received from server. Initial client character set can be forced via the 'char acterEncoding' property. [INFO] [compiler:testCompile] [INFO] Compiling 1 source file to C:\Java\Appfuse\m4\target\test-classes [INFO] [dbunit:operation {execution: test-compile}] [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error executing database operation: CLEAN_INSERT Embedded error: Unknown initial character set index '48' received from server. I nitial client character set can be forced via the 'characterEncoding' property. [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1 minute 3 seconds [INFO] Finished at: Mon Mar 19 21:42:24 CET 2007 [INFO] Final Memory: 16M/30M [INFO] ------------------------------------------------------------------------ C:\Java\Appfuse\m4> ---------------------------------------------------------------------------------------- There is a problem with the mysql-connector-java driver version 5.0.4. Please see: http://forums.mysql.com/read.php?39,139534,139889#msg-139889 After downgrading to 5.0.3 like in Milestone3 every thing went fine. Afterwords I tried to upgrade it do the version 5.0.5. I got an exception because the version 5.0.5 is not yet available in the maven remote repository. So installed it to my local maven repository. Now every thing runs fine. Pls decide weather to update or to downgrade. Pls find attached the to patches. Best Regards
    via by Sebastian Lenk,
  • Problem in first Hibernate example
    via by 800328,
  • connection problem in mysql
    via by Khushwinder Chahal,
    • java.sql.SQLException: Unknown initial character set index '48' received from server. Initial client c haracter set can be forced via the 'characterEncoding' property. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910) at com.mysql.jdbc.Connection.configureClientCharacterSet(Connection.java:2345) at com.mysql.jdbc.Connection.initializePropsFromServer(Connection.java:3913) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2683) at com.mysql.jdbc.Connection.<init>(Connection.java:1531) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) at java.sql.DriverManager.getConnection(DriverManager.java:582) at java.sql.DriverManager.getConnection(DriverManager.java:154) at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110) at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:28) at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:180) at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133) at org.codehaus.mojo.hibernate3.exporter.Hbm2DDLExporterMojo.doExecute(Hbm2DDLExporterMojo.java:112) at org.codehaus.mojo.hibernate3.HibernateExporterMojo.execute(HibernateExporterMojo.java:139) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:420) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123) at org.apache.maven.cli.MavenCli.main(MavenCli.java:272) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375)[WARNING]

    Users with the same issue

    linxiaolong
    2 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    146 more bugmates