簡體   English   中英

Spring Batch Gemfire 9.6連接錯誤-由以下原因引起:java.io.IOException:無法寫入部署目錄

[英]Spring batch Gemfire 9.6 connection error - Caused by: java.io.IOException: Unable to write to deploy directory

我正在使用Spring Batch使用以下命令將數據加載到gemfire中

@Bean
    public GemfireTemplate gemFireTemplate(ClientRegionFactory<Object, 
     Object> factory) {
        GemfireTemplate template = new GemfireTemplate();
        template.setRegion("regionName");
        return template;
    }

POM:

 <parent>
     <groupId>org.springframework.boot</groupId>
     <artifactId>spring-boot-starter-parent</artifactId>
     <version>2.1.1.RELEASE</version>
     <relativePath /> <!-- lookup parent from repository -->
 </parent>


   <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-batch</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-gemfire</artifactId>
        <version>1.5.16.RELEASE</version>
    </dependency>
   <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-geode</artifactId>
        <version>2.0.3.RELEASE</version>
      </dependency>
   <dependency>
      <groupId>io.pivotal.gemfire</groupId>
      <artifactId>geode-core</artifactId>
      <version>9.3.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.pivotal.gemfire</groupId>
      <artifactId>geode-common</artifactId>
      <version>9.3.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.pivotal.gemfire</groupId>
      <artifactId>geode-cq</artifactId>
      <version>9.3.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.pivotal.gemfire</groupId>
      <artifactId>geode-wan</artifactId>
      <version>9.3.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.pivotal.gemfire</groupId>
      <artifactId>geode-json</artifactId>
      <version>9.3.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.pivotal.gemfire</groupId>
      <artifactId>geode-lucene</artifactId>
      <version>9.3.0</version>
      <scope>compile</scope>
    </dependency>
   <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>4.2.6.RELEASE</version>
      </dependency>
       <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>5.0.3.RELEASE</version>
      </dependency>
      <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>4.2.12.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-config</artifactId>
        <version>4.2.12.RELEASE</version>
    </dependency>
      <dependency>
        <groupId>org.springframework.batch</groupId>
        <artifactId>spring-batch-core</artifactId>
        <version>4.0.0.RELEASE</version>
      </dependency>
      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>5.0.3.RELEASE</version>
      </dependency>

日志:

[info 2019/09/11 22:29:22.836 CDT <main> tid=0x1] GemFireCache[id = 892555958; isClosing = true; isShutDownAll = false; created = Wed Sep 11 22:29:20 CDT 2019; server = false; copyOnRead = false; lockLease = 120; lockTimeout = 60]: Now closing.

[error 2019/09/11 22:29:22.913 CDT <main> tid=0x1] java.lang.RuntimeException: java.io.IOException: Unable to write to deploy directory: /data/khan/vaquar/dataloader

java.lang.RuntimeException: java.io.IOException: Unable to write to deploy directory: /data/khan/vaquar/dataloader
        at org.apache.geode.internal.JarDeployer.loadPreviouslyDeployedJarsFromDisk(JarDeployer.java:410)
        at org.apache.geode.internal.cache.GemFireCacheImpl.initialize(GemFireCacheImpl.java:1191)
        at org.apache.geode.internal.cache.GemFireCacheImpl.basicCreate(GemFireCacheImpl.java:758)
        at org.apache.geode.internal.cache.GemFireCacheImpl.createClient(GemFireCacheImpl.java:731)
        at org.apache.geode.cache.client.ClientCacheFactory.basicCreate(ClientCacheFactory.java:262)
        at org.apache.geode.cache.client.ClientCacheFactory.create(ClientCacheFactory.java:212)
        at com.syf.gemfire.jdbc.dataloader.config.FullBatchConf.clientCache(FullBatchConf.java:205)
        at com.syf.gemfire.jdbc.dataloader.config.FullBatchConf$$EnhancerBySpringCGLIB$$749d49c1.CGLIB$clientCache$5(<generated>)
        at com.syf.gemfire.jdbc.dataloader.config.FullBatchConf$$EnhancerBySpringCGLIB$$749d49c1$$Fast

    Caused by: java.io.IOException: Unable to write to deploy directory: /data/khan/vaquar/dataloader
        at org.apache.geode.internal.JarDeployer.verifyWritableDeployDirectory(JarDeployer.java:333)
        at org.apache.geode.internal.JarDeployer.loadPreviouslyDeployedJarsFromDisk(JarDeployer.java:389)   

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.geode.cache.client.ClientCache]: Factory method 'clientCache' threw exception; nested exception is java.lang.RuntimeException: java.io.IOException: Unable to write to deploy directory:/data/khan/vaquar/dataloader

分析:

當與gemfire群集啟動geode連接時,關鍵罐子需要寫權限。

關鍵代碼:

關鍵文檔:-https: //gemfire.docs.pivotal.io/98/geode/configuring/cluster_config/deploying_application_jars.html

關鍵文檔說,如果我們可以在“ gefire.properties”內刪除“ deploy-working-dir”,則可以解決問題,否則請使用“ -Dgemfire.deploy-working-dir = / temp /

問題:在Spring批處理中,我們沒有配置任何gemfire屬性,如何在GemfireTemplate代碼中對其進行修復?

問題顯然與問題所附的Geode Ticket所述的GEODE-5000相同 此特殊票證已在Geode 1.6.0中修復,並且根據《 Pivotal GemFire用戶指南》 (特別是發行說明)GemFire 9.5基於Geode 1.6.0,因此您應該使用該版本而不是9.3.0來擺脫問題。

附帶說明,您不應隨意混合和匹配spring-data-gemfiregemfire版本,因為可能會出現多個問題,請遵循Spring Data for Pivotal GemFire版本兼容性列表來避免出現問題。

希望這可以幫助。 干杯。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM