gpt4 book ai didi

html - Groovy/Grails Hibernate 无法创建 bean 事务

转载 作者:行者123 更新时间:2023-11-28 22:10:38 25 4
gpt4 key购买 nike

这是我在使用我的 webapp 启动 tomcat 时遇到的错误。我确定它与 hibernate 插件有关。

我的 Web 应用程序在 12.04 LTS ubuntu 上运行,现在已升级到 18.04 LTS。我将 grails web-app 编译为 .war 并且没有重新编译 war。我认为它会继续从一个版本的 ubuntu 到另一个版本。

15-Jun-2018 12:22:32.580 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
15-Jun-2018 12:22:33.287 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
15-Jun-2018 12:22:38.637 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to get the default Bean Validation factory
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to get the default Bean Validation factory
... 5 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to get the default Bean Validation factory
... 5 more
Caused by: org.hibernate.HibernateException: Unable to get the default Bean Validation factory
... 5 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
... 5 more
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:111)
... 7 more
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
... 8 more

15-Jun-2018 12:22:38.647 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Closing Spring root WebApplicationContext
15-Jun-2018 12:22:38.955 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
15-Jun-2018 12:22:38.955 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
15-Jun-2018 12:22:38.956 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker@306acdc')

感谢任何帮助或提示!

最佳答案

关键是这一行 Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException

看来您在新版本的 Ubuntu 上运行此程序的 Java 运行时不同。 Java 9 是偶然的吗?如果是这样,您可能遇到此处描述的问题 How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException in Java 9

您可以按照该答案中所述解决问题,或者安装以前版本的 Java 并使用它来运行您的 Grails 应用程序

关于html - Groovy/Grails Hibernate 无法创建 bean 事务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50881048/

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