REPL runtime exception


#1

Hi. I’m new to IDEA and Kotlin, so may be missing something obvious.

I’m running the Kotlin REPL in IDEA from a Kotlin-Maven project (created through the archetype). I’m trying to connect to a HyperGraphDB database (http://hypergraphdb.org/) from the REPL. But I get the runtime exception below. If I put exactly the same line of code in a function and run it through a Junit test, it works as expected. So it seems that it’s not a HyperGraphDB problem, but is specific to the REPL. Is there some REPL configuration I need to do?

import org.hypergraphdb.*

val graph: HyperGraph = HGEnvironment.getExistingOnly( “”“Z:\project\src\test\resources\database”"" )

org.hypergraphdb.HGException: java.lang.RuntimeException: java.lang.RuntimeException: org.hypergraphdb.HGException: Could not create predefined type instance with org.hypergraphdb.type.RecordTypeConstructor for type ae9e93e7-07c9-11da-831d-8d375c1471fe: org.hypergraphdb.HGException: Could not load class org.hypergraphdb.type.RecordTypeConstructor

at org.hypergraphdb.HyperGraph.open(HyperGraph.java:401)

at org.hypergraphdb.HyperGraph.open(HyperGraph.java:211)

at org.hypergraphdb.HyperGraph.(HyperGraph.java:198)

at org.hypergraphdb.HGEnvironment.getExistingOnly(HGEnvironment.java:146)

Caused by: java.lang.RuntimeException: java.lang.RuntimeException: org.hypergraphdb.HGException: Could not create predefined type instance with org.hypergraphdb.type.RecordTypeConstructor for type ae9e93e7-07c9-11da-831d-8d375c1471fe: org.hypergraphdb.HGException: Could not load class org.hypergraphdb.type.RecordTypeConstructor

at org.hypergraphdb.transaction.HGTransactionManager.ensureTransaction(HGTransactionManager.java:324)

at org.hypergraphdb.HyperGraph.loadAtom(HyperGraph.java:1674)

at org.hypergraphdb.HyperGraph.get(HyperGraph.java:829)

at org.hypergraphdb.HGTypeSystem.getType(HGTypeSystem.java:840)

at org.hypergraphdb.HyperGraph$8.call(HyperGraph.java:1699)

at org.hypergraphdb.HyperGraph$8.call(HyperGraph.java:1675)

at org.hypergraphdb.transaction.HGTransactionManager.transact(HGTransactionManager.java:400)

at org.hypergraphdb.transaction.HGTransactionManager.ensureTransaction(HGTransactionManager.java:327)

at org.hypergraphdb.HyperGraph.loadAtom(HyperGraph.java:1674)

at org.hypergraphdb.HyperGraph.get(HyperGraph.java:829)

at org.hypergraphdb.HGIndexManager.loadIndexers(HGIndexManager.java:146)

at org.hypergraphdb.HyperGraph.open(HyperGraph.java:359)

at org.hypergraphdb.HyperGraph.open(HyperGraph.java:211)

at org.hypergraphdb.HyperGraph.(HyperGraph.java:198)

at org.hypergraphdb.HGEnvironment.getExistingOnly(HGEnvironment.java:146)

at Line2.(Unknown Source)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at org.jetbrains.kotlin.cli.jvm.repl.ReplInterpreter$eval$scriptInstance$1.invoke(ReplInterpreter.kt:135)

at org.jetbrains.kotlin.cli.jvm.repl.ReplInterpreter.executeUserCode(ReplInterpreter.kt:169)

at org.jetbrains.kotlin.cli.jvm.repl.ReplInterpreter.eval(ReplInterpreter.kt:135)

at org.jetbrains.kotlin.cli.jvm.repl.ReplFromTerminal.eval(ReplFromTerminal.kt:98)

at org.jetbrains.kotlin.cli.jvm.repl.ReplFromTerminal.one(ReplFromTerminal.kt:88)

at org.jetbrains.kotlin.cli.jvm.repl.ReplFromTerminal.doRun(ReplFromTerminal.kt:52)

at org.jetbrains.kotlin.cli.jvm.repl.ReplFromTerminal.access$doRun(ReplFromTerminal.kt:32)

at org.jetbrains.kotlin.cli.jvm.repl.ReplFromTerminal$Companion.run(ReplFromTerminal.kt:152)

at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:113)

at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:55)

at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.java:192)

at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.java:140)

at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.java:67)

at org.jetbrains.kotlin.cli.common.CLICompiler.doMainNoExit(CLICompiler.java:388)

at org.jetbrains.kotlin.cli.common.CLICompiler.doMain(CLICompiler.java:372)

at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler$Companion.main(K2JVMCompiler.kt:287)

at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.main(K2JVMCompiler.kt)

Caused by: java.lang.RuntimeException: org.hypergraphdb.HGException: Could not create predefined type instance with org.hypergraphdb.type.RecordTypeConstructor for type ae9e93e7-07c9-11da-831d-8d375c1471fe: org.hypergraphdb.HGException: Could not load class org.hypergraphdb.type.RecordTypeConstructor

at org.hypergraphdb.transaction.HGTransactionManager.ensureTransaction(HGTransactionManager.java:324)

at org.hypergraphdb.HyperGraph.loadAtom(HyperGraph.java:1674)

at org.hypergraphdb.HyperGraph.get(HyperGraph.java:829)

at org.hypergraphdb.HGTypeSystem.getType(HGTypeSystem.java:840)

at org.hypergraphdb.HyperGraph$8.call(HyperGraph.java:1699)

at org.hypergraphdb.HyperGraph$8.call(HyperGraph.java:1675)

at org.hypergraphdb.transaction.HGTransactionManager.ensureTransaction(HGTransactionManager.java:320)

… 36 more

Caused by: org.hypergraphdb.HGException: Could not create predefined type instance with org.hypergraphdb.type.RecordTypeConstructor for type ae9e93e7-07c9-11da-831d-8d375c1471fe: org.hypergraphdb.HGException: Could not load class org.hypergraphdb.type.RecordTypeConstructor

at org.hypergraphdb.HGTypeSystem.loadPredefinedType(HGTypeSystem.java:383)

at org.hypergraphdb.HyperGraph$8.call(HyperGraph.java:1693)

at org.hypergraphdb.HyperGraph$8.call(HyperGraph.java:1675)

at org.hypergraphdb.transaction.HGTransactionManager.ensureTransaction(HGTransactionManager.java:320)

… 42 more

Caused by: org.hypergraphdb.HGException: Could not load class org.hypergraphdb.type.RecordTypeConstructor

at org.hypergraphdb.HGTypeSystem.loadClass(HGTypeSystem.java:597)

at org.hypergraphdb.HGTypeSystem.loadPredefinedType(HGTypeSystem.java:375)

… 45 more

Caused by: java.lang.ClassNotFoundException: org.hypergraphdb.type.RecordTypeConstructor

at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

at org.hypergraphdb.util.HGUtils.loadClass(HGUtils.java:248)

at org.hypergraphdb.util.HGUtils.loadClass(HGUtils.java:217)

at org.hypergraphdb.HGTypeSystem.loadClass(HGTypeSystem.java:593)

… 46 more