1

我正在尝试配置 ehcache 多播以将其集群在两台服务器上。这就是我得到的..错误也有我用来连接的属性。我不确定我是否缺少任何属性。

net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProvider Failed to create JGroups Channel, replication will not function. 

**JGroups properties:
UDP(mcast_addr=239.255.248.74;mcast_port=9157;):PING:MERGE2:FD_SOCK:VERIFY_SUSPECT:pbcast.NAKACK:UNICAST:pbcast.STABLE:FRAG:pbcast.GMS**

java.lang.ClassCastException: org.jgroups.protocols.UDP
    at org.jgroups.stack.Configurator.createLayer(Configurator.java:434)
    at org.jgroups.stack.Configurator.createProtocols(Configurator.java:397)
    at org.jgroups.stack.Configurator.setupProtocolStack(Configurator.java:88)
    at org.jgroups.stack.Configurator.setupProtocolStack(Configurator.java:55)
    at org.jgroups.stack.ProtocolStack.setup(ProtocolStack.java:449)
    at org.jgroups.JChannel.init(JChannel.java:831)
    at org.jgroups.JChannel.<init>(JChannel.java:163)
    at org.jgroups.JChannel.<init>(JChannel.java:143)
    at net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProvider.init(JGroupsCacheManagerPeerProvider.java:133)
    at net.sf.ehcache.CacheManager.doInit(CacheManager.java:471)
    at net.sf.ehcache.CacheManager.init(CacheManager.java:392)
    at net.sf.ehcache.CacheManager.<init>(CacheManager.java:267)
    at com.loyalty.framework.cache.EhCacheUtil.startupDefaultCache(EhCacheUtil.java:82)
    at com.loyalty.framework.cache.EhCacheUtil.<clinit>(EhCacheUtil.java:37)
    at com.loyalty.ws.vppservice.util.SessionUtil.startupSessionCache(SessionUtil.java:53)
    at com.loyalty.ws.vppservice.util.SessionUtil.<clinit>(SessionUtil.java:33)
    at com.loyalty.ws.vppservice.delegate.AccountDelegate.doSignon(AccountDelegate.java:275)
    at com.loyalty.ws.vppservice.VppServiceProxy.doSignon(VppServiceProxy.java:275)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.invoke(WLSInstanceResolver.java:92)
    at weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.invoke(WLSInstanceResolver.java:74)
    at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:151)
    at com.sun.xml.ws.server.sei.EndpointMethodHandlerImpl.invoke(EndpointMethodHandlerImpl.java:268)
    at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:100)
    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:866)
    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:815)
    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:778)
    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:680)
    at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:403)
    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:539)
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:253)
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:141)
    at weblogic.wsee.jaxws.WLSServletAdapter.handle(WLSServletAdapter.java:172)
    at weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke.run(HttpServletAdapter.java:708)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
    at weblogic.wsee.util.ServerSecurityHelper.authenticatedInvoke(ServerSecurityHelper.java:103)
    at weblogic.wsee.jaxws.HttpServletAdapter$3.run(HttpServletAdapter.java:311)
    at weblogic.wsee.jaxws.HttpServletAdapter.post(HttpServletAdapter.java:336)
    at weblogic.wsee.jaxws.JAXWSServlet.doRequest(JAXWSServlet.java:99)
    at weblogic.servlet.http.AbstractAsyncServlet.service(AbstractAsyncServlet.java:99)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:821)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:185)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3732)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
4

1 回答 1

0

不想回避这个问题的真正答案......(我在这里不太能想到答案)所以把它当作一个仅供参考。坦率地说,我会尝试完全摆脱对等复制......因为它有可能出现竞争条件和并发异常+通常更复杂且难以实现......

如果你有这样做的自由,我会转向 ehcache 的分布式缓存版本,称为 BigmemoryMax - http://terracotta.org/products/bigmemorymax(不要被命名混淆......它仍然是 EhCache。 ..只是 ehcache 自然“连接”到的分布式进程),最多可免费用于 4 个客户端 + 4GB 内存存储。

它非常易于设置,允许您无缝同步众多客户端的缓存,并支持各种企业功能(即事务、高可用性等...)

于 2013-08-27T16:08:09.590 回答