我正在尝试将 Grails OSGi 插件安装到新的 Grails 2.0.3 应用程序中。
> grails create-app sandbox
| Created Grails Application at /home/pocon64/sandbox
> cd sandbox
> grails install-plugin osgi
| Plugin installed.
> grails run-war
| Loading Grails 2.0.3
| Error WARNING: Dependencies cannot be resolved for plugin [osgi] due to error: Cannot cast object '{}' with class 'groovy.util.ConfigObject' to class 'org.apache.ivy.plugins.resolver.ResolverSettings' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.apache.ivy.plugins.resolver.ResolverSettings(groovy.util.ConfigObject) (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '{}' with class 'groovy.util.ConfigObject' to class 'org.apache.ivy.plugins.resolver.ResolverSettings' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.apache.ivy.plugins.resolver.ResolverSettings(groovy.util.ConfigObject)
at dependencies$_run_closure1_closure4.doCall(dependencies.groovy:45)
at dependencies$_run_closure1_closure4.doCall(dependencies.groovy)
at java_util_concurrent_Callable$call.call(Unknown Source)
at java_util_concurrent_Callable$call.call(Unknown Source)
at dependencies$_run_closure1.doCall(dependencies.groovy:28)
at dependencies$_run_closure1.doCall(dependencies.groovy)
at grails.util.BuildSettings$_pluginDependencyHandler_closure11.doCall(BuildSettings.groovy:1278)
at grails.util.BuildSettings$_pluginDependencyHandler_closure11.call(BuildSettings.groovy)
at grails.util.BuildSettings.configureDependencyManager(BuildSettings.groovy:1219)
at grails.util.BuildSettings$configureDependencyManager.callCurrent(Unknown Source)
at grails.util.BuildSettings.postLoadConfig(BuildSettings.groovy:1102)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:999)
at grails.util.BuildSettings$loadConfig$0.callCurrent(Unknown Source)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:982)
at grails.util.BuildSettings$loadConfig.callCurrent(Unknown Source)
at grails.util.BuildSettings.loadConfig(BuildSettings.groovy:959)
| Error WARNING: Dependencies cannot be resolved for plugin [osgi] due to error: Cannot cast object '{}' with class 'groovy.util.ConfigObject' to class 'org.apache.ivy.plugins.resolver.ResolverSettings' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.apache.ivy.plugins.resolver.ResolverSettings(groovy.util.ConfigObject)
| Compiling 42 source files.
| Error Compilation error: startup failed:
Compile error during compilation with javac.
/home/pocon64/.grails/2.0.3/projects/sandbox/plugins/osgi-0.2.1/src/java/org/codehaus/groovy/grails/commons/spring/GrailsOsgiWebApplicationContext.java:3: package org.osgi.framework does not exist
import org.osgi.framework.Bundle;
^
/home/pocon64/.grails/2.0.3/projects/sandbox/plugins/osgi-0.2.1/src/java/org/codehaus/groovy/grails/commons/spring/GrailsOsgiWebApplicationContext.java:4: package org.osgi.framework does not exist
import org.osgi.framework.BundleContext;
^
/home/pocon64/.grails/2.0.3/projects/sandbox/plugins/osgi-0.2.1/src/java/org/codehaus/groovy/grails/commons/spring/GrailsOsgiWebApplicationContext.java:8: package org.springframework.osgi.context does not exist
import org.springframework.osgi.context.ConfigurableOsgiBundleApplicationContext;
^
/home/pocon64/.grails/2.0.3/projects/sandbox/plugins/osgi-0.2.1/src/java/org/codehaus/groovy/grails/commons/spring/GrailsOsgiWebApplicationContext.java:11: cannot find symbol
symbol: class ConfigurableOsgiBundleApplicationContext
GrailsWebApplicationContext implements ConfigurableOsgiBundleApplicationContext {
^
/home/pocon64/.grails/2.0.3/projects/sandbox/plugins/osgi-0.2.1/src/java/org/codehaus/groovy/grails/commons/spring/GrailsOsgiWebApplicationContext.java:13: cannot find symbol
symbol : class BundleContext
location: class org.codehaus.groovy.grails.commons.spring.GrailsOsgiWebApplicationContext
private BundleContext bundleContext = null;
^
/home/pocon64/.grails/2.0.3/projects/sandbox/plugins/osgi-0.2.1/src/java/org/codehaus/groovy/grails/commons/spring/GrailsOsgiWebApplicationContext.java:54: cannot find symbol
symbol : class Bundle
location: class org.codehaus.groovy.grails.commons.spring.GrailsOsgiWebApplicationContext
public Bundle getBundle() {
^
/home/pocon64/.grails/2.0.3/projects/sandbox/plugins/osgi-0.2.1/src/java/org/codehaus/groovy/grails/commons/spring/GrailsOsgiWebApplicationContext.java:64: cannot find symbol
symbol : class BundleContext
location: class org.codehaus.groovy.grails.commons.spring.GrailsOsgiWebApplicationContext
public BundleContext getBundleContext() {
^
/home/pocon64/.grails/2.0.3/projects/sandbox/plugins/osgi-0.2.1/src/java/org/codehaus/groovy/grails/commons/spring/GrailsOsgiWebApplicationContext.java:71: cannot find symbol
symbol : class BundleContext
location: class org.codehaus.groovy.grails.commons.spring.GrailsOsgiWebApplicationContext
public void setBundleContext(BundleContext context) {
^
/home/pocon64/.grails/2.0.3/projects/sandbox/plugins/osgi-0.2.1/src/java/org/codehaus/groovy/grails/commons/spring/GrailsOsgiWebApplicationContext.java:42: cannot find symbol
symbol : class ConfigurableOsgiBundleApplicationContext
location: class org.codehaus.groovy.grails.commons.spring.GrailsOsgiWebApplicationContext
if (parent instanceof ConfigurableOsgiBundleApplicationContext) {
^
/home/pocon64/.grails/2.0.3/projects/sandbox/plugins/osgi-0.2.1/src/java/org/codehaus/groovy/grails/commons/spring/GrailsOsgiWebApplicationContext.java:43: cannot find symbol
symbol : class ConfigurableOsgiBundleApplicationContext
location: class org.codehaus.groovy.grails.commons.spring.GrailsOsgiWebApplicationContext
ConfigurableOsgiBundleApplicationContext osgiParent = (ConfigurableOsgiBundleApplicationContext) parent;
^
/home/pocon64/.grails/2.0.3/projects/sandbox/plugins/osgi-0.2.1/src/java/org/codehaus/groovy/grails/commons/spring/GrailsOsgiWebApplicationContext.java:43: cannot find symbol
symbol : class ConfigurableOsgiBundleApplicationContext
location: class org.codehaus.groovy.grails.commons.spring.GrailsOsgiWebApplicationContext
ConfigurableOsgiBundleApplicationContext osgiParent = (ConfigurableOsgiBundleApplicationContext) parent;
^
/home/pocon64/.grails/2.0.3/projects/sandbox/plugins/osgi-0.2.1/src/java/org/codehaus/groovy/grails/commons/spring/GrailsOsgiWebApplicationContext.java:44: cannot find symbol
symbol : class BundleContext
location: class org.codehaus.groovy.grails.commons.spring.GrailsOsgiWebApplicationContext
BundleContext context = osgiParent.getBundleContext();
^
12 errors
1 error
在我尝试建立战争之前,似乎一切都很好。我不明白缺少哪个依赖项,或者为什么?我可能遗漏了一些简单的东西,因为我对 Grails 很陌生,但我一生都无法弄清楚。