当前位置: 首页 > 知识库问答 >
问题:

dotnet客户端尝试在服务器上创建缓存时的Apache Ignite-NPE

王亮
2023-03-14
class Program
    {
        public static bool ClientDisconnected = false;

        static void Main(string[] args)
        {
            Console.WriteLine("Starting client");
            string x = typeof(CacheStoreFactory).FullName;
            Console.WriteLine("Cache factory: " + x);
            var cfg = new IgniteConfiguration
            {
                SpringConfigUrl = "ignite.config",
                JvmOptions = new[]
                {
                    "-Xdebug","-DIGNITE_QUIET=false"
                },
            };

            /*
            var cfg = new IgniteConfiguration()
            {
                ClientMode = true,
                JvmOptions = new[]
                {
                    "-Xdebug","-DIGNITE_QUIET=false"
                },
                BinaryConfiguration = new BinaryConfiguration
                {
                    Types = new List<string>
                    {
                        typeof(CacheStoreFactory).FullName,
                    }
                },
            };
             */


            Console.WriteLine("Ignite -> Start");
            using (IIgnite ignite = Ignition.Start(cfg))
            {
                Console.WriteLine("Destroy test-cache");


                //ignite.DestroyCache("test-cache");
                //ICache<int, CacheThing> cache = ignite.GetCache<int, CacheThing>("test-cache");


                ICache<int, CacheThing> cache = ignite.CreateCache<int, CacheThing>(new CacheConfiguration
                {
                    Name = "test-cache",
                    ReadThrough = true,
                    WriteThrough = true,
                    KeepBinaryInStore = true,
                    CacheStoreFactory = new CacheStoreFactory()
                });





                ignite.ClientDisconnected += (sender, eventArgs) =>
                {
                    ClientDisconnected = true;

                    Console.WriteLine("Client disconnected.");
                };

                ignite.ClientReconnected += (sender, eventArgs) =>
                {
                    ClientDisconnected = false;

                    Console.WriteLine("Client reconnected.");
                };

                Object retrieved = cache.Get(1);

                Console.WriteLine(retrieved);

                Console.WriteLine("Press enter to quit client");
                Console.ReadLine();
            }
        }
    }
    at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.load(GridCacheStoreManagerAdapter.java:293)
    at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadAllFromStore(GridCacheStoreManagerAdapter.java:434)
    at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadAll(GridCacheStoreManagerAdapter.java:400)
    at org.apache.ignite.internal.processors.cache.GridCacheAdapter$18.call(GridCacheAdapter.java:2046)
    at org.apache.ignite.internal.processors.cache.GridCacheAdapter$18.call(GridCacheAdapter.java:2044)
    at org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6695)
    at org.apache.ignite.internal.processors.closure.GridClosureProcessor$2.body(GridClosureProcessor.java:967)
    at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
    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.NullPointerException
    at org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore.doInvoke(PlatformDotNetCacheStore.java:469)
    at org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore.load(PlatformDotNetCacheStore.java:176)
    at org.apache.ignite.internal.processors.cache.CacheStoreBalancingWrapper.load(CacheStoreBalancingWrapper.java:98)
    at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadFromStore(GridCacheStoreManagerAdapter.java:327)
    ... 11 more
   --- End of inner exception stack trace ---
   at Apache.Ignite.Core.Impl.PlatformJniTarget.InStreamOutLong[TR](Int32 type, Action`1 outAction, Func`3 inAction, Func`2 readErrorAction)
   at SpikeCD750.Program.Main(String[] args) in /home/anton/git/ignite-readthrough/SpikeCD750/Program.cs:line 85
server_1  | [03:07:20,337][SEVERE][sys-#81][GridDhtAtomicCache] <test-cache> Failed processing get request: GridNearSingleGetRequest [futId=1535944038969, key=KeyCacheObjectImpl [part=1, val=1, hasValBytes=true], flags=1, topVer=AffinityTopologyVersion [topVer=6, minorTopVer=0], subjId=f91be4be-6ca6-4b70-8264-6dc5fee43357, taskNameHash=0, createTtl=-1, accessTtl=-1]
server_1  | class org.apache.ignite.IgniteCheckedException: java.lang.NullPointerException
server_1  |     at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadFromStore(GridCacheStoreManagerAdapter.java:338)
server_1  |     at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.load(GridCacheStoreManagerAdapter.java:293)
server_1  |     at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadAllFromStore(GridCacheStoreManagerAdapter.java:434)
server_1  |     at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadAll(GridCacheStoreManagerAdapter.java:400)
server_1  |     at org.apache.ignite.internal.processors.cache.GridCacheAdapter$18.call(GridCacheAdapter.java:2046)
server_1  |     at org.apache.ignite.internal.processors.cache.GridCacheAdapter$18.call(GridCacheAdapter.java:2044)
server_1  |     at org.apache.ignite.internal.util.IgniteUtils.wrapThreadLoader(IgniteUtils.java:6695)
server_1  |     at org.apache.ignite.internal.processors.closure.GridClosureProcessor$2.body(GridClosureProcessor.java:967)
server_1  |     at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
server_1  |     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
server_1  |     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
server_1  |     at java.lang.Thread.run(Thread.java:748)
server_1  | Caused by: javax.cache.integration.CacheLoaderException: java.lang.NullPointerException
server_1  |     ... 12 more
server_1  | Caused by: java.lang.NullPointerException
server_1  |     at org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore.doInvoke(PlatformDotNetCacheStore.java:469)
server_1  |     at org.apache.ignite.internal.processors.platform.dotnet.PlatformDotNetCacheStore.load(PlatformDotNetCacheStore.java:176)
server_1  |     at org.apache.ignite.internal.processors.cache.CacheStoreBalancingWrapper.load(CacheStoreBalancingWrapper.java:98)
server_1  |     at org.apache.ignite.internal.processors.cache.store.GridCacheStoreManagerAdapter.loadFromStore(GridCacheStoreManagerAdapter.java:327)
server_1  |     ... 11 more

共有1个答案

颜功
2023-03-14

.NET缓存存储不能部署在仅Java节点上。

Docker容器包含仅Java的Ignite,您可以在C#代码中创建一个自定义缓存存储。

因此,除非Ignite team发布运行Ignite.NET的Docker映像,否则必须创建自定义Docker映像,或以其他方式启动Ignite.NET服务器节点。

 类似资料:
  • 我是java和web服务以及的新手。我最近使用一些教程创建了一个web服务。当我第一次学习eclipse教程时,让我创建一个客户机。但是当我尝试创建一个新项目和一个新的web服务客户机时,它会给出。具体如下所示: im使用Axis2-1.6.1,它说java遵从性级别是6,我搜索了一下,但是找不到解决这个问题的相关方案。感谢任何帮助。

  • 问题内容: 这是一个设计问题。我有需要进入HTML表的数据,稍后将由用户操纵。基本上,用户将能够选择表格行中的项目。 我有两个选择-在两种情况下,我都使用AJAX来获取数据: 在服务器端使用PHP创建HTML代码,并将其作为HTML发送到客户端。然后,用户使用Javascript(本质上是jQuery)来操纵表格。 使用JSON将原始数据发送到客户端,然后使用jQuery创建HTML,然后由用户对

  • NewTLSServer创建的服务器可以验证对显式从其创建的客户端的调用: 在行中。 但是,我有一个生产程序,我想将其设置为使用作为主机。我越来越 我称之为错误。 我如何设置与客户端进行身份验证,就像普通的HTTPS服务器一样?

  • 关于Netflix Eureka Service Registry,我已经成功地使用Tomcat8.0.35设置了Eureka Netflix服务器。我还得到了基本的示例服务&客户端来进行相互通信。我对Eureka还是个新手,管理层决定将Eureka与Spring一起使用,因为几个新的应用程序都是围绕Spring框架编写的。 null 我希望为大多数非AWS云实例配置服务和客户端。Eureka W

  • 我创建了一个将被转换为web服务方法,该方法如下所示: 当我部署和测试此web服务时,我得到以下错误: WS00041:服务调用引发异常,消息为:NULL;有关更多详细信息,请参阅服务器日志异常详细信息:java.lang.reflect.invocationtargetexception javax.servlet.servletexception:java.lang.reflect.invoc

  • 我想在一些计算机之间建立点对点连接,这样用户就可以在没有外部服务器的情况下聊天和交换文件。我最初的想法如下: 我在服务器上制作了一个中央服务器插座,所有应用程序都可以连接到该插座。此ServerSocket跟踪已连接的套接字(客户端),并将新连接的客户端的IP和端口提供给所有其他客户端。每个客户端都会创建一个新的ServerSocket,所有客户端都可以连接到它。 换句话说:每个客户端都有一个Se