gpt4 book ai didi

java - 将Hibernate 4与Grails 3.2.4结合使用时,启动时会出现NullPointerException

转载 作者:行者123 更新时间:2023-12-02 14:10:21 25 4
gpt4 key购买 nike

我按照Grails 3.2 documentation中的说明从休眠5(默认设置)切换到了休眠4。但是,现在我的应用程序无法启动。我在启动时看到以下异常。

01/12/2017 11:52:55 PST ERROR main SpringApplication:839 - Application startup failed
java.lang.NullPointerException: null
at java.beans.Introspector.getPublicDeclaredMethods(Introspector.java:1337)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1197)
at java.beans.Introspector.getBeanInfo(Introspector.java:426)
at java.beans.Introspector.getBeanInfo(Introspector.java:173)
at java.beans.Introspector.getBeanInfo(Introspector.java:260)
at java.beans.Introspector.<init>(Introspector.java:407)
at java.beans.Introspector.getBeanInfo(Introspector.java:173)
at groovy.lang.MetaClassImpl$15.run(MetaClassImpl.java:3290)
at java.security.AccessController.doPrivileged(Native Method)
at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:3288)
at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3265)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:254)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:285)
at org.codehaus.groovy.runtime.callsite.ClassMetaClassGetPropertySite.<init>(ClassMetaClassGetPropertySite.java:38)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.createClassMetaClassGetPropertySite(AbstractCallSite.java:373)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.createGetPropertySite(AbstractCallSite.java:325)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.acceptGetProperty(AbstractCallSite.java:312)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296)
at org.grails.plugins.databasemigration.DatabaseMigrationGrailsPlugin.configureLiquibase(DatabaseMigrationGrailsPlugin.groovy:96)
at org.grails.plugins.databasemigration.DatabaseMigrationGrailsPlugin.doWithSpring(DatabaseMigrationGrailsPlugin.groovy:55)
at org.grails.plugins.DefaultGrailsPlugin.doWithRuntimeConfiguration(DefaultGrailsPlugin.java:555)
at org.grails.plugins.AbstractGrailsPluginManager.doRuntimeConfiguration(AbstractGrailsPluginManager.java:167)
at grails.boot.config.GrailsApplicationPostProcessor.postProcessBeanDefinitionRegistry(GrailsApplicationPostProcessor.groovy:171)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:118)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:686)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)

快速搜索似乎暗示此错误是由项目依赖项中的某些不匹配引起的。但是,Grails 3.2文档仅提到添加了休眠4依赖关系,而没有更改其他任何依赖关系。有谁知道这里发生了什么以及如何解决?

最佳答案

第一次刷新依赖项使用-

grails clean --refresh-dependencies

使用此命令生成依赖性报告-
grails dependency-report

确认应用程序正在使用hibernate 4依赖项。从其任何插件中找出是否正在使用hibernate 5依赖项。如果是这样,请从相应插件中将其排除在build.gradle文件中。

关于java - 将Hibernate 4与Grails 3.2.4结合使用时,启动时会出现NullPointerException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41602630/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com