Script16.groovy: 2: unable to resolve class StandardJanusGraph


Vinayak Bali
 

Hi All,

Using a batch processing script to load the data into the graph. With JanusGraphFactory the scripts were working as expected. Now the same code is not working with ConfiguredGraphFactory. The error is as follows:

Script16.groovy: 2: unable to resolve class StandardJanusGraph
 @ line 2, column 3.
     private StandardJanusGraph graph;
     ^

Script16.groovy: 7: unable to resolve class StandardJanusGraph
 @ line 7, column 22.
     public CsvImporter(StandardJanusGraph graph, int batchNumber, List csvRecords
                        ^

2 errors
Type ':help' or ':h' for help.
Display stack trace? [yN]y
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script16.groovy: 2: unable to resolve class StandardJanusGraph
 @ line 2, column 3.
     private StandardJanusGraph graph;
     ^

Script16.groovy: 7: unable to resolve class StandardJanusGraph
 @ line 7, column 22.
     public CsvImporter(StandardJanusGraph graph, int batchNumber, List csvRecords
                        ^

2 errors

at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:311)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:980)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:647)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:596)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:390)
at groovy.lang.GroovyClassLoader.access$300(GroovyClassLoader.java:89)
at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:330)
at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:327)
at org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:147)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:325)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:309)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:251)
at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine$GroovyCacheLoader.lambda$load$0(GremlinGroovyScriptEngine.java:819)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
at java.util.concurrent.CompletableFuture.asyncSupplyStage(CompletableFuture.java:1618)
at java.util.concurrent.CompletableFuture.supplyAsync(CompletableFuture.java:1843)
at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine$GroovyCacheLoader.load(GremlinGroovyScriptEngine.java:817)
at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine$GroovyCacheLoader.load(GremlinGroovyScriptEngine.java:812)
at com.github.benmanes.caffeine.cache.BoundedLocalCache$BoundedLocalLoadingCache.lambda$new$0(BoundedLocalCache.java:3117)
at com.github.benmanes.caffeine.cache.LocalCache.lambda$statsAware$0(LocalCache.java:144)
at com.github.benmanes.caffeine.cache.BoundedLocalCache.lambda$doComputeIfAbsent$16(BoundedLocalCache.java:1968)
at java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1892)
at com.github.benmanes.caffeine.cache.BoundedLocalCache.doComputeIfAbsent(BoundedLocalCache.java:1966)
at com.github.benmanes.caffeine.cache.BoundedLocalCache.computeIfAbsent(BoundedLocalCache.java:1949)
at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:113)
at com.github.benmanes.caffeine.cache.LocalLoadingCache.get(LocalLoadingCache.java:67)
at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.getScriptClass(GremlinGroovyScriptEngine.java:567)
at org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:374)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233)
at org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$0(GremlinExecutor.java:267)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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)

A small part of the code:

class CsvImporter implements Runnable {

  private StandardJanusGraph graph;
  private int batchNumber;
  private List csvRecords;
  private int lastRecord;
  private Closure processor;

  public CsvImporter(StandardJanusGraph graph, int batchNumber, List csvRecords
    , int lastRecord, Closure processor) {

    this.graph = graph;
    this.batchNumber = batchNumber
    this.csvRecords = csvRecords
    this.lastRecord = lastRecord
    this.processor = processor
  }

Initial code to access graph using JanusGraphFactory
graph = ctx.graph = graph = JanusGraphFactory.open('/home/fusionops/janusgraph-full-0.5.2/conf/graph1.properties')
Updated code to access graph using ConfiguredGraphFactory
graph = ctx.graph = graph = ConfiguredGraphFactory.open("merck_graph_explorer_demo")

Thanks & Regards,
Vinayak

Join janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.