Grails GPARS升级(Grails GPARS upgrade)
我正在使用Grails 1.4.0.M1,我正在尝试升级gpars的版本以与我的应用程序一起使用。
所以我加入了BuildConfig.groovy:
dependencies{ build 'org.codehaus.gpars:gpars:0.11' }
但是,当我使用run-app时,这会带来以下异常:
Exception in thread "Thread-4" java.lang.ClassCastException: groovyx.gpars.ThreadLocalPools cannot be cast to groovy.lang.GroovyObject at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:47) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231) at groovyx.gpars.Parallelizer.retrieveCurrentPool(Parallelizer.groovy:62) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
我怀疑它可能与旧版本中使用此lib的grails框架相关联,并且版本不兼容。
任何想法我怎么能解决这个问题?
谢谢。
I am using Grails 1.4.0.M1 and I am trying to upgrade the version of gpars to use with my app.
So I added in BuildConfig.groovy:
dependencies{ build 'org.codehaus.gpars:gpars:0.11' }
This however brings me the following exception when I use run-app:
Exception in thread "Thread-4" java.lang.ClassCastException: groovyx.gpars.ThreadLocalPools cannot be cast to groovy.lang.GroovyObject at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:47) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231) at groovyx.gpars.Parallelizer.retrieveCurrentPool(Parallelizer.groovy:62) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
I suspect it could be linked to the grails framework using this lib in an older version and the versions being incompatible.
Any idea how I could overcome this issue?
Thanks.
原文:https://stackoverflow.com/questions/7055571
更新时间:2023-10-06 13:10
最满意答案
如果您使用的是编程语言,则可以简化SQL:
"SELECT username, id, Days FROM Users ORDER BY Days DESC";
然后使用编程语言处理行号:
if ($result->num_rows > 0) { $rowNumber=0; echo "<table><tr><th>ID</th><th>Name</th><th>Days</th></tr>"; // output data of each row while($row = $result->fetch_assoc()) { $rowNumber++; echo "<tr><td>" . $rowNumber "</td><td>" . $row["username"]. "</td><td>" . $row["Days"]. "</td></tr>"; } echo "</table>"; } else { echo "0 results"; }
If you are using a programming language, you can keep your SQL simple:
"SELECT username, id, Days FROM Users ORDER BY Days DESC";
Then process the row number using the programming language:
if ($result->num_rows > 0) { $rowNumber=0; echo "<table><tr><th>ID</th><th>Name</th><th>Days</th></tr>"; // output data of each row while($row = $result->fetch_assoc()) { $rowNumber++; echo "<tr><td>" . $rowNumber "</td><td>" . $row["username"]. "</td><td>" . $row["Days"]. "</td></tr>"; } echo "</table>"; } else { echo "0 results"; }
相关问答
更多-
还有一个选择 UPDATE x SET x.CODE_DEST = x.New_CODE_DEST FROM ( SELECT CODE_DEST, ROW_NUMBER() OVER (ORDER BY [RS_NOM]) AS New_CODE_DEST FROM DESTINATAIRE_TEMP ) x With UpdateData As ( SELECT RS_NOM, ROW_NUMBER() OVER (ORDER BY [RS_NOM] DESC) ...
-
你必须在窗口函数之后但在别名之前添加。 SELECT ROW_NUMBER() OVER (ORDER BY col_1, value DESC) + 1 as Row FROM table ...或者,如果看起来更清楚,你可以把它放在开头: SELECT 1 + ROW_NUMBER() OVER (ORDER BY col_1, value DESC) as Row FROM table 我还在col1和value之间添加了一个逗号。 我假设这些是两个不同的列,这是一个错字。 只是提到完整性 ...
-
除非包含ORDER BY子句,否则认为行具有数字是错误的。 插入后找到行的唯一方法是搜索它。 据推测,你的桌子有一个主键; 用它来搜索它。 It is an error to think that rows have numbers unless an ORDER BY clause is included. The only way to find a row after you have inserted it is to search for it. Presumably your table has ...
-
如果您使用的是编程语言,则可以简化SQL: "SELECT username, id, Days FROM Users ORDER BY Days DESC"; 然后使用编程语言处理行号: if ($result->num_rows > 0) { $rowNumber=0; echo "