Java document starting up

I have the following code:

main (…){
OrientDB orientDB = new OrientDB(“embedded:/tmp/”, OrientDBConfig.defaultConfig());


But get:

    Exception in thread "main" java.nio.file.AccessDeniedException: /tmp/systemd-private-8caa36fe767d4f0e98562e90a3e06ba4-upower.service-ZrF1IP
            at java.nio.file.FileTreeIterator.fetchNextIfNeeded(
            at java.nio.file.FileTreeIterator.hasNext(
            at java.util.Iterator.forEachRemaining(
            at java.util.Spliterators$IteratorSpliterator.forEachRemaining(
            at com.orientechnologies.orient.core.db.OrientDBEmbedded.calculateInitialMaxWALSegSize(
            at com.orientechnologies.orient.core.db.OrientDBEmbedded.<init>(
            at com.orientechnologies.orient.core.db.OrientDBInternal.embedded(
            at com.orientechnologies.orient.core.db.OrientDB.<init>(
            at com.orientechnologies.orient.core.db.OrientDB.<init>(
            at Main.main(
    Caused by: java.nio.file.AccessDeniedException: /tmp/systemd-private-8caa36fe767d4f0e98562e90a3e06ba4-upower.service-ZrF1IP
            at sun.nio.fs.UnixException.translateToIOException(
            at sun.nio.fs.UnixException.rethrowAsIOException(
            at sun.nio.fs.UnixException.rethrowAsIOException(
            at sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(
            at java.nio.file.Files.newDirectoryStream(
            at java.nio.file.FileTreeWalker.visit(
            at java.nio.file.FileTreeIterator.fetchNextIfNeeded(
            ... 15 more

    FAILURE: Build failed with an exception.

How is systemd related to the this exception?

I don’t have any orientdb server running - /systemd-private directories are
created by systemd services, but why does a Java application run as user try to
access it and fail?

implementation 'com.orientechnologies:orientdb-client:3.0.13'

Hi @MarcWeber

This seems to be a permissions related problem, does your OrientDB process have write rights on the /temp dir? Did you try to start OrientDB on another directory?



Why does it try to access a tmp directory which is not related to itself?

Let me explain systemd is a service on linux managing all daemons / databases/ suprvisors. There is a feature to mount ‘private tmp’ directory as /tmp for those processes. Look at the name of the /tmp directory, upower is a dbus related programm running power management. /tmp is expected to contain some unreadable files by nature.

In this case “tmp” is used as the “root” of the OrientDB storage. Use a subdirectory instead.