【问题标题】:Has anyone successfully created a project using Tapestry, Hibernate and Spring for jax-ws web services?有没有人成功地使用 Tapestry、Hibernate 和 Spring 为 jax-ws Web 服务创建了一个项目?
【发布时间】:2009-06-11 08:32:40
【问题描述】:

我有一个使用这些技术的项目,但遇到了很多问题。首先是这个错误:-

org.apache.tapestry5.ioc.internal.util.TapestryException:构造服务'ValueEncoderSource'的异常:调用服务构建器方法org.apache.tapestry5.services.TapestryModule.buildValueEncoderSource(Map,InvalidationEventHub)时出错(在TapestryModule.java :1910)(对于服务'ValueEncoderSource'):调用服务贡献方法org.apache.tapestry5.hibernate.HibernateModule.contributeValueEncoderSource(MappedConfiguration,boolean,HibernateSessionSource,Session,TypeCoercer,PropertyAccess,LoggerSource)时出错:构造服务'HibernateSessionSource'的异常:调用服务构建器方法 org.apache.tapestry5.hibernate.HibernateCoreModule.buildHibernateSessionSource(Logger, List, RegistryShutdownHub) 时出错(在 HibernateCoreModule.java:123)(对于服务“HibernateSessionSource”):org.hibernate.validator.event.ValidateEventListener 不能转换为 org.hibernate.event.PreInsertEventListener [在类路径:org/apache/tapestry5/corelib/components/ExceptionD isplay.tml,第 3 行]

这是使用最新的休眠注释(版本 3.4.0 GA)。在 Maven pom.xml 中,如果我将 org.hibernate 依赖项更改为:-

org.hibernate 休眠注释 3.2.1.ga

错误消失了,但我们失去了新版本注释中的错误修复。有谁知道解决这个问题的方法?

【问题讨论】:

    标签: hibernate spring jax-ws tapestry


    【解决方案1】:

    是的,我已经使用所有这些技术构建了一个 Web 应用程序。 不过,我不使用tapestry-hibernate 模块,只使用tapestry-spring,让Spring 处理所有数据库/休眠/事务的东西。

    您的问题,尤其是您为它描述的修复,听起来确实像是库兼容性问题。您使用的是哪个版本的 Tapestry?

    对于tapestry-hibernate的5.1版本,它说

    这个库是针对 Hibernate 3.3.1.GA 版本(和 版本 3.4.0.GA 的 休眠注释),但应该 使用更新的版本。

    在 Tapestry 网站上,所以你应该没问题。

    【讨论】:

      【解决方案2】:

      您是否有机会部署到带有自己的 Hibernate 库(例如 JBoss)的应用程序服务器?在这种情况下,您可能混合了不兼容的 Hibernate Core 和 Hibernate Annotations 版本。

      尝试删除应用服务器附带的 Hibernate JAR,看看是否可行。

      【讨论】:

        【解决方案3】:

        我使用过 spring、hibernate 和 CXF。 CXF 用于将我的接口服务转换为 Web 服务。比我看过的任何其他 Web 服务框架都更易于使用。

        【讨论】:

          猜你喜欢
          • 2023-03-09
          • 1970-01-01
          • 1970-01-01
          • 2013-01-13
          • 1970-01-01
          • 1970-01-01
          • 2010-10-16
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多