Closed ondrej-li closed 11 years ago
Yeah there are some issues getting it working on Grails 2.0+. Am looking at them now.
I think this is fixed now - I can run the plugin on grails 2.2.x without seeing this error. Please try 0.2 and let me know if you are still having issues.
I have awaited this with more passion than the birth of my first child. Gonna install the plugin now...
Bummer.
context.GrailsContextLoader Error initializing the application: Cannot get property 'beanDefinition' on null object java.lang.NullPointerException: Cannot get property 'beanDefinition' on null object at ProfilerGrailsPlugin$_closure1.doCall(ProfilerGrailsPlugin.groovy:85) at grails.spring.BeanBuilder.invokeBeanDefiningClosure(BeanBuilder.java:757) at grails.spring.BeanBuilder.beans(BeanBuilder.java:584) at grails.spring.BeanBuilder.invokeMethod(BeanBuilder.java:527) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:680)
Oh well.
Grr, ok you need a later version of the profiler plugin than has been released - I forgot that I had done that locally. If you grab the source from https://github.com/pledbrook/grails-profiler and install it with "grails maven-install", you should be able to use that with the miniprofiler. I'll hassle Peter to do an updated release of the profiler plugin and will update the documentation.
That didn't work (as literally described), but thanks for the tips. I tried a few things, improvised a little, experimented a little, but nothing worked. I'll just wait till this is ready.
OK. Sorry for the waste of your time. Can you give me your grails version and a stacktrace when using the version from github? Because I'm using the plugin in a grails 2.2 app here (with the unreleased profiler plugin) and it works for me (TM).
Oh wow. That's super fast response time. :+1:
Let me start from square one again and paste in what I get. I'm on Grails 2.2.2. Brb...
(One thing I didn't notice...I didn't have the maven plugin, so maven-install wasn't an option). The plot thickens....
Oh hell...I give up.
@michaelmorett ~/work/grails-profiler: grails maven-install | Script 'MavenInstall' not found, did you mean: 1) UninstallPlugin 2) InstallPlugin 3) InstallDependency 4) InstallTemplates 5) Init
Please make a selection or enter Q to quit: 2 | Environment set to development..... | Warning The install-plugin command is deprecated and may be removed from a future version of Grails. Plugin dependencies should be expressed in grails-app/conf/BuildConfig.groovy. See http://grails.org/doc/2.2.x/guide/conf.html#pluginDependencies. | Error You need to specify either the direct URL of the plugin or the name and version of a distributed Grails plugin found at http://plugins.grails.org For example: 'grails install-plugin spring-security-core 1.0' or 'grails install-plugin http://plugins.grails.org/grails-spring-security-core/trunk/grails-spring-security-core-1.0.zip @michaelmorett ~/work/grails-profiler: grails install-plugin maven-publisher | Environment set to development..... | Warning The install-plugin command is deprecated and may be removed from a future version of Grails. Plugin dependencies should be expressed in grails-app/conf/BuildConfig.groovy. See http://grails.org/doc/2.2.x/guide/conf.html#pluginDependencies. | Plugin installed. @michaelmorett ~/work/grails-profiler: grails maven-install | Compiling 22 source files. | Error Compilation error: startup failed: /Users/michaelmorett/work/grails-profiler/target/plugins/maven-publisher-0.8.1/src/groovy/grails/plugins/publish/DistributionManagementInfo.groovy: 3: Invalid duplicate class definition of class grails.plugins.publish.DistributionManagementInfo : The sources /Users/michaelmorett/work/grails-profiler/target/plugins/maven-publisher-0.8.1/src/groovy/grails/plugins/publish/DistributionManagementInfo.groovy and /Users/michaelmorett/work/grails-profiler/target/plugins/release-2.0.4/src/groovy/grails/plugins/publish/DistributionManagementInfo.groovy are containing both a class of the name grails.plugins.publish.DistributionManagementInfo. @ line 3, column 1. class DistributionManagementInfo { ^
/Users/michaelmorett/work/grails-profiler/target/plugins/maven-publisher-0.8.1/src/groovy/grails/plugins/publish/Repository.groovy: 7: Invalid duplicate class definition of class grails.plugins.publish.Repository : The sources /Users/michaelmorett/work/grails-profiler/target/plugins/maven-publisher-0.8.1/src/groovy/grails/plugins/publish/Repository.groovy and /Users/michaelmorett/work/grails-profiler/target/plugins/release-2.0.4/src/groovy/grails/plugins/publish/Repository.groovy are containing both a class of the name grails.plugins.publish.Repository. @ line 7, column 1. class Repository { ^
/Users/michaelmorett/work/grails-profiler/target/plugins/maven-publisher-0.8.1/src/groovy/grails/plugins/publish/maven/MavenDeployer.groovy: 9: Invalid duplicate class definition of class grails.plugins.publish.maven.MavenDeployer : The sources /Users/michaelmorett/work/grails-profiler/target/plugins/maven-publisher-0.8.1/src/groovy/grails/plugins/publish/maven/MavenDeployer.groovy and /Users/michaelmorett/work/grails-profiler/target/plugins/release-2.0.4/src/groovy/grails/plugins/publish/maven/MavenDeployer.groovy are containing both a class of the name grails.plugins.publish.maven.MavenDeployer. @ line 9, column 1. class MavenDeployer implements PluginDeployer { ^
/Users/michaelmorett/work/grails-profiler/target/plugins/maven-publisher-0.8.1/src/groovy/grails/plugins/publish/print/DryRunDeployer.groovy: 10: Invalid duplicate class definition of class grails.plugins.publish.print.DryRunDeployer : The sources /Users/michaelmorett/work/grails-profiler/target/plugins/maven-publisher-0.8.1/src/groovy/grails/plugins/publish/print/DryRunDeployer.groovy and /Users/michaelmorett/work/grails-profiler/target/plugins/release-2.0.4/src/groovy/grails/plugins/publish/print/DryRunDeployer.groovy are containing both a class of the name grails.plugins.publish.print.DryRunDeployer. @ line 10, column 1. class DryRunDeployer implements PluginDeployer { ^
/Users/michaelmorett/work/grails-profiler/target/plugins/maven-publisher-0.8.1/src/groovy/grails/plugins/publish/svn/MasterPluginList.groovy: 11: Invalid duplicate class definition of class grails.plugins.publish.svn.MasterPluginList : The sources /Users/michaelmorett/work/grails-profiler/target/plugins/maven-publisher-0.8.1/src/groovy/grails/plugins/publish/svn/MasterPluginList.groovy and /Users/michaelmorett/work/grails-profiler/target/plugins/release-2.0.4/src/groovy/grails/plugins/publish/svn/MasterPluginList.groovy are containing both a class of the name grails.plugins.publish.svn.MasterPluginList. @ line 11, column 1. class MasterPluginList { ^
/Users/michaelmorett/work/grails-profiler/target/plugins/maven-publisher-0.8.1/src/groovy/grails/plugins/publish/svn/SvnDeployer.groovy: 18: Invalid duplicate class definition of class grails.plugins.publish.svn.SvnDeployer : The sources /Users/michaelmorett/work/grails-profiler/target/plugins/maven-publisher-0.8.1/src/groovy/grails/plugins/publish/svn/SvnDeployer.groovy and /Users/michaelmorett/work/grails-profiler/target/plugins/release-2.0.4/src/groovy/grails/plugins/publish/svn/SvnDeployer.groovy are containing both a class of the name grails.plugins.publish.svn.SvnDeployer. @ line 18, column 1. class SvnDeployer implements PluginDeployer { ^
6 errors @michaelmorett ~/work/grails-profiler:
Oh weird, I could have sworn that the profiler plugin had the release plugin installed in it. Sorry to lead you up the garden path!
So what you actually need to do (and I just tested it myself on a grails 2.2.4 app) is run grails package-plugin
in the grails-profiler source directory, then run grails install-plugin /the/path/to/grails-profiler/grails-profiler-0.4.1.zip
.
I'll have to submit a pull request to get the profiler plugin using the release plugin (which is the plugin with the maven-install command). Looks like the profiler really hasn't been maintained for a while.
"Oh weird, I could have sworn that the profiler plugin had the release plugin installed in it."
At this point, I'm calling the police. lol.
Let me try your latest tips...
:-)
Here are the results of attempting the latest tips. At this point, I'm moving to Ruby on Rails. :-)
@michaelmorett ~/work/grails-profiler: grails package-plugin | Plugin packaged grails-profiler-0.4.1.zip @michaelmorett ~/work/grails-profiler: grails install-plugin /the/path/to/grails-profiler/grails-profiler-0.4.1.zip | Environment set to development..... | Warning The install-plugin command is deprecated and may be removed from a future version of Grails. Plugin dependencies should be expressed in grails-app/conf/BuildConfig.groovy. See http://grails.org/doc/2.2.x/guide/conf.html#pluginDependencies. | Resolving plugin /the/path/to/grails-profiler/grails-profiler-0.4.1.zip. Please wait... :: problems summary :: :::: WARNINGS module not found: org.grails.plugins#/the/path/to/grails-profiler/grails-profiler-0.4.1.zip;latest.integration ==== grailsPlugins: tried -- artifact org.grails.plugins#/the/path/to/grails-profiler/grails-profiler-0.4.1.zip;latest.integration!/the/path/to/grails-profiler/grails-profiler-0.4.1.zip.zip: /Users/michaelmorett/work/grails-profiler/lib//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].zip /Users/michaelmorett/work/grails-profiler/target/plugins/hibernate-2.2.2/lib//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].zip /Users/michaelmorett/work/grails-profiler/target/plugins/release-2.0.4/lib//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].zip /Users/michaelmorett/work/grails-profiler/target/plugins/rest-client-builder-1.0.2/lib//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].zip /Users/michaelmorett/work/grails-profiler/target/plugins/tomcat-2.2.2/lib//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].zip /Users/michaelmorett/work/grails-profiler/target/plugins/webxml-1.4.1/lib//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].zip ==== grailsHome: tried /Users/michaelmorett/grails-2.2.2/lib/org.grails.plugins//the/path/to/grails-profiler/grails-profiler-0.4.1.zip/ivy-[revision].xml -- artifact org.grails.plugins#/the/path/to/grails-profiler/grails-profiler-0.4.1.zip;latest.integration!/the/path/to/grails-profiler/grails-profiler-0.4.1.zip.zip: /Users/michaelmorett/grails-2.2.2/lib/org.grails.plugins//the/path/to/grails-profiler/grails-profiler-0.4.1.zip/jars//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].zip /Users/michaelmorett/grails-2.2.2/lib/org.grails.plugins//the/path/to/grails-profiler/grails-profiler-0.4.1.zip/bundles//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].zip ==== grailsHome: tried /Users/michaelmorett/grails-2.2.2/src/libs//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].xml -- artifact org.grails.plugins#/the/path/to/grails-profiler/grails-profiler-0.4.1.zip;latest.integration!/the/path/to/grails-profiler/grails-profiler-0.4.1.zip.zip: /Users/michaelmorett/grails-2.2.2/src/libs//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].zip ==== grailsHome: tried /Users/michaelmorett/grails-2.2.2/dist//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].xml -- artifact org.grails.plugins#/the/path/to/grails-profiler/grails-profiler-0.4.1.zip;latest.integration!/the/path/to/grails-profiler/grails-profiler-0.4.1.zip.zip: /Users/michaelmorett/grails-2.2.2/dist//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].zip ==== grailsHome: tried /Users/michaelmorett/.grails/2.2.2/cached-installed-plugins//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].xml -- artifact org.grails.plugins#/the/path/to/grails-profiler/grails-profiler-0.4.1.zip;latest.integration!/the/path/to/grails-profiler/grails-profiler-0.4.1.zip.zip: /Users/michaelmorett/.grails/2.2.2/cached-installed-plugins//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].zip ==== grailsHome: tried /Users/michaelmorett/grails-2.2.2/plugins//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].pom -- artifact org.grails.plugins#/the/path/to/grails-profiler/grails-profiler-0.4.1.zip;latest.integration!/the/path/to/grails-profiler/grails-profiler-0.4.1.zip.zip: /Users/michaelmorett/grails-2.2.2/plugins//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].zip ==== grailsCentral: tried http://grails.org/plugins/grails-/the/path/to/grails-profiler/grails-profiler-0.4.1.zip/tags/LATEST_RELEASE//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].pom -- artifact org.grails.plugins#/the/path/to/grails-profiler/grails-profiler-0.4.1.zip;latest.integration!/the/path/to/grails-profiler/grails-profiler-0.4.1.zip.zip: http://grails.org/plugins/grails-/the/path/to/grails-profiler/grails-profiler-0.4.1.zip/tags/LATEST_RELEASE/grails-/the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].zip ==== mavenCentral: tried http://repo1.maven.org/maven2/org/grails/plugins//the/path/to/grails-profiler/grails-profiler-0.4.1.zip/latest.integration//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-latest.integration.pom http://repo1.maven.org/maven2/org/grails/plugins//the/path/to/grails-profiler/grails-profiler-0.4.1.zip/[revision]//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].pom -- artifact org.grails.plugins#/the/path/to/grails-profiler/grails-profiler-0.4.1.zip;latest.integration!/the/path/to/grails-profiler/grails-profiler-0.4.1.zip.zip: http://repo1.maven.org/maven2/org/grails/plugins//the/path/to/grails-profiler/grails-profiler-0.4.1.zip/latest.integration//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-latest.integration.zip http://repo1.maven.org/maven2/org/grails/plugins//the/path/to/grails-profiler/grails-profiler-0.4.1.zip/[revision]//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].zip ==== localMavenResolver: tried /Users/michaelmorett/.m2/repository/org/grails/plugins//the/path/to/grails-profiler/grails-profiler-0.4.1.zip/[revision]//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].pom -- artifact org.grails.plugins#/the/path/to/grails-profiler/grails-profiler-0.4.1.zip;latest.integration!/the/path/to/grails-profiler/grails-profiler-0.4.1.zip.zip: /Users/michaelmorett/.m2/repository/org/grails/plugins//the/path/to/grails-profiler/grails-profiler-0.4.1.zip/[revision]//the/path/to/grails-profiler/grails-profiler-0.4.1.zip-[revision].zip |
---|
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.grails.plugins#/the/path/to/grails-profiler/grails-profiler-0.4.1.zip;latest.integration: not found
::::::::::::::::::::::::::::::::::::::::::::::
| Error resolving plugin [name:/the/path/to/grails-profiler/grails-profiler-0.4.1.zip, group:org.grails.plugins, version:latest.integration]. Plugin not found. | Error Plugin not found for name [/the/path/to/grails-profiler/grails-profiler-0.4.1.zip] and version [not specified] @michaelmorett ~/work/grails-profiler:
The profiler plugin is not the only one that I have submitted changes for that haven't been released yet - I'm also waiting on changes in the fixtures plugin to get published, and it does use the release plugin. So I had misremembered installing the profiler plugin that way when it was the fixtures plugin.
Obviously what I need is some automated tests to flesh all of this out, but a) that'll be particularly difficult to do until the profiler plugin is released, and b) I have some major work that I want to do to split the non-grails-specific code out into a pure java library and just leave the grails stuff in the plugin, so I'll get better test coverage when testing that refactoring.
You'll need to replace /the/path/to/grails-profiler/grails-profiler-0.4.1.zip with the actual relative or absolute path to that file. I'm afraid I don't know where on your file system you've put it. :) In my case it was ../grails-profiler/grails-profiler-0.4.1.zip
LOL!!! Now that is funny. Clearly, you can tell I'm exhausted. I should have caught that. This thread will guarantee I'll never be employed again.
Well Tom, I think it's best to just wait till we can add two lines to BuildConfig.groovy. I appreciate your suggestions and while I really do want to use this plugin, you're busy, I'm busy, and it just needs some attention to packaging for consumption.
I enjoyed the experience. The whole "/the/path/to/grails-profiler" thing was so funny that I'm still laughing. After watching someone (maybe you) giving a presentation on how to use the plugin, I really want to get my hands on it. It just needs to mature a little bit.
@michaelmorett ~/work/grails-profiler: grails install-plugin ~/work/grails-profiler/grails-profiler-0.4.1.zip | Environment set to development..... | Warning The install-plugin command is deprecated and may be removed from a future version of Grails. Plugin dependencies should be expressed in grails-app/conf/BuildConfig.groovy. See http://grails.org/doc/2.2.x/guide/conf.html#pluginDependencies. | Plugin 'profiler' with version '0.4.1' is already installed | Resolving plugin JAR dependencies :: problems summary :: :::: WARNINGS module not found: org.codehaus.groovy#groovy;[1.5,1.7] ==== grailsHome: tried /Users/michaelmorett/grails-2.2.2/lib/org.codehaus.groovy/groovy/ivy-[revision].xml -- artifact org.codehaus.groovy#groovy;[1.5,1.7]!groovy.jar: /Users/michaelmorett/grails-2.2.2/lib/org.codehaus.groovy/groovy/jars/groovy-[revision].jar /Users/michaelmorett/grails-2.2.2/lib/org.codehaus.groovy/groovy/bundles/groovy-[revision].jar ==== grailsHome: tried /Users/michaelmorett/grails-2.2.2/src/libs/groovy-[revision].xml -- artifact org.codehaus.groovy#groovy;[1.5,1.7]!groovy.jar: /Users/michaelmorett/grails-2.2.2/src/libs/groovy-[revision].jar ==== grailsHome: tried /Users/michaelmorett/grails-2.2.2/dist/groovy-[revision].xml -- artifact org.codehaus.groovy#groovy;[1.5,1.7]!groovy.jar: /Users/michaelmorett/grails-2.2.2/dist/groovy-[revision].jar ==== grailsHome: tried /Users/michaelmorett/.grails/2.2.2/cached-installed-plugins/groovy-[revision].xml -- artifact org.codehaus.groovy#groovy;[1.5,1.7]!groovy.jar: /Users/michaelmorett/.grails/2.2.2/cached-installed-plugins/groovy-[revision].jar ==== grailsHome: tried /Users/michaelmorett/grails-2.2.2/plugins/groovy-[revision].pom -- artifact org.codehaus.groovy#groovy;[1.5,1.7]!groovy.jar: /Users/michaelmorett/grails-2.2.2/plugins/groovy-[revision].jar ==== profiler plugin install resolver: tried -- artifact org.codehaus.groovy#groovy;[1.5,1.7]!groovy.jar: /Users/michaelmorett/work/grails-profiler/groovy-[revision].jar /Users/michaelmorett/work/grails-profiler/grails-groovy-[revision].jar |
---|
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.codehaus.groovy#groovy;[1.5,1.7]: not found
::::::::::::::::::::::::::::::::::::::::::::::
| Error Failed to install plugin [profiler-0.4.1]. Plugin has missing JAR dependencies. | Resolving plugin JAR dependencies. @michaelmorett ~/work/grails-profiler:
The install-plugin command installs a plugin into the current application, so it should be run in the directory that your app is in, not the directory with the plugin source. That's why the relative path is needed.
It's a bit different to running maven-install, which (when the release plugin is being used) installs a plugin into your local maven cache, and then grails pulls it from there.
Anyway, hopefully the profiler plugin will get published soon and all this will be a distant memory. :)
Huh, the plot thickens. The profiler plugin does have the release plugin installed, it just has it in application.properties rather than where I was looking in BuildConfig.groovy.
The reason that the maven-install command didn't work was that it hadn't installed that plugin yet. This is one serious weak-point of grails.
Anyway, if you do want to do a maven-install of the plugin (which is the better way to do it), go to the grails-profiler source dir, make sure you're using grails 2.0.4 (mine whinges otherwise) and then run:
grails --refresh-dependencies compile
before running:
grails maven-install
...if you're still there :)
I'll give this a try tomorrow. Thanks for all the workaround advice. It will help others as well. I'll dig in and report back my progress.
OK, so Peter Ledbrook has published an updated version now. :) So forget all of that and just try using version 0.5-SNAPSHOT of the profiler plugin. If it's working for you, I'll let him know he can publish it as version 0.5.
That worked perfectly, Tom. Not a single problem. Thanks a bunch.
This is what I used:
runtime ':profiler:0.5-SNAPSHOT'
runtime ':miniprofiler:0.2'
Hi there, I'm getting the following exception when trying the build the plugin.
I could get rid of the exception but then it appears not updating the web.xml file at all (and consequently failing on Spring injections).
Would be nice if you could have a look at this.
Ondrej