简体   繁体   English

Spring Data gemfire-不止一个OnServer功能

[英]Spring Data gemfire - More than one OnServer Function

Is it possible to register more than one @OnServer Function Interface? 是否可以注册多个@OnServer功能接口? When we enable more than one Function with @OnServer for Client side proxy, the server fails to start with below error. 当我们使用@OnServer为客户端代理启用多个功能时,服务器无法启动并显示以下错误。

Cannot resolve reference to bean 'org.springframework.data.gemfire.function.execution.GemfireOnServerFunctionTemplate#0' while setting constructor argument; 设置构造函数参数时,无法解析对bean'org.springframework.data.gemfire.function.execution.GemfireOnServerFunctionTemplate#0'的引用; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.data.gemfire.function.execution.GemfireOnServerFunctionTemplate#0': Cannot resolve reference to bean 'gemfireCache' while setting constructor argument; 嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名称为org.springframework.data.gemfire.function.execution.GemfireOnServerFunctionTemplate#0'的bean时出错:设置构造函数参数时无法解析对bean'gemfireCache'的引用; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gemfireCache': FactoryBean threw exception on object creation; 嵌套的异常是org.springframework.beans.factory.BeanCreationException:创建名称为'gemfireCache'的bean时出错:FactoryBean在对象创建时抛出了异常; nested exception is java.lang.IllegalStateException: A connection to a distributed system already exists in this VM. 嵌套异常为java.lang.IllegalStateException:此VM中已存在与分布式系统的连接。 It has the following configuration: 它具有以下配置:

The gemfire functions are placed in a package and below is added to the appContext for component-scanning. gemfire函数放在程序包中,下面将其添加到appContext中以进行组件扫描。

<gfe-data:function-executions base-package="com.test.data.gemfire"/>

Is there a standard practice to register only 1 OnServer function (which sounds too restrictive)? 是否有仅注册1个OnServer函数的标准惯例(听起来太严格了)? Any pointers would be helpful. 任何指针都会有所帮助。

Is it possible to register more than one @OnServer Function Interface? 是否可以注册多个@OnServer功能接口?

Yes; 是; absolutely! 绝对!

When we enable more than one Function with @OnServer for Client side proxy, the server fails to start with below error. 当我们使用@OnServer为客户端代理启用多个功能时, 服务器无法启动并显示以下错误。

This a confused statement. 这是一个混乱的说法。 By server, I assume you mean the application, GemFire cache client JVM process. 对于服务器,我假设您的意思是应用程序GemFire缓存客户端JVM进程。 @OnServer annotations are only applicable on a client and cannot be used on a "GemFire Server" (as in a peer cache member of the distributed system). @OnServer批注仅适用于客户端,不能在“ GemFire服务器”上使用(如在分布式系统的对等缓存成员中)。

java.lang.IllegalStateException: A connection to a distributed system already exists in this VM. java.lang.IllegalStateException:此VM中已经存在与分布式系统的连接。 It has the following configuration: 它具有以下配置:

This is a very old problem (and Exception caused by SDG) indicating that you are using an older version (ie < 1.7.0.RELEASE). 这是一个非常老的问题(由SDG引起的异常),表明您使用的是旧版本(即<1.7.0.RELEASE)。

A similar problem was cited in SGF-414 when using SSL between the client and server, with an initial fix released in 1.6.2.RELEASE along with 1.7 RC1 . 在客户端和服务器之间使用SSL时,在SGF-414中引用了类似的问题,其初始修补程序在1.6.2.RELEASE1.7 RC1

Unfortunately, however, this did not solve the entire problem, so additional work was again performed for the SDG 1.8 RC1 release in SGF-416 as well as SGF-468 . 但是,不幸的是,这不能解决整个问题,因此再次对SGF-416SGF-468中的SDG 1.8 RC1版本进行了其他工作。

Needless to say, this was a very complicated problem caused by GemFire's Distributed System configuration validation checks and the ability to configure the ClientCache and Pool as separate beans (ie by the presence of both <gfe:client-cache> and <gfe:pool> elements in a XML config file) in a Spring context, where proper coordination is required. 不用说,这是一个非常复杂的问题,这是由GemFire的分布式系统配置验证检查以及将ClientCachePool配置为单独的bean(即同时存在<gfe:client-cache><gfe:pool>要求适当协调的Spring上下文中的XML配置文件中的元素)。

So my recommendation to you is, upgrade to the latest Spring Data GemFire release, which is 1.8.3.RELEASE . 因此,我建议您升级到最新的Spring Data GemFire版本,即1.8.3.RELEASE Also, the latest 1.7.5.RELEASE should work, though I am not entirely certain. 另外,虽然我1.7.5.RELEASE ,但最新的1.7.5.RELEASE应该有效。 You can an always find the latest information on Spring Data GemFire's project page . 您可以随时在Spring Data GemFire的 项目页面上找到最新信息。

If you have additional questions or need help, let me know. 如果您还有其他问题或需要帮助,请告诉我。

Thanks, John 谢谢,约翰

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM