Repository navigation
Closed
Labels
invalidThis doesn't seem rightThis doesn't seem right
Description
ArcadeDB Version: 21.10
JDK Version: OpenJDK 11
OS: Ubuntu Server 20.04
Expected behavior
Server starts up when application is run
Actual behavior
Caused by: com.arcadedb.exception.DatabaseOperationException: Error on creating new database instance
at com.arcadedb.database.EmbeddedDatabase.openInternal(EmbeddedDatabase.java:233) ~[arcadedb-engine-21.9.1.jar!/:na]
at com.arcadedb.database.EmbeddedDatabase.create(EmbeddedDatabase.java:183) ~[arcadedb-engine-21.9.1.jar!/:na]
at com.arcadedb.database.DatabaseFactory.create(DatabaseFactory.java:79) ~[arcadedb-engine-21.9.1.jar!/:na]
at com.example.CustomClass.<init>(CustomClass.kt:18) ~[classes!/:0.0.1-SNAPSHOT]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[na:na]
at kotlin.reflect.jvm.internal.calls.CallerImpl$Constructor.call(CallerImpl.kt:41) ~[kotlin-reflect-1.5.31.jar!/:1.5.31-release-548(1.5.31)]
at kotlin.reflect.jvm.internal.KCallableImpl.call(KCallableImpl.kt:108) ~[kotlin-reflect-1.5.31.jar!/:1.5.31-release-548(1.5.31)]
at kotlin.reflect.jvm.internal.KCallableImpl.callDefaultMethod$kotlin_reflection(KCallableImpl.kt:159) ~[kotlin-reflect-1.5.31.jar!/:1.5.31-release-548(1.5.31)]
at kotlin.reflect.jvm.internal.KCallableImpl.callBy(KCallableImpl.kt:112) ~[kotlin-reflect-1.5.31.jar!/:1.5.31-release-548(1.5.31)]
at org.springframework.beans.BeanUtils$KotlinDelegate.instantiateClass(BeanUtils.java:854) ~[spring-beans-5.3.10.jar!/:5.3.10]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:196) ~[spring-beans-5.3.10.jar!/:5.3.10]
... 29 common frames omitted
Caused by: com.arcadedb.exception.DatabaseMetadataException: Error on loading dictionary (error=java.io.FileNotFoundException: /<PATH_TO_DATABASE>/dictionary.0.327680.dict (No such file or directory))
at com.arcadedb.schema.EmbeddedSchema.create(EmbeddedSchema.java:120) ~[arcadedb-engine-21.9.1.jar!/:na]
at com.arcadedb.database.EmbeddedDatabase.openInternal(EmbeddedDatabase.java:209) ~[arcadedb-engine-21.9.1.jar!/:na]
... 42 common frames omitted
Caused by: java.io.FileNotFoundException: /<PATH_TO_DATABASE>/dictionary.0.327680.dict (No such file or directory)
at java.base/java.io.RandomAccessFile.open0(Native Method) ~[na:na]
at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:345) ~[na:na]
at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:259) ~[na:na]
at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:214) ~[na:na]
at com.arcadedb.engine.PaginatedFile.open(PaginatedFile.java:247) ~[arcadedb-engine-21.9.1.jar!/:na]
at com.arcadedb.engine.PaginatedFile.<init>(PaginatedFile.java:57) ~[arcadedb-engine-21.9.1.jar!/:na]
at com.arcadedb.engine.FileManager.getOrCreateFile(FileManager.java:170) ~[arcadedb-engine-21.9.1.jar!/:na]
at com.arcadedb.engine.PaginatedComponent.<init>(PaginatedComponent.java:54) ~[arcadedb-engine-21.9.1.jar!/:na]
at com.arcadedb.engine.PaginatedComponent.<init>(PaginatedComponent.java:65) ~[arcadedb-engine-21.9.1.jar!/:na]
at com.arcadedb.engine.PaginatedComponent.<init>(PaginatedComponent.java:44) ~[arcadedb-engine-21.9.1.jar!/:na]
at com.arcadedb.engine.Dictionary.<init>(Dictionary.java:66) ~[arcadedb-engine-21.9.1.jar!/:na]
at com.arcadedb.schema.EmbeddedSchema.create(EmbeddedSchema.java:112) ~[arcadedb-engine-21.9.1.jar!/:na]
... 43 common frames omitted
Steps to reproduce
Run the following code
private val factory: DatabaseFactory = DatabaseFactory(<PATH_TO_DB>)
val database: Database = if (factory.exists()) {
factory.open()
} else {
factory.create()
}
database.transaction {
if (!it.schema.existsType(<TYPE_NAME>)) {
val doc = it.schema.createDocumentType(<TYPE_NAME>)
doc.createProperty(<PROPERTY_NAME>, Type.STRING)
doc.createProperty(<PROPERTY_NAME>, Type.STRING)
doc.createProperty(<PROPERTY_NAME>, Type.STRING)
doc.createProperty(<PROPERTY_NAME>, Type.INTEGER)
}
}
Metadata
Metadata
Assignees
Labels
invalidThis doesn't seem rightThis doesn't seem right
Activity
lvca commentedon Oct 6, 2021
If you embed the server you should get the database instance from the server, so everything is managed:
or this if you want to create a new database if not exists:
I should write a chapter about embedding the server. Doing asap.
Please let me know if this solves the problem.
lvca commentedon Oct 6, 2021
New chapter is online: https://docs.arcadedb.com/#Embed-Server.
Jurgen-Aquilina commentedon Oct 7, 2021
Thanks for the clarification. I tried using the code in the chapter but I cannot import the ArcadeDBServer instance and couldn't find such a class within the latest commit under the engine package.
Is the class still not added perhaps? @lvca
lvca commentedon Oct 7, 2021
You should add
arcadedb-server-<version>.jarin your classpath. Thanks for the feedback, I'm going to update the documentation on that.Jurgen-Aquilina commentedon Oct 7, 2021
Thanks. FYI in the documentation there is a minor mistake
is internal so it should be the following:
Also from the docs it is not clear that you need to configure the SERVER_DATABASE_DIRECTORY before starting the server.
lvca commentedon Oct 7, 2021
Docs fixed, thanks. It must be something with spring's class loader. Do you have a test case I can run and debug locally?
Jurgen-Aquilina commentedon Oct 7, 2021
Nevermind about the Spring issue. IntelliJ switched the arcadedb-engine to 21.9 when I added the arcadedb-server on maven causing that error so no issue.
lvca commentedon Oct 7, 2021
Cool, thanks for finding that out.
chore(deps): bump org.apache.maven.plugins:maven-resources-plugin fro…
chore(deps): bump org.apache.maven.plugins:maven-resources-plugin fro…
docs: the October instrument's single prose pass, written from the sk…