Art*_*cis 9 java eclipse gwt spring
这是一个我已经坚持了好几个小时的问题,到现在为止我感到非常绝望.我将我们的应用程序从Spring 2.5/Hiberante 3.3迁移到Spring 3.0.5/Hibernate 3.6.完成以下工作:
在经过不同的小修复和调整后从Eclipse IDE启动时仍然存在的错误如下:
Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/tx]
Run Code Online (Sandbox Code Playgroud)
我查看了其他线程,并意识到当在类路径中找不到特定的lib(在本例中为spring-tx)时会出现这样的问题,但我在Maven依赖项中清楚地看到它.
我做的下一件事是,我为以前的版本构建了WAR,将它部署在Tomcat上,应用程序运行良好!
通过这个我可以得出Eclipse环境配置中缺少某些东西的结论.有趣的是,所有的抱怨都是关于spring-tx, - 当我使用tx命名空间删除单行时
<tx:annotation-driven transaction-manager="transactionManager" />
...应用程序启动正常而没有抱怨其他命名空间(当然,它没有正常工作,但至少没有抱怨期间初始).
关于我的IDE /项目设置的一些摘要:
正式的问题是:在迁移到Spring 3x后,从IDE启动项目会导致此类错误的可能原因是什么(并且作为构建的WAR可以正常部署)?
我不指望直接的答案(除非有人有完全相同的环境和问题),但指导方针,建议会有很大的帮助!
编辑 忘记提及在IDE启动应用程序期间,我有一堆这样的警告:
[WARN] Server class 'javax.persistence.EntityManagerFactory' could not be found in the web app, but was found on the system classpath
[WARN] Adding classpath entry 'file:/D:/maven/repository/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/1.0.0.Final/hibernate-jpa-2.0-api-1.0.0.Final.jar' to the web app classpath for this session
[WARN] Server class 'org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor' could not be found in the web app, but was found on the system classpath
[WARN] Adding classpath entry 'file:/D:/maven/repository/org/springframework/spring-orm/3.0.5.RELEASE/spring-orm-3.0.5.RELEASE.jar' to the web app classpath for this session
Run Code Online (Sandbox Code Playgroud)
..所以也许spring-tx也没有在web-app中找到(并且在系统类路径中找到),但它没有像其他人那样添加?这种行为的原因是什么?
target/${project.finalName}使用 Maven 进行开发时,您应该在调用mvn package或后从您的文件夹启动 DevMode mvn war:exploded(这会将您的依赖项复制到那里WEB-INF/lib)。
请参阅http://code.google.com/eclipse/docs/faq.html#gwt_with_maven和http://code.google.com/p/google-web-toolkit/issues/detail?id=6619