-
Java 开源博客 Solo 2.9.4 发布,新皮肤加数据库重构
2018-09-17 01:44仍然有少量报错:
[ERROR]-[2018-09-16 17:42:19]-[org.b3log.solo.service.ArticleQueryService:862]: Gets relevant articles failed
java.lang.IllegalStateException: java.lang.ClassCastException: java.base/java.lang.Long cannot be cast to java.base/java.util.Date
at org.b3log.solo.util.comparator.ArticleUpdateDateComparator.compare(ArticleUpdateDateComparator.java:48)
at org.b3log.solo.util.comparator.ArticleUpdateDateComparator.compare(ArticleUpdateDateComparator.java:32)
at java.base/java.util.TimSort.countRunAndMakeAscending(TimSort.java:355)
at java.base/java.util.TimSort.sort(TimSort.java:220) -
Java 开源博客 Solo 2.9.4 发布,新皮肤加数据库重构
2018-09-17 01:41问题已经定位,就是由于部分皮肤没有升级兼容新版本的 solo 导致的.
改用 Medium 皮肤后问题解决. -
Java 开源博客 Solo 2.9.4 发布,新皮肤加数据库重构
2018-09-17 01:19我 grep 了一下
articleUpdateDate
似乎还有不少 ftl 模版在用这个.
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; color: #f3f3bd; background-color: #2a2a2a; background-color: rgba(42, 42, 42, 0.96)} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco; color: #f3f3bd; background-color: #2a2a2a; background-color: rgba(42, 42, 42, 0.96); min-height: 16.0px} span.s1 {font-variant-ligatures: no-common-ligatures} span.Apple-tab-span {white-space:pre}grep -ir articleUpdateDate .
Binary file ./.git/index matches
./.idea/dataSources/e220bb86-34ca-4298-ab6f-714ddc29d30c.xml:
./src/test/resources/skins/mobile/article.ftl: ${article.articleUpdateDate?string("yyyy-MM-dd HH:mm:ss")}
./src/test/resources/skins/mobile/article-list.ftl: <div class="cal-month month-{article.articleUpdateDate?string("MM")}">{article.articleUpdateDate?string("MM")}
./src/test/resources/skins/mobile/article-list.ftl:
${article.articleUpdateDate?string("dd")}./src/main/webapp/skins/ease/article.ftl: ${article.articleUpdateDate?string("yy-MM-dd HH:mm")}
./src/main/webapp/skins/ease/article-list.ftl: ${article.articleUpdateDate?string("yy-MM-dd HH:mm")}
./src/main/webapp/skins/owmx-3.0/article.ftl: {updateDateLabel}:{article.articleUpdateDate?string("yyyy-MM-dd HH:mm:ss")}
./src/main/webapp/skins/owmx-3.0/article-list.ftl: ${article.articleUpdateDate?string("yyyy-MM-dd HH:mm")}
./src/main/webapp/skins/NeoEase/article.ftl: ${article.articleUpdateDate?string("yyyy-MM-dd HH:mm:ss")}
./src/main/webapp/skins/NeoEase/article-list.ftl: ${article.articleUpdateDate?string("yyyy-MM-dd HH:mm:ss")}
./src/main/webapp/skins/tree-house/article.ftl: ${article.articleUpdateDate?string("yyyy-MM-dd HH:mm:ss")}
-
Java 开源博客 Solo 2.9.4 发布,新皮肤加数据库重构
2018-09-17 01:12补充错误信息:
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.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:1505)
at freemarker.ext.beans.BeanModel.invokeGenericGet(BeanModel.java:272)
at freemarker.ext.beans.BeanModel.get(BeanModel.java:152)
... 57 more
Caused by: org.json.JSONException: JSONObject["articleUpdateDate"] not found.
at org.json.JSONObject.get(JSONObject.java:540)
... 64 more -
Java 开源博客 Solo 2.9.4 发布,新皮肤加数据库重构
2018-09-17 01:12我是直接从 github 拉去的最新的源码到一个新目录中.
只修改了 latke 的配置文件中关于域名的部分.
然后, mvn jetty:run
运行的. -
Java 开源博客 Solo 2.9.4 发布,新皮肤加数据库重构
2018-09-17 01:10手动升级了数据库,确认字段该有的都有,不该有的都没有.
但是还是遇到了一个问题, 似乎是 FreeMarker 报告的:
[ERROR]-[2018-09-16 17:09:01]-[org.b3log.latke.servlet.renderer.freemarker.AbstractFreeMarkerRenderer:138]: FreeMarker renders error
FreeMarker template error:
An error has occurred when reading existing sub-variable "articleUpdateDate"; see cause exception! The type of the containing value was: extended_hash+string (org.json.JSONObject wrapped into f.e.b.StringModel)
FTL stack trace ("~" means nesting-related):
- Failed at: ${article.articleUpdateDate?string("y... [in template "article-list.ftl" at line 27, column 21]
- Reached through: #include "article-list.ftl" [in template "index.ftl" at line 63, column 21]Java stack trace (for programmers):
freemarker.core._TemplateModelException: [... Exception message was already printed; see it above ...]
at freemarker.ext.beans.BeanModel.get(BeanModel.java:183)
at freemarker.core.Dot._eval(Dot.java:43)
at freemarker.core.Expression.eval(Expression.java:83)
at freemarker.core.BuiltInsForMultipleTypes$stringBI._eval(BuiltInsForMultipleTypes.java:692)
at freemarker.core.Expression.eval(Expression.java:83) -
Java 开源博客 Solo 2.9.4 发布,新皮肤加数据库重构
2018-09-16 23:37升级失败了。
[INFO ]-[2018-09-16 15:36:21]-[org.b3log.solo.service.UpgradeService:191]: Upgrading from version [2.9.3] to version [2.9.4]....
[ERROR]-[2018-09-16 15:36:21]-[org.b3log.solo.service.UpgradeService:210]: Upgrade failed!
org.h2.jdbc.JdbcSQLException: Duplicate column name "ARTICLEAUTHORID"; SQL statement:
ALTER TABLEb3_solo_article
ADDarticleAuthorId
VARCHAR(19) DEFAULT '' NOT NULL [42121-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.table.Table.setColumns(Table.java:409) -
Java 开源博客 Solo 2.9.3 发布,可指定移动端皮肤
2018-09-15 22:50再补充一点,MySQL 连接串需要增加一个时区:
&serverTimezone=GMT%2B8jdbc.URL\=jdbc:mysql://localhost:3306/solo?useUnicode=yes&characterEncoding=utf8&serverTimezone=GMT%2B8
-
Java 开源博客 Solo 2.9.3 发布,可指定移动端皮肤
2018-09-15 22:41MySQL 驱动版本有些老了,不兼容 MySQL8.
建议改成:
<mysql-connector-java.version>8.0.11</mysql-connector-java.version>
-
Solo 用户指南
2018-09-14 22:21嗯,后面写新代码的时候,注意下,因为异常类型不是
Exception
而是 Error
或者是非Exception
子类的都会导致事务没有回滚。 -
Solo 开发指南
2018-09-14 02:22没有拉取 skins 子模块会导致初始化报错。
建议修改文档:
git clone --recursive
来 clone solo。
或者在 skins 目录执行:git submodule init && git submodule update