Details
-
Bug
-
Resolution: Fixed
-
Blocker
-
5.2.2, 5.4.1
-
Unknown
-
N/A
-
N/A
-
Description
If the space parameter is not null, the result of executing $xwiki.copySpaceBetweenWikis(...) is an error :
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'copySpaceBetweenWikis' in class com.xpn.xwiki.api.XWiki threw exception com.xpn.xwiki.XWikiException: Error number 3223 in 3: Exception while searching documents with sql select distinct doc.fullName from XWikiDocument as doc where doc.space = ? at silverpeas:Gestion.AppsManager[line 43, column 31] at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:243) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:187) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280) at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567) at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71) at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:420) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:228) ... 111 more Caused by: com.xpn.xwiki.XWikiException: Error number 3223 in 3: Exception while searching documents with sql select distinct doc.fullName from XWikiDocument as doc where doc.space = ? at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2247) at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2190) at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2183) at com.xpn.xwiki.store.XWikiCacheStore.search(XWikiCacheStore.java:566) at com.xpn.xwiki.XWiki.copySpaceBetweenWikis(XWiki.java:4341) at com.xpn.xwiki.api.XWiki.copySpaceBetweenWikis(XWiki.java:1609) 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.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) ... 132 more Caused by: org.hibernate.QueryException: Expected positional parameter count: 1, actual parameters: [] [select distinct doc.fullName from XWikiDocument as doc where doc.space = ?] at org.hibernate.impl.AbstractQueryImpl.verifyParameters(AbstractQueryImpl.java:366) at org.hibernate.impl.AbstractQueryImpl.verifyParameters(AbstractQueryImpl.java:322) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:98) at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2243) ... 144 more
The bug was introduced in XWIKI-3915. See https://github.com/xwiki/xwiki-platform/blame/master/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java#L4155 where search does not take into account parameters.