如果在* EMPTY * Infinispan缓存上执行并行流(分布式)计算,可能会出现错误?

时间:2018-11-13 02:47:49

标签: infinispan infinispan-9

我是Infinispan的新手,并且一直在玩它。我认为我发现了一个错误。如果缓存为 empty ,并且我们有两个正在运行的节点(并且这些节点实际上必须位于单独的虚拟机上-它不能只是2个jvm进程),然后是node#上的第二个进程1执行以下并行流操作:

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.IO; //For MemoryStream
using System.Web.Services; //For WebMethod attribute
using Bytescout.BarCode;
using System.Web.UI.HtmlControls;
using System.Drawing;
using System.Drawing.Imaging;
using System.Threading;
using System.Text;
using System.IO;
using AForge;
using AForge.Video;
using AForge.Video.DirectShow;
using ZXing;
using ZXing.Aztec;


namespace bikestop
{

    public partial class bookRide : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        // int i = 0;
        protected void Scan_Click(object sender, EventArgs e)
        {


            Rectangle rect = new Rectangle(0, 0, 2000, 1000);
            string filePath = AppDomain.CurrentDomain.BaseDirectory;
            string filePath2;
            filePath2 = @"" + filePath + "\\images\\qr code stuff\\fileName.png";


            //do stuff
            using (Bitmap bmp = new Bitmap(rect.Width, rect.Height, PixelFormat.Format32bppArgb))
            {
                using (Graphics g = Graphics.FromImage(bmp))
                {
                    g.CopyFromScreen(rect.Left, rect.Top, 0, 0, bmp.Size, CopyPixelOperation.SourceCopy);
                }
                if (System.IO.Directory.Exists(filePath2) == true)
                {
                    bmp.Save(filePath2, ImageFormat.Png);
                    bmp.Dispose();
                }
                else
                {
                    File.Delete(filePath2);
                    bmp.Save(filePath2, ImageFormat.Png);
                    bmp.Dispose();
                }

                try
                {
                    IBarcodeReader barcodeReader = new BarcodeReader();
                    var barcodeBitmap = (Bitmap)Bitmap.FromFile(filePath2);
                    var barcodeResult = barcodeReader.Decode(barcodeBitmap);
                    Output.Text = barcodeResult.Text;
                    Output.NavigateUrl = barcodeResult.Text;

                }
                catch
                {
                    Output.Text = "No barcode found";
                }
            }
        }
    }
}

您将收到以下错误(主要错误是我认为“无效的lambda反序列化”)。注意:如果缓存中填充了一些数据,则不会发生此错误。我试图(合理地努力)跟踪代码,但无法找出问题,尽管我怀疑这与反序列化某种空的收集器有关。...有人看到过或认为这很可能错误(相对于用户错误?在发布之前,我尝试了很多事情...。)。任何解决方法? (或者在实际的相关代码中可能是超级简单的“真实”修复程序?)

final List<String> max = c
  .entrySet()
  .parallelStream()
  .map(e ->  e.getKey().substring(0,1))
  .collect(() -> Collectors.toList());

(其他详细信息:嵌入式Infinispan 9.4.1;操作系统-> Win Server 2016; oracle jdk8; Windows机器在Google Compute上作为VM运行,但不是kubernetes; jgroups配置为使用TCPPing和硬编码的主机名)< / p>

此外,尽管我认为这无关紧要,但这是缓存的定义:

Exception in thread "main" org.infinispan.remoting.RemoteException: ISPN000217: Received exception from proteowizard-dev2-16cpu-43102(rack-id=qa-rack, machine-id=qa-machine1), see cause for remote stack trace
at org.infinispan.remoting.transport.ResponseCollectors.wrapRemoteException(ResponseCollectors.java:27)

at org.infinispan.remoting.transport.ValidSingleResponseCollector.withException(ValidSingleResponseCollector.java:37)

at org.infinispan.remoting.transport.ValidSingleResponseCollector.addResponse(ValidSingleResponseCollector.java:21)

at org.infinispan.remoting.transport.impl.SingleTargetRequest.receiveResponse(SingleTargetRequest.java:52)

at org.infinispan.remoting.transport.impl.SingleTargetRequest.onResponse(SingleTargetRequest.java:35)

at org.infinispan.remoting.transport.impl.RequestRepository.addResponse(RequestRepository.java:52)

at org.infinispan.remoting.transport.jgroups.JGroupsTransport.processResponse(JGroupsTransport.java:1372)

at org.infinispan.remoting.transport.jgroups.JGroupsTransport.processMessage(JGroupsTransport.java:1275)

at org.infinispan.remoting.transport.jgroups.JGroupsTransport.access$300(JGroupsTransport.java:126)

at org.infinispan.remoting.transport.jgroups.JGroupsTransport$ChannelCallbacks.up(JGroupsTransport.java:1420)

at org.jgroups.JChannel.up(JChannel.java:816)

at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:893)

at org.jgroups.protocols.FRAG3.up(FRAG3.java:171)

at org.jgroups.protocols.FlowControl.up(FlowControl.java:343)

at org.jgroups.protocols.pbcast.GMS.up(GMS.java:873)

at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:240)

at org.jgroups.protocols.UNICAST3.deliverMessage(UNICAST3.java:1003)

at org.jgroups.protocols.UNICAST3.handleDataReceived(UNICAST3.java:729)

at org.jgroups.protocols.UNICAST3.up(UNICAST3.java:384)

at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:600)

at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:130)

at org.jgroups.protocols.FD_ALL.up(FD_ALL.java:203)

at org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:253)

at org.jgroups.protocols.MERGE3.up(MERGE3.java:280)

at org.jgroups.protocols.Discovery.up(Discovery.java:269)

at org.jgroups.protocols.TP.passMessageUp(TP.java:1248)

at org.jgroups.util.SubmitToThreadPool$SingleMessageHandler.run(SubmitToThreadPool.java:87)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

Caused by: java.lang.IllegalStateException: Unexpected exception

at org.jboss.marshalling.reflect.JDKSpecific$SerMethods.callReadResolve(JDKSpecific.java:260)

at org.jboss.marshalling.reflect.SerializableClass.callReadResolve(SerializableClass.java:271)

at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1396)

at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272)

at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:205)

at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:41)

at org.infinispan.marshall.core.ExternalJBossMarshaller.objectFromObjectStream(ExternalJBossMarshaller.java:47)

at org.infinispan.marshall.core.GlobalMarshaller.readUnknown(GlobalMarshaller.java:873)

at org.infinispan.marshall.core.GlobalMarshaller.readNonNullableObject(GlobalMarshaller.java:697)

at org.infinispan.marshall.core.GlobalMarshaller.readNullableObject(GlobalMarshaller.java:361)

at org.infinispan.marshall.core.BytesObjectInput.readObject(BytesObjectInput.java:40)

at org.infinispan.stream.impl.intops.IntermediateOperationExternalizer.readObject(IntermediateOperationExternalizer.java:377)

at org.infinispan.stream.impl.intops.IntermediateOperationExternalizer.readObject(IntermediateOperationExternalizer.java:92)

at org.infinispan.marshall.core.GlobalMarshaller.readWithExternalizer(GlobalMarshaller.java:708)

at org.infinispan.marshall.core.GlobalMarshaller.readNonNullableObject(GlobalMarshaller.java:691)

at org.infinispan.marshall.core.GlobalMarshaller.readNullableObject(GlobalMarshaller.java:361)

at org.infinispan.marshall.core.BytesObjectInput.readObject(BytesObjectInput.java:40)

at org.infinispan.commons.marshall.MarshallUtil.lambda$unmarshallCollection$0(MarshallUtil.java:284)

at org.infinispan.commons.marshall.MarshallUtil.unmarshallCollection(MarshallUtil.java:267)

at org.infinispan.commons.marshall.MarshallUtil.unmarshallCollection(MarshallUtil.java:284)

at org.infinispan.marshall.exts.CollectionExternalizer.readObject(CollectionExternalizer.java:120)

at org.infinispan.marshall.exts.CollectionExternalizer.readObject(CollectionExternalizer.java:27)

at org.infinispan.marshall.core.GlobalMarshaller.readWithExternalizer(GlobalMarshaller.java:708)

at org.infinispan.marshall.core.GlobalMarshaller.readNonNullableObject(GlobalMarshaller.java:691)

at org.infinispan.marshall.core.GlobalMarshaller.readNullableObject(GlobalMarshaller.java:361)

at org.infinispan.marshall.core.BytesObjectInput.readObject(BytesObjectInput.java:40)

at org.infinispan.stream.impl.termop.TerminalOperationExternalizer.readObject(TerminalOperationExternalizer.java:192)

at org.infinispan.stream.impl.termop.TerminalOperationExternalizer.readObject(TerminalOperationExternalizer.java:42)

at org.infinispan.marshall.core.GlobalMarshaller.readWithExternalizer(GlobalMarshaller.java:708)

at org.infinispan.marshall.core.GlobalMarshaller.readNonNullableObject(GlobalMarshaller.java:691)

at org.infinispan.marshall.core.GlobalMarshaller.readNullableObject(GlobalMarshaller.java:361)

at org.infinispan.marshall.core.BytesObjectInput.readObject(BytesObjectInput.java:40)

at org.infinispan.stream.impl.StreamRequestCommand.readFrom(StreamRequestCommand.java:143)

at org.infinispan.marshall.exts.ReplicableCommandExternalizer.readCommandParameters(ReplicableCommandExternalizer.java:104)

at org.infinispan.marshall.exts.CacheRpcCommandExternalizer.readObject(CacheRpcCommandExternalizer.java:132)

at org.infinispan.marshall.exts.CacheRpcCommandExternalizer.readObject(CacheRpcCommandExternalizer.java:66)

at org.infinispan.marshall.core.GlobalMarshaller.readWithExternalizer(GlobalMarshaller.java:708)

at org.infinispan.marshall.core.GlobalMarshaller.readNonNullableObject(GlobalMarshaller.java:691)

at org.infinispan.marshall.core.GlobalMarshaller.readNullableObject(GlobalMarshaller.java:361)

at org.infinispan.marshall.core.GlobalMarshaller.objectFromObjectInput(GlobalMarshaller.java:194)

at org.infinispan.marshall.core.GlobalMarshaller.objectFromByteBuffer(GlobalMarshaller.java:223)

at org.infinispan.remoting.transport.jgroups.JGroupsTransport.processRequest(JGroupsTransport.java:1332)

at org.infinispan.remoting.transport.jgroups.JGroupsTransport.processMessage(JGroupsTransport.java:1272)

at org.infinispan.remoting.transport.jgroups.JGroupsTransport.access$300(JGroupsTransport.java:126)

at org.infinispan.remoting.transport.jgroups.JGroupsTransport$ChannelCallbacks.up(JGroupsTransport.java:1420)

at org.jgroups.JChannel.up(JChannel.java:816)

at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:893)

at org.jgroups.protocols.FRAG3.up(FRAG3.java:171)

at org.jgroups.protocols.FlowControl.up(FlowControl.java:351)

... 16 more

Caused by: java.lang.reflect.InvocationTargetException

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at java.lang.invoke.SerializedLambda.readResolve(SerializedLambda.java:230)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.jboss.marshalling.reflect.JDKSpecific$SerMethods.callReadResolve(JDKSpecific.java:250)

... 64 more

Caused by: java.lang.IllegalArgumentException: Invalid lambda deserialization

at com.deepdia.deepsearch.modules.infinispan.StartClient.$deserializeLambda$(StartClient.java:32)

... 74 more

Caused by: an exception which occurred:

in object of type java.lang.invoke.SerializedLambda

-> classloader hierarchy:

而且,尽管我认为这都不相关,但这是ggroups xml文件:

 Configuration conf = new ConfigurationBuilder()
                .memory()
                .evictionStrategy(EvictionStrategy.REMOVE) //I think this is default
                .size(SIZE)
                .unsafe()
                .unreliableReturnValues(false)
                .clustering()
                .cacheMode(CacheMode.DIST_ASYNC)
                .hash()
                .numOwners(1)
                .numSegments(100)
                .capacityFactor(capacityFactor)
                .persistence()
                .passivation(true)
                .addStore(RocksDBStoreConfigurationBuilder.class)
                .location("C:\\Users\\gsaxena888\\Downloads\\temp" + vmNum + "\\data")
                .expiredLocation("C:\\Users\\gsaxena888\\Downloads\\temp\\" + vmNum + "\\expired")
                .segmented(true)
                .shared(false)
                .async()
                .enabled(true)
                .threadPoolSize(1)
                .modificationQueueSize(SIZE)
                .build();

        String newCacheName = "distributedWithL1";
        manager.defineConfiguration(newCacheName, conf);
        Cache</*StringHolderWorking*/String, /*StringHolderWorking*/String> c = manager.getCache(newCacheName);

0 个答案:

没有答案