You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/12/09 08:00:35 UTC

[GitHub] [shardingsphere] Yule-Momoko opened a new issue #14014: com.mysql.cj.exceptions.WrongArgumentException: Invalid argument value: java.io.NotSerializableException

Yule-Momoko opened a new issue #14014:
URL: https://github.com/apache/shardingsphere/issues/14014


   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   Please pay attention on issues you submitted, because we maybe need more details. 
   If no response anymore and we cannot reproduce it on current information, we will **close it**.
   
   Please answer these questions before submitting your issue. Thanks!
   
   ### Which version of ShardingSphere did you use?
   5.0.0
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC 
   
   ### Expected behavior
   
   ### Actual behavior
   Error saving longblob field type
   Caused by: com.mysql.cj.exceptions.WrongArgumentException: Invalid argument value: java.io.NotSerializableException
   
   ### Reason analyze (If you can)
   longblob field type Can't save
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   rg.apache.ibatis.exceptions.PersistenceException: 
   ### Error updating database.  Cause: java.sql.SQLException: Invalid argument value: java.io.NotSerializableException
   ### The error may exist in org/activiti/db/mapping/entity/Comment.xml
   ### The error may involve org.activiti.engine.impl.persistence.entity.CommentEntity.insertComment-Inline
   ### The error occurred while setting parameters
   ### SQL: insert into ACT_HI_COMMENT (ID_, TYPE_, TIME_, USER_ID_, TASK_ID_, PROC_INST_ID_, ACTION_, MESSAGE_, FULL_MSG_)     values (?,       ?,       ?,       ?,       ?,       ?,       ?,       ?,       ?)
   ### Cause: java.sql.SQLException: Invalid argument value: java.io.NotSerializableException
   	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:199)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
   ### Example codes for reproduce this issue (such as a github link).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] Yule-Momoko commented on issue #14014: com.mysql.cj.exceptions.WrongArgumentException: Invalid argument value: java.io.NotSerializableException

Posted by GitBox <gi...@apache.org>.
Yule-Momoko commented on issue #14014:
URL: https://github.com/apache/shardingsphere/issues/14014#issuecomment-989609909


   > @Yule-Momoko嗨,抱歉回复晚了,你能提供你的配置吗?分片或其他功能?
   
   Configure read/write separation only


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on issue #14014: com.mysql.cj.exceptions.WrongArgumentException: Invalid argument value: java.io.NotSerializableException

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #14014:
URL: https://github.com/apache/shardingsphere/issues/14014#issuecomment-989605210


   @Yule-Momoko Hi, sorry for late reply, can you provide your configration? sharding or other feature?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu closed issue #14014: com.mysql.cj.exceptions.WrongArgumentException: Invalid argument value: java.io.NotSerializableException

Posted by GitBox <gi...@apache.org>.
strongduanmu closed issue #14014:
URL: https://github.com/apache/shardingsphere/issues/14014


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on issue #14014: com.mysql.cj.exceptions.WrongArgumentException: Invalid argument value: java.io.NotSerializableException

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #14014:
URL: https://github.com/apache/shardingsphere/issues/14014#issuecomment-989638459


   @Yule-Momoko Hello, I used MySQL 5.7 and 8.x versions, and the Druid/Hikari connection pool for testing, but this exception cannot be reproduced. The following is the configuration I tested:
   
   ```yaml
   dataSources:
     write_0:
   #    dataSourceClassName: com.zaxxer.hikari.HikariDataSource
       dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
   #    driverClassName: com.mysql.jdbc.Driver
       driverClassName: com.mysql.cj.jdbc.Driver
       url: jdbc:mysql://127.0.0.1:3306/write_0?serverTimezone=UTC&useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&allowPublicKeyRetrieval=true
   #    jdbcUrl: jdbc:mysql://127.0.0.1:3306/write_0?serverTimezone=UTC&useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&allowPublicKeyRetrieval=true
       username: root
       password: 123456
       maxWait: 60
       maxActive: 20
     read_0:
   #    dataSourceClassName: com.zaxxer.hikari.HikariDataSource
       dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
   #    driverClassName: com.mysql.jdbc.Driver
       driverClassName: com.mysql.cj.jdbc.Driver
   #    jdbcUrl: jdbc:mysql://127.0.0.1:3306/write_0?serverTimezone=UTC&useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&allowPublicKeyRetrieval=true
       url: jdbc:mysql://127.0.0.1:3306/write_0?serverTimezone=UTC&useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&allowPublicKeyRetrieval=true
       username: root
       password: 123456
       maxWait: 60
       maxActive: 20
     read_1:
   #    dataSourceClassName: com.zaxxer.hikari.HikariDataSource
       dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
   #    driverClassName: com.mysql.jdbc.Driver
       driverClassName: com.mysql.cj.jdbc.Driver
   #    jdbcUrl: jdbc:mysql://127.0.0.1:3306/write_0?serverTimezone=UTC&useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&allowPublicKeyRetrieval=true
       url: jdbc:mysql://127.0.0.1:3306/write_0?serverTimezone=UTC&useSSL=false&useServerPrepStmts=true&cachePrepStmts=true&allowPublicKeyRetrieval=true
       username: root
       password: 123456
       maxWait: 60
       maxActive: 20
   
   rules:
   - !READWRITE_SPLITTING
     dataSources:
       pr_ds:
         writeDataSourceName: write_0
         readDataSourceNames:
           - read_0
           - read_1
   ```
   
   ```sql
   CREATE DATABASE write_0;
   USE write_0;
   CREATE TABLE test(id INT(1) PRIMARY KEY, content LONGBLOB);
   
   execute(dataSource, "INSERT INTO test(id, content) VALUES(?, ?), (?, ?);", false, Arrays.asList(1, "11", 2, "22"));
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] Yule-Momoko commented on issue #14014: com.mysql.cj.exceptions.WrongArgumentException: Invalid argument value: java.io.NotSerializableException

Posted by GitBox <gi...@apache.org>.
Yule-Momoko commented on issue #14014:
URL: https://github.com/apache/shardingsphere/issues/14014#issuecomment-989615952


   Caused by: java.sql.SQLException: Invalid argument value: java.io.NotSerializableException
   	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
   	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
   	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
   	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
   	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
   	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:85)
   	at com.mysql.cj.jdbc.ClientPreparedStatement.setObject(ClientPreparedStatement.java:1671)
   	at com.alibaba.druid.pool.DruidPooledPreparedStatement.setObject(DruidPooledPreparedStatement.java:480)
   	at org.apache.shardingsphere.driver.jdbc.adapter.AbstractPreparedStatementAdapter.lambda$addParameters$0(AbstractPreparedStatementAdapter.java:289)
   	at org.apache.shardingsphere.driver.jdbc.adapter.AbstractPreparedStatementAdapter.replaySetParameter(AbstractPreparedStatementAdapter.java:281)
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.replaySetParameter(ShardingSpherePreparedStatement.java:415)
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.replay(ShardingSpherePreparedStatement.java:407)
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.cacheStatements(ShardingSpherePreparedStatement.java:403)
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.execute(ShardingSpherePreparedStatement.java:297)
   	at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47)
   	at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
   	at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
   	at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
   	at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)
   	... 112 common frames omitted
   Caused by: com.mysql.cj.exceptions.WrongArgumentException: Invalid argument value: java.io.NotSerializableException
   	at sun.reflect.GeneratedConstructorAccessor164.newInstance(Unknown Source)
   	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
   	at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
   	at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)
   	at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151)
   	at com.mysql.cj.AbstractQueryBindings.setSerializableObject(AbstractQueryBindings.java:794)
   	at com.mysql.cj.AbstractQueryBindings.setObject(AbstractQueryBindings.java:236)
   	at com.mysql.cj.jdbc.ClientPreparedStatement.setObject(ClientPreparedStatement.java:1669)
   	... 125 common frames omitted
   Caused by: java.io.NotSerializableException: java.io.ByteArrayInputStream
   	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
   	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
   	at com.mysql.cj.AbstractQueryBindings.setSerializableObject(AbstractQueryBindings.java:783)
   	... 127 common frames omitted
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on issue #14014: com.mysql.cj.exceptions.WrongArgumentException: Invalid argument value: java.io.NotSerializableException

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #14014:
URL: https://github.com/apache/shardingsphere/issues/14014#issuecomment-1000583381


   Since there is no reply for a long time, I will close this issue. If there is still a problem, please submit issue feedback, thank you.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] strongduanmu commented on issue #14014: com.mysql.cj.exceptions.WrongArgumentException: Invalid argument value: java.io.NotSerializableException

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #14014:
URL: https://github.com/apache/shardingsphere/issues/14014#issuecomment-989639671


   In addition, from your log, it should be that Druid throws an exception because the parameter does not implement serializable interface. @Yule-Momoko So please double check your business code.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org