当战争文件部署到 Heroku 时,Grails 出错(工厂方法'requestMappingHandlerAdapter'抛出异常)



我需要你的帮助,他知道如何解决我在将战争文件部署到 Heroku 时遇到的这个问题。

如果有人可以帮助我解决这个问题,我会很高兴。

  • 圣杯 4
  • 爪哇 8
  • 格拉德尔 5.1.1

提前感谢您:),快乐编码

Configuring Spring Security Core ...
2019-11-28T07:23:12.993707+00:00 app[web.1]: ... finished configuring Spring Security Core
2019-11-28T07:23:12.993720+00:00 app[web.1]:
2019-11-28T07:23:13.112063+00:00 app[web.1]:
2019-11-28T07:23:13.112094+00:00 app[web.1]: Configuring Spring Security REST 3.0.0.RC1...
2019-11-28T07:23:13.169216+00:00 app[web.1]: ... finished configuring Spring Security REST
2019-11-28T07:23:13.169225+00:00 app[web.1]:
2019-11-28T07:23:13.170510+00:00 app[web.1]: ... with GORM support
2019-11-28T07:23:22.340522+00:00 app[web.1]: 2019-11-28 07:23:22.336 ERROR --- [ost-startStop-1] o.s.boot.SpringApplication               : Application run failed
2019-11-28T07:23:22.340542+00:00 app[web.1]:
2019-11-28T07:23:22.340547+00:00 app[web.1]: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerAdapter' defined in org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter]: Factory method 'requestMappingHandlerAdapter' threw exception; nested exception is java.lang.BootstrapMethodError: java.lang.IllegalAccessError: no such method: reactor.core.publisher.Mono.from(Publisher)Mono/invokeStatic
2019-11-28T07:23:22.340549+00:00 app[web.1]: at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627)
2019-11-28T07:23:22.340551+00:00 app[web.1]: at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:456)
2019-11-28T07:23:22.340554+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321)
2019-11-28T07:23:22.340557+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160)
2019-11-28T07:23:22.340560+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
2019-11-28T07:23:22.340562+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
2019-11-28T07:23:22.340564+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
2019-11-28T07:23:22.340566+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
2019-11-28T07:23:22.340569+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
2019-11-28T07:23:22.340570+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
2019-11-28T07:23:22.340572+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845)
2019-11-28T07:23:22.340573+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
2019-11-28T07:23:22.340575+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
2019-11-28T07:23:22.340577+00:00 app[web.1]: at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
2019-11-28T07:23:22.340578+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742)
2019-11-28T07:23:22.340580+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389)
2019-11-28T07:23:22.340581+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:311)
2019-11-28T07:23:22.340583+00:00 app[web.1]: at grails.boot.GrailsApp.run(GrailsApp.groovy:97)

我已经解决了这个问题,在 Heroku 上,他们有一个名为heroku-cli-deploy的插件,如果您部署战争文件,特别是如果这个战争文件由 grails 生成,请确保您为您的战争文件选择合适的webapp-runner版本。Grails war文件已经有tomcat,并确保tomcat版本与Herokuwebapp-runner匹配。就我而言,我选择了8.5.11.0网络应用运行器版本。

heroku war:deploy warfile.war --webapp-runner 8.5.11.0 -a herokuAppName

最新更新