Sym 上的评论同步到 Solo 时,可能会报下面的错误,看着像是主键重复的错误,但是评论也是同步过去了的,这就奇怪了。评论的 ID 也是同步过来的吗?如果是的话这样很容易重复,个人觉得同步过来的时候应该重新生成 ID 。
[ERROR]-[2017-04-23 23:27:16]-[org.b3log.latke.repository.jdbc.JdbcRepository:149]: add:Unique index or primary key violation: "PRIMARY_KEY_5 ON PUBLIC.B3_SOLO_COMMENT(OID) VALUES ('1492961195666', 96)"; SQL statement:
insert into b3_solo_comment(commentSharpURL,commentName,commentThumbnailURL,commentOnId,commentEmail,commentURL,commentDate,commentOriginalCommentId,commentOnType,oId,commentContent,commentOriginalCommentName) values (?,?,?,?,?,?,?,?,?,?,?,?) [23505-190]
org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "PRIMARY_KEY_5 ON PUBLIC.B3_SOLO_COMMENT(OID) VALUES ('1492961195666', 96)"; SQL statement:
insert into b3_solo_comment(commentSharpURL,commentName,commentThumbnailURL,commentOnId,commentEmail,commentURL,commentDate,commentOriginalCommentId,commentOnType,oId,commentContent,commentOriginalCommentName) values (?,?,?,?,?,?,?,?,?,?,?,?) [23505-190]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:102)
at org.h2.mvstore.db.MVSecondaryIndex.checkUnique(MVSecondaryIndex.java:231)
at org.h2.mvstore.db.MVSecondaryIndex.add(MVSecondaryIndex.java:190)
at org.h2.mvstore.db.MVTable.addRow(MVTable.java:704)
at org.h2.command.dml.Insert.insertRows(Insert.java:156)
at org.h2.command.dml.Insert.update(Insert.java:114)
at org.h2.command.CommandContainer.update(CommandContainer.java:78)
at org.h2.command.Command.executeUpdate(Command.java:253)
at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:198)
at org.b3log.latke.repository.jdbc.util.JdbcUtil.executeSql(JdbcUtil.java:89)
at org.b3log.latke.repository.jdbc.JdbcRepository.add(JdbcRepository.java:147)
at org.b3log.latke.repository.AbstractRepository.add(AbstractRepository.java:117)
at org.b3log.solo.repository.impl.CommentRepositoryImpl_$$_jvst889_37._d0add(CommentRepositoryImpl_$$_jvst889_37.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.b3log.latke.ioc.bean.JavassistMethodHandler.invoke(JavassistMethodHandler.java:101)
at org.b3log.solo.repository.impl.CommentRepositoryImpl_$$_jvst889_37.add(CommentRepositoryImpl_$$_jvst889_37.java)
at org.b3log.solo.api.symphony.CommentReceiver.addComment(CommentReceiver.java:250)
at org.b3log.solo.api.symphony.CommentReceiver_$$_jvst889_48._d0addComment(CommentReceiver_$$_jvst889_48.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.b3log.latke.ioc.bean.JavassistMethodHandler.invoke(JavassistMethodHandler.java:101)
at org.b3log.solo.api.symphony.CommentReceiver_$$_jvst889_48.addComment(CommentReceiver_$$_jvst889_48.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.b3log.latke.servlet.handler.MethodInvokeHandler.handle(MethodInvokeHandler.java:58)
at org.b3log.latke.servlet.HttpControl.nextHandler(HttpControl.java:99)
at org.b3log.latke.servlet.handler.AdviceHandler.handle(AdviceHandler.java:108)
at org.b3log.latke.servlet.HttpControl.nextHandler(HttpControl.java:99)
at org.b3log.latke.servlet.handler.ArgsHandler.handle(ArgsHandler.java:60)
at org.b3log.latke.servlet.HttpControl.nextHandler(HttpControl.java:99)
at org.b3log.latke.servlet.handler.RequestDispatchHandler.handle(RequestDispatchHandler.java:92)
at org.b3log.latke.servlet.HttpControl.nextHandler(HttpControl.java:99)
at org.b3log.latke.servlet.handler.RequestPrepareHandler.handle(RequestPrepareHandler.java:45)
at org.b3log.latke.servlet.HttpControl.nextHandler(HttpControl.java:99)
at org.b3log.latke.servlet.handler.StaticResourceHandler.handle(StaticResourceHandler.java:119)
at org.b3log.latke.servlet.HttpControl.nextHandler(HttpControl.java:99)
at org.b3log.latke.servlet.DispatcherServlet.service(DispatcherServlet.java:84)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:800)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
at org.b3log.solo.filter.InitCheckFilter.doFilter(InitCheckFilter.java:87)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.b3log.solo.filter.PermalinkFilter.doFilter(PermalinkFilter.java:92)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.b3log.latke.servlet.filter.EncodingFilter.doFilter(EncodingFilter.java:71)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:497)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:245)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Unknown Source)
[ERROR]-[2017-04-23 23:27:16]-[org.b3log.latke.servlet.HttpControl:104]: Request [
method=PUT,
URL=http://zixizixi.cn/apis/symphony/comment,
contentType=null,
characterEncoding=UTF-8,
local=[
addr=0:0:0:0:0:0:0:1,
port=****,
name=0:0:0:0:0:0:0:1],
remote=[
addr=121.40.142.200,
port=61755,
host=0:0:0:0:0:0:0:1],
headers=[
Cache-Control=no-cache
Accept=text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection=close
User-Agent=Java/1.8.0_121
X-Forwarded-For=121.40.142.200
Host=zixizixi.cn
REMOTE-HOST=121.40.142.200
Pragma=no-cache
Content-Length=374
X-Real-IP=121.40.142.200
]
] processing failed
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.b3log.latke.servlet.handler.MethodInvokeHandler.handle(MethodInvokeHandler.java:58)
at org.b3log.latke.servlet.HttpControl.nextHandler(HttpControl.java:99)
at org.b3log.latke.servlet.handler.AdviceHandler.handle(AdviceHandler.java:108)
at org.b3log.latke.servlet.HttpControl.nextHandler(HttpControl.java:99)
at org.b3log.latke.servlet.handler.ArgsHandler.handle(ArgsHandler.java:60)
at org.b3log.latke.servlet.HttpControl.nextHandler(HttpControl.java:99)
at org.b3log.latke.servlet.handler.RequestDispatchHandler.handle(RequestDispatchHandler.java:92)
at org.b3log.latke.servlet.HttpControl.nextHandler(HttpControl.java:99)
at org.b3log.latke.servlet.handler.RequestPrepareHandler.handle(RequestPrepareHandler.java:45)
at org.b3log.latke.servlet.HttpControl.nextHandler(HttpControl.java:99)
at org.b3log.latke.servlet.handler.StaticResourceHandler.handle(StaticResourceHandler.java:119)
at org.b3log.latke.servlet.HttpControl.nextHandler(HttpControl.java:99)
at org.b3log.latke.servlet.DispatcherServlet.service(DispatcherServlet.java:84)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:800)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
at org.b3log.solo.filter.InitCheckFilter.doFilter(InitCheckFilter.java:87)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.b3log.solo.filter.PermalinkFilter.doFilter(PermalinkFilter.java:92)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.b3log.latke.servlet.filter.EncodingFilter.doFilter(EncodingFilter.java:71)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:497)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:245)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Unknown Source)
Caused by: org.b3log.latke.repository.jdbc.JDBCRepositoryException: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "PRIMARY_KEY_5 ON PUBLIC.B3_SOLO_COMMENT(OID) VALUES ('1492961195666', 96)"; SQL statement:
insert into b3_solo_comment(commentSharpURL,commentName,commentThumbnailURL,commentOnId,commentEmail,commentURL,commentDate,commentOriginalCommentId,commentOnType,oId,commentContent,commentOriginalCommentName) values (?,?,?,?,?,?,?,?,?,?,?,?) [23505-190]
at org.b3log.latke.repository.jdbc.JdbcRepository.add(JdbcRepository.java:150)
at org.b3log.latke.repository.AbstractRepository.add(AbstractRepository.java:117)
at org.b3log.solo.repository.impl.CommentRepositoryImpl_$$_jvst889_37._d0add(CommentRepositoryImpl_$$_jvst889_37.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.b3log.latke.ioc.bean.JavassistMethodHandler.invoke(JavassistMethodHandler.java:101)
at org.b3log.solo.repository.impl.CommentRepositoryImpl_$$_jvst889_37.add(CommentRepositoryImpl_$$_jvst889_37.java)
at org.b3log.solo.api.symphony.CommentReceiver.addComment(CommentReceiver.java:250)
at org.b3log.solo.api.symphony.CommentReceiver_$$_jvst889_48._d0addComment(CommentReceiver_$$_jvst889_48.java)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.b3log.latke.ioc.bean.JavassistMethodHandler.invoke(JavassistMethodHandler.java:101)
at org.b3log.solo.api.symphony.CommentReceiver_$$_jvst889_48.addComment(CommentReceiver_$$_jvst889_48.java)
... 43 more
Caused by: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "PRIMARY_KEY_5 ON PUBLIC.B3_SOLO_COMMENT(OID) VALUES ('1492961195666', 96)"; SQL statement:
insert into b3_solo_comment(commentSharpURL,commentName,commentThumbnailURL,commentOnId,commentEmail,commentURL,commentDate,commentOriginalCommentId,commentOnType,oId,commentContent,commentOriginalCommentName) values (?,?,?,?,?,?,?,?,?,?,?,?) [23505-190]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:102)
at org.h2.mvstore.db.MVSecondaryIndex.checkUnique(MVSecondaryIndex.java:231)
at org.h2.mvstore.db.MVSecondaryIndex.add(MVSecondaryIndex.java:190)
at org.h2.mvstore.db.MVTable.addRow(MVTable.java:704)
at org.h2.command.dml.Insert.insertRows(Insert.java:156)
at org.h2.command.dml.Insert.update(Insert.java:114)
at org.h2.command.CommandContainer.update(CommandContainer.java:78)
at org.h2.command.Command.executeUpdate(Command.java:253)
at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:198)
at org.b3log.latke.repository.jdbc.util.JdbcUtil.executeSql(JdbcUtil.java:89)
at org.b3log.latke.repository.jdbc.JdbcRepository.add(JdbcRepository.java:147)
... 59 more
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于