简体   繁体   English

Grails 弹性搜索插件 SEVERE:意外转换呼叫站点 grails elasticsearch

[英]Grails Elastic Search Plugin SEVERE: Unexpected transforming call sites grails elasticsearch

I'm trying to install the elastic search plugin (elasticsearch:0.0.4.4) on my Grails project (grails version 2.4.4) and after adding the plugin dependency and running the app (grails run-app) I get some rather severe errors.我正在尝试在我的 Grails 项目(grails 版本 2.4.4)上安装弹性搜索插件(elasticsearch:0.0.4.4),在添加插件依赖项并运行应用程序(grails run-app)后,我遇到了一些相当严重的错误.

Stacktrace:堆栈跟踪:

Apr 02, 2015 9:44:08 AM org.springsource.loaded.agent.SpringLoadedPreProcessor preProcess
SEVERE: Unexpected problem transforming call sites
java.lang.IllegalStateException: Unexpected problem processing bytes for class
    at org.springsource.loaded.ConstantPoolChecker2.readConstantPool(ConstantPoolChecker2.java:196)
    at org.springsource.loaded.ConstantPoolChecker2.<init>(ConstantPoolChecker2.java:128)
    at org.springsource.loaded.ConstantPoolChecker2.getReferences(ConstantPoolChecker2.java:102)
    at org.springsource.loaded.MethodInvokerRewriter.rewrite(MethodInvokerRewriter.java:300)
    at org.springsource.loaded.MethodInvokerRewriter.rewriteUsingCache(MethodInvokerRewriter.java:156)
    at org.springsource.loaded.TypeRegistry.methodCallRewriteUseCacheIfAvailable(TypeRegistry.java:828)
    at org.springsource.loaded.agent.SpringLoadedPreProcessor.preProcess(SpringLoadedPreProcessor.java:321)
    at org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:102)
    at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
    at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:655)
    at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:765)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at org.codehaus.groovy.runtime.m12n.MetaInfExtensionModule.newModule(MetaInfExtensionModule.java:72)
    at org.codehaus.groovy.runtime.m12n.StandardPropertiesModuleFactory.newModule(StandardPropertiesModuleFactory.java:48)
    at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromProperties(ExtensionModuleScanner.java:76)
    at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerExtensionModuleFromProperties(MetaClassRegistryImpl.java:152)
    at org.codehaus.groovy.grails.commons.DefaultGrailsApplication.initialiseGroovyExtensionModules(DefaultGrailsApplication.java:710)
    at org.codehaus.groovy.grails.commons.DefaultGrailsApplication.initialise(DefaultGrailsApplication.java:684)
    at org.codehaus.groovy.grails.project.plugins.GrailsProjectPluginLoader$_loadPlugins_closure2.doCall(GrailsProjectPluginLoader.groovy:132)
    at org.codehaus.groovy.grails.project.plugins.GrailsProjectPluginLoader$_loadPlugins_closure2.call(GrailsProjectPluginLoader.groovy)
    at org.codehaus.groovy.grails.cli.api.BaseSettingsApi.profile(BaseSettingsApi.java:342)
    at org.codehaus.groovy.grails.project.plugins.GrailsProjectPluginLoader.loadPlugins(GrailsProjectPluginLoader.groovy:99)
    at org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean.afterPropertiesSet(GrailsPluginManagerFactoryBean.java:75)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1613)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1550)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:687)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:762)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
    at org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener.initWebApplicationContext(GrailsContextLoaderListener.java:71)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4992)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5490)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Entry: 39 15
    at org.springsource.loaded.ConstantPoolChecker2.processConstantPoolEntry(ConstantPoolChecker2.java:335)
    at org.springsource.loaded.ConstantPoolChecker2.readConstantPool(ConstantPoolChecker2.java:186)
    ... 58 more

this repeats many times.这重复了很多次。 more interesting:更有意思的:

| Error 2015-04-02 09:44:29,658 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener  - Error initializing the application: No datastore implementation specified
Message: No datastore implementation specified
    Line | Method
->>  135 | doCall                    in ElasticsearchGrailsPlugin$_closure1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    754 | invokeBeanDefiningClosure in grails.spring.BeanBuilder
|    584 | beans . . . . . . . . . . in     ''
|    527 | invokeMethod              in     ''
|    262 | run . . . . . . . . . . . in java.util.concurrent.FutureTask
|   1145 | runWorker                 in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^    745 | run                       in java.lang.Thread
| Error Forked Grails VM exited with error

Edit: I've tried some other things.编辑:我尝试了一些其他的东西。 I downloaded elasticsearch-1.5.0, created the environment variable ELASTIC_SEARCH_HOME, and added that to my path, this has removed the environment variable error that previously popped up when running grails package .我下载了elasticsearch-1.5.0,创建了环境变量ELASTIC_SEARCH_HOME,并将其添加到我的路径中,这已经消除了之前运行时弹出的环境变量错误grails package

I also added the default config (found at the bottom of this page) for elastic search to the bottom of my Config.groovy file.我还在 Config.groovy 文件的底部添加了用于弹性搜索的默认配置(位于本页底部)。 Also I added:我还补充说:

elasticsearch {
  datastoreImpl = "hibernateDatastore"
}

to the default configuration in my Config.groovy file.到我的 Config.groovy 文件中的默认配置。

So after a grails run-app I get several of the first stacktrace like before, but not the second.因此,在grails run-app之后,我得到了几个像以前一样的第一个堆栈跟踪,但不是第二个。 In addition my app does run and not functionalities appear to be broken.此外,我的应用程序确实运行并且功能似乎没有被破坏。

Edit 2:编辑 2:

Some extra information that might be of interests.一些可能感兴趣的额外信息。 I created a new grails app (grails 2.4.4), added the elasticsearch plugin dependency declaration (':elasticsearch:0.0.4.4') to the BuildConfig.groovy file, added the default configuration and datastoreImpl to my Config.groovy file, and did a grails run-app and I got the same stacktrace (the first one above) repeated several times, but the app still runs.我创建了一个新的 grails 应用程序(grails 2.4.4),将 elasticsearch 插件依赖声明(':elasticsearch:0.0.4.4')添加到 BuildConfig.groovy 文件,将默认配置和 datastoreImpl 添加到我的 Config.groovy 文件,和做了一个grails run-app ,我重复了几次相同的堆栈跟踪(上面的第一个),但该应用程序仍在运行。

I had a similar issue - to fix, I made sure that: 我有一个类似的问题 - 修复,我确保:

  • my domain object had 'static searchable = true' (will tweak later to fine tune) 我的域名对象有'static searchable = true'(稍后会调整微调)
  • Config.groovy has the 'elasticSearch.datastoreImpl' setting Config.groovy具有'elasticSearch.datastoreImpl'设置
  • use Grails 2.5.0 (which has the latest springloaded jar in it) 使用Grails 2.5.0(其中包含最新的springloaded jar)

grails clean; grails clean; grails run-app - no exceptions, app runs grails run-app - 没有例外,app运行

Basically, upgrade to grails 2.5.0 基本上,升级到grails 2.5.0

If you replace springloaded with the latest version in the wrapper directory it fixes the probelem. 如果用wrapper目录中的springloaded替换springloaded,它会修复probelem。 Had the same problem with elasticsearch 0.4.4 running on Grails 2.3.5 与Grails 2.3.5上运行的elasticsearch 0.4.4有同样的问题

I had a similar issue using IntelliJ, and the problem was the version of Java.我在使用 IntelliJ 时遇到了类似的问题,问题是 Java 的版本。

The new versions of IntelliJ use by default the Java11, but with old versions of Grails you need to use older java versions, like Java 7.新版本的 IntelliJ 默认使用 Java11,但对于 Grails 的旧版本,您需要使用旧版本 java,例如 Java 7。

Go to File> Project Structure> Project>SDK and choose Java 1.7 Go 到 File> Project Structure> Project>SDK 然后选择 Java 1.7

After this the problems looks to be fixed.在此之后,问题似乎已解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM