【问题标题】:Get stagemonitor working with Grails 2.5?让 stagemonitor 与 Grails 2.5 一起工作?
【发布时间】:2015-08-10 03:58:05
【问题描述】:

我正在尝试让 www.stagemonitor.org 与 Grails 一起工作。

我在这里创建了一个示例项目:https://github.com/jbwiv/teststagemonitor

我已将 stagemonitor 添加到 grails-app/conf/BuildConfig.groovy 作为编译和运行时依赖项。在调用“grails refresh-dependencies”之后,它确实被安装到了我的 maven 目录中:

/home/user/.m2/repository/org/stagemonitor
/home/user/.m2/repository/org/stagemonitor/stagemonitor-requestmonitor
/home/user/.m2/repository/org/stagemonitor/stagemonitor-requestmonitor/0.13.0
/home/user/.m2/repository/org/stagemonitor/stagemonitor-requestmonitor/0.13.0/stagemonitor-requestmonitor-0.13.0.pom.sha1
/home/user/.m2/repository/org/stagemonitor/stagemonitor-requestmonitor/0.13.0/_remote.repositories
/home/user/.m2/repository/org/stagemonitor/stagemonitor-requestmonitor/0.13.0/stagemonitor-requestmonitor-0.13.0.jar
/home/user/.m2/repository/org/stagemonitor/stagemonitor-requestmonitor/0.13.0/stagemonitor-requestmonitor-0.13.0.pom
/home/user/.m2/repository/org/stagemonitor/stagemonitor-requestmonitor/0.13.0/stagemonitor-requestmonitor-0.13.0.jar.sha1
/home/user/.m2/repository/org/stagemonitor/stagemonitor-jvm
/home/user/.m2/repository/org/stagemonitor/stagemonitor-jvm/0.13.0
/home/user/.m2/repository/org/stagemonitor/stagemonitor-jvm/0.13.0/stagemonitor-jvm-0.13.0.pom.sha1
/home/user/.m2/repository/org/stagemonitor/stagemonitor-jvm/0.13.0/_remote.repositories
/home/user/.m2/repository/org/stagemonitor/stagemonitor-jvm/0.13.0/stagemonitor-jvm-0.13.0.jar
/home/user/.m2/repository/org/stagemonitor/stagemonitor-jvm/0.13.0/stagemonitor-jvm-0.13.0.jar.sha1
/home/user/.m2/repository/org/stagemonitor/stagemonitor-jvm/0.13.0/stagemonitor-jvm-0.13.0.pom
/home/user/.m2/repository/org/stagemonitor/stagemonitor-javaagent
/home/user/.m2/repository/org/stagemonitor/stagemonitor-javaagent/0.13.0
/home/user/.m2/repository/org/stagemonitor/stagemonitor-javaagent/0.13.0/stagemonitor-javaagent-0.13.0.pom
/home/user/.m2/repository/org/stagemonitor/stagemonitor-javaagent/0.13.0/_remote.repositories
/home/user/.m2/repository/org/stagemonitor/stagemonitor-javaagent/0.13.0/stagemonitor-javaagent-0.13.0.jar.sha1
/home/user/.m2/repository/org/stagemonitor/stagemonitor-javaagent/0.13.0/stagemonitor-javaagent-0.13.0.pom.sha1
/home/user/.m2/repository/org/stagemonitor/stagemonitor-javaagent/0.13.0/stagemonitor-javaagent-0.13.0.jar
/home/user/.m2/repository/org/stagemonitor/stagemonitor-web
/home/user/.m2/repository/org/stagemonitor/stagemonitor-web/0.13.0
/home/user/.m2/repository/org/stagemonitor/stagemonitor-web/0.13.0/stagemonitor-web-0.13.0.jar
/home/user/.m2/repository/org/stagemonitor/stagemonitor-web/0.13.0/_remote.repositories
/home/user/.m2/repository/org/stagemonitor/stagemonitor-web/0.13.0/stagemonitor-web-0.13.0.pom.sha1
/home/user/.m2/repository/org/stagemonitor/stagemonitor-web/0.13.0/stagemonitor-web-0.13.0.jar.sha1
/home/user/.m2/repository/org/stagemonitor/stagemonitor-web/0.13.0/stagemonitor-web-0.13.0.pom
/home/user/.m2/repository/org/stagemonitor/stagemonitor-os
/home/user/.m2/repository/org/stagemonitor/stagemonitor-os/0.13.0
/home/user/.m2/repository/org/stagemonitor/stagemonitor-os/0.13.0/stagemonitor-os-0.13.0.jar.sha1
/home/user/.m2/repository/org/stagemonitor/stagemonitor-os/0.13.0/_remote.repositories
/home/user/.m2/repository/org/stagemonitor/stagemonitor-os/0.13.0/stagemonitor-os-0.13.0.pom.sha1
/home/user/.m2/repository/org/stagemonitor/stagemonitor-os/0.13.0/stagemonitor-os-0.13.0.pom
/home/user/.m2/repository/org/stagemonitor/stagemonitor-os/0.13.0/stagemonitor-os-0.13.0.jar
/home/user/.m2/repository/org/stagemonitor/stagemonitor-jdbc
/home/user/.m2/repository/org/stagemonitor/stagemonitor-jdbc/0.13.0
/home/user/.m2/repository/org/stagemonitor/stagemonitor-jdbc/0.13.0/_remote.repositories
/home/user/.m2/repository/org/stagemonitor/stagemonitor-jdbc/0.13.0/stagemonitor-jdbc-0.13.0.pom.sha1
/home/user/.m2/repository/org/stagemonitor/stagemonitor-jdbc/0.13.0/stagemonitor-jdbc-0.13.0.jar.sha1
/home/user/.m2/repository/org/stagemonitor/stagemonitor-jdbc/0.13.0/stagemonitor-jdbc-0.13.0.pom
/home/user/.m2/repository/org/stagemonitor/stagemonitor-jdbc/0.13.0/stagemonitor-jdbc-0.13.0.jar
/home/user/.m2/repository/org/stagemonitor/stagemonitor-core
/home/user/.m2/repository/org/stagemonitor/stagemonitor-core/0.13.0
/home/user/.m2/repository/org/stagemonitor/stagemonitor-core/0.13.0/_remote.repositories
/home/user/.m2/repository/org/stagemonitor/stagemonitor-core/0.13.0/stagemonitor-core-0.13.0.pom.sha1
/home/user/.m2/repository/org/stagemonitor/stagemonitor-core/0.13.0/stagemonitor-core-0.13.0.jar
/home/user/.m2/repository/org/stagemonitor/stagemonitor-core/0.13.0/stagemonitor-core-0.13.0.pom
/home/user/.m2/repository/org/stagemonitor/stagemonitor-core/0.13.0/stagemonitor-core-0.13.0.jar.sha1

我还在 src/java 中放置了一个 stagemonitor.properties 文件,该文件在运行时会移动到 target/work/resources/stagemonitor.properties。我相信我已经正确配置了该属性文件。

我已经安装了 Grails 用于 web.xml 的模板,并进行了修改以确保生成的 web.xml 中不存在 metadata-complete=true。

但是,在 grails run-app 并导航到 http://localhost:8080/main/index 之后,我按预期获得了我的索引页面,但没有可单击的 stagemonitor 图标,并且似乎没有包含 stagemonitor 资产。

【问题讨论】:

    标签: grails


    【解决方案1】:

    它似乎与 Grails 不兼容。如果您启用日志记录

    log4j.main = {
       error 'org.codehaus.groovy.grails',
             'org.springframework',
             'org.hibernate',
             'net.sf.ehcache.hibernate'
       info 'org.stagemonitor'
    }
    

    您会看到一堆错误堆栈跟踪,似乎暗示他们使用 Javassist 连接跟踪代码的方式与 Groovy 和/或 Grails 使用的 AST 转换不兼容:

    org.stagemonitor.javassist.NotFoundException: stagemonitortest.PersonController$setErrors
    ...
    org.stagemonitor.javassist.NotFoundException: stagemonitortest.PersonController$getParams$0
    ...
    org.stagemonitor.javassist.NotFoundException: stagemonitortest.Person$count
    ...
    org.stagemonitor.javassist.NotFoundException: stagemonitortest.Person$list$0
    ...
    org.stagemonitor.javassist.NotFoundException: stagemonitortest.PersonController$respond$1
    

    【讨论】:

      猜你喜欢
      • 2012-06-26
      • 2016-04-06
      • 1970-01-01
      • 1970-01-01
      • 2016-12-13
      • 2016-10-06
      • 2011-11-30
      • 2014-02-19
      • 2011-09-03
      相关资源
      最近更新 更多