gpt4 book ai didi

grails - 每次更改代码后,Grails 2.3.5需要 “grails clean”

转载 作者:行者123 更新时间:2023-12-02 14:58:30 24 4
gpt4 key购买 nike

每次修改代码时,都必须先运行grails clean,然后再运行grails run-app。如果不这样做,我会收到如下消息:

| Error 2014-02-13 16:33:16,774 [localhost-startStop-1] ERROR context.GrailsContextLoader  - Error initializing the application: 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': Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': Cannot resolve reference to bean 'dataSourceUnproxied' while setting bean property 'targetDataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceUnproxied': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [oracle.jdbc.OracleDriver]
Message: 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': Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': Cannot resolve reference to bean 'dataSourceUnproxied' while setting bean property 'targetDataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourceUnproxied': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [oracle.jdbc.OracleDriver]
Line | Method
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 744 | run in java.lang.Thread

这真的很奇怪,因为Grails似乎无法加载Oracle数据库驱动程序...但是如果我运行它可以很好地加载
grails clean
grails run-app

我正在使用的该应用今天已从Grails 2.2.4升级。升级似乎还不够(直到此)。我所要做的就是更改休眠和tomcat版本,然后运行 grails upgrade; grails clean
关于如何获取它的任何想法,以便我可以修改代码并使用 grails run-app或更佳的代码重新启动...使重新加载功能起作用,因此,在我进行代码修改时,它会自动编译刚刚保存的文件(这在Grails中非常有用2.2.4)。

最佳答案

您尝试过grails -reloading run-app吗?

由于您已经提到过您仅在升级过程中更改了插件版本,因此我想您没有使用默认启用重新加载的 fork 模式。

看看Forked Execution and the Reloading Agent。另请注意,在2.3。*中不推荐使用grails upgrade命令。

关于grails - 每次更改代码后,Grails 2.3.5需要 “grails clean”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21768670/

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