jgroups组播类强制转换异常

时间:2013-08-26 20:54:47

标签: udp ehcache jgroups

我正在尝试配置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)

1 个答案:

答案 0 :(得分:0)

没有试图回避这个问题的真正答案......(我在这里也不会想到答案)所以把它作为一个FYI。 坦率地说,我试图完全摆脱点对点复制......因为它具有竞争条件和并发异常的可能性+通常更复杂且难以实现......

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

设置非常简单,允许您无缝同步多个客户端缓存,并支持各种企业功能(即交易,高可用性等等)