对于问题的凌乱/复杂的描述和不断的编辑,我感到抱歉,但我还没有查明根本问题。
我在将 PlayORM 与 Grails 一起使用时遇到了困难: 1. 存在依赖冲突,我可能已经通过从 BuildPath 和“/lib”文件夹中删除“logback-classic.jar”解决了这个问题,但保留了“commons-logging”。有关该问题的详细信息,请参见下文。2. 现在我得到了一些奇怪的 PlayORM 异常,我认为这可能是由于删除了依赖项:
| Loading Grails 2.2.1
| Configuring classpath.
| Environment set to development.....
| Packaging Grails application.....
| Running Grails application
| Error 2013-06-18 10:38:31,057 [Thread-8] ERROR plugins.DefaultGrailsPlugin - Cannot generate controller logic for scaffolded class class nosql.Transaction. It is not a domain class!
| Server running. Browse to http://localhost:8080/gibb
java.lang.RuntimeException: Failure scanning class(see chained exception)=class com.alvazan.orm.api.z8spi.meta.DboTableMeta
at com.alvazan.orm.layer0.base.MyClassAnnotationDiscoveryListener.scanClass(MyClassAnnotationDiscoveryListener.java:50)
.......
**Caused by: java.lang.RuntimeException: Failure scanning field=private java.lang.String com.alvazan.orm.api.z8spi.meta.DboTableMeta.columnFamily for class=DboTableMeta
at com.alvazan.orm.impl.meta.scan.ScannerForClass.inspectField(ScannerForClass.java:209)
at com.alvazan.orm.impl.meta.scan.ScannerForClass.scanFields(ScannerForClass.java:202)
at com.alvazan.orm.impl.meta.scan.ScannerForClass.scanSingle(ScannerForClass.java:122)
at com.alvazan.orm.impl.meta.scan.ScannerForClass.addClass(ScannerForClass.java:80)
at com.alvazan.orm.layer0.base.MyClassAnnotationDiscoveryListener.scanClass(MyClassAnnotationDiscoveryListener.java:48)
... 107 more
Caused by: java.lang.IllegalArgumentException: class=class com.alvazan.orm.impl.meta.data.MetaClassSingle has two fields that have @NoSqlId annotation. One of them may be in a superclass. The two fields are=private java.lang.String com.alvazan.orm.api.z8spi.meta.DboTableMeta.columnFamily and=private java.lang.String com.alvazan.orm.api.z8spi.meta.DboTableMeta.columnFamily
at com.alvazan.orm.impl.meta.scan.ScannerForClass.processIdFieldWorks(ScannerForClass.java:253)
at com.alvazan.orm.impl.meta.scan.ScannerForClass.inspectFieldImpl(ScannerForClass.java:220)
at com.alvazan.orm.impl.meta.scan.ScannerForClass.inspectField(ScannerForClass.java:207)
... 111 more**
笔记:
最初的问题:基本上我在 Grails 上执行“run-app”或“test-app”时收到以下错误消息:
| Loading Grails 2.2.1
| Configuring classpath
| Error SLF4J: Class path contains multiple SLF4J bindings.
| Error SLF4J: Found binding in [jar:file:/home/saasbook/Dropbox/Projects/GrailsWorkSpace/gibb/lib/logback-classic-1.0.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
| Error SLF4J: Found binding in [jar:file:/home/saasbook/.grails/ivy-cache/org.grails/grails-plugin-log4j/jars/grails-plugin-log4j-2.2.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
该应用程序会运行,但在尝试将对象刷新到数据库时会出现 PlayORM 异常:
java.lang.IllegalArgumentException: Entity type=nosql.Transaction was not scanned and added to meta information on startup. It is either missing @NoSqlEntity annotation or it was not in list of scanned packages
注意:“Transaction.java”类确实有@NoSqlEntity,并且是“nosql”包的一部分,以及“Persistance.java”。
最初的问题:
DEBUG o.c.g.g.i.s.PathMatchingResourcePatternResolver
当我尝试“运行应用程序”或“测试应用程序”甚至“清理”时,我的 grails 应用程序会生成数百条语句。该应用程序从 Eclipse 运行,但测试不运行。
重要的细节是 - 我从本地 git 存储库中签出应用程序,原始应用程序在同一台机器上运行得非常好。
对评论的回应: 1. 测试根本没有运行。2. 我没有更改 log4j 设置中的任何内容。3.发布这个问题后,我运行了应用程序的原始副本(在不同的目录中),它产生了与第一个相同的垃圾。我虽然问题是 grails 将应用程序设置保存在 ~/.grails/2.2.1/projects/{myProjectName} 但即使应用程序的单个“版本位置”仍然存在。