DispatcherServlet - Roo 项目中的上下文初始化失败

发布于 2024-11-26 17:21:23 字数 2159 浏览 6 评论 0原文

我开发了一个 Roo 项目并部署到 Tomcat 6 服务器。 到目前为止,一切都运行良好。

我删除并重新添加了一个实体。

现在,每次启动 Tomcat 时,Spring Tool Suite 中都会出现此异常:

SEVERE: StandardWrapper.Throwable
Throwable occurred: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.MappedInterceptor#0': Cannot create inner bean '(inner bean)' of type [org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'applicationConversionService' while setting constructor argument; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [myproject.web.ApplicationConversionServiceFactoryBean] for bean with name 'applicationConversionService' defined in ServletContext resource [/WEB-INF/spring/webmvc-config.xml]; nested exception is java.lang.ClassNotFoundException: myproject.web.ApplicationConversionServiceFactoryBean
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [myproject.web.ApplicationConversionServiceFactoryBean] for bean with name 'applicationConversionService' defined in ServletContext resource [/WEB-INF/spring/webmvc-config.xml]; nested exception is java.lang.ClassNotFoundException: myproject.web.ApplicationConversionServiceFactoryBean
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
...

我需要做什么才能使其再次工作?

I develop a Roo project and deploy to a Tomcat 6 server.
Up until now everything was working fine.

I deleted and re-added an entity.

Now everytime when I start Tomcat I get this exception in the Spring Tool Suite:

SEVERE: StandardWrapper.Throwable
Throwable occurred: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.handler.MappedInterceptor#0': Cannot create inner bean '(inner bean)' of type [org.springframework.web.servlet.handler.ConversionServiceExposingInterceptor] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'applicationConversionService' while setting constructor argument; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [myproject.web.ApplicationConversionServiceFactoryBean] for bean with name 'applicationConversionService' defined in ServletContext resource [/WEB-INF/spring/webmvc-config.xml]; nested exception is java.lang.ClassNotFoundException: myproject.web.ApplicationConversionServiceFactoryBean
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [myproject.web.ApplicationConversionServiceFactoryBean] for bean with name 'applicationConversionService' defined in ServletContext resource [/WEB-INF/spring/webmvc-config.xml]; nested exception is java.lang.ClassNotFoundException: myproject.web.ApplicationConversionServiceFactoryBean
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
...

What do I need to do to make it work again?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

南城追梦 2024-12-03 17:21:23

spring 抱怨一个 bean 不可用(可能是你说删除的那个)。

 exception is java.lang.ClassNotFoundException: myproject.web.ApplicationConversionServiceFactoryBean

尝试搜索配置 xml 文件 &删除对此类的引用,之后事情应该会恢复,

spring is complainig about a bean not being available (probably the one you say you deleted).

 exception is java.lang.ClassNotFoundException: myproject.web.ApplicationConversionServiceFactoryBean

try to search the config xml files & remove the reference made to this class, things should be back after that,

橘香 2024-12-03 17:21:23

我有同样的问题。
问题是我禁用了“项目>自动构建”功能,因此我必须手动构建项目。
一旦我手动构建项目,一切就恢复正常了。 :)

因此,不要忘记在部署项目之前构建项目,或者只是重新启用“项目 > 自动构建”功能。

希望有帮助。

I had the same exact issue.
The problem was that I disabled the "Project > Build Automatically" feature, so I had to manually build the project.
Once I manually built the project everything went back to normal. :)

So, don't forget to build the project before deploying it, or just re-enable the "Project > Build Automatically" feature.

Hope it helps.

木緿 2024-12-03 17:21:23

部署到 Tomcat 的应用程序在 WEB-INF/lib 中没有包含 myproject.web.ApplicationConversionServiceFactoryBean 类的 jar 文件。我不知道那个类是什么,也不知道你在哪里可以找到它,但它丢失了。

Your app deployed to Tomcat doesn't have a jar file in WEB-INF/lib that contains the class myproject.web.ApplicationConversionServiceFactoryBean. I don't know what that class is or where you'd find it, but it's missing.

月亮坠入山谷 2024-12-03 17:21:23

我的解决方法(使用eclipse和roo 1.1.5作为eclipse插件)

  • 打开ApplicationConversionServiceFactoryBean.java类
  • 删除类注释@RooConversionService
  • 等待roo更新
  • 添加回类注释@RooConversionService
  • 等待roo更新并重试

my workaround (worked with eclipse and roo 1.1.5 as eclipse plugin)

  • open ApplicationConversionServiceFactoryBean.java class
  • delete class annotation @RooConversionService
  • wait for roo update
  • add back class annotation @RooConversionService
  • wait for roo update and try again
绝影如岚 2024-12-03 17:21:23

在STS里面,点击->project->clean
它清理并丢弃所有构建问题和构建状态,下次构建发生时,项目将从头开始重建。

Inside of STS, click ->project->clean
It clean and discard all build problems and built states, The next time a build occurs the projects will be rebuilt from scratch.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文