Java document starting up


#1

I have the following code:

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

}

But get:

    Exception in thread "main" java.io.UncheckedIOException: java.nio.file.AccessDeniedException: /tmp/systemd-private-8caa36fe767d4f0e98562e90a3e06ba4-upower.service-ZrF1IP
            at java.nio.file.FileTreeIterator.fetchNextIfNeeded(FileTreeIterator.java:88)
            at java.nio.file.FileTreeIterator.hasNext(FileTreeIterator.java:104)
            at java.util.Iterator.forEachRemaining(Iterator.java:115)
            at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
            at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
            at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
            at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
            at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
            at java.util.stream.LongPipeline.reduce(LongPipeline.java:438)
            at java.util.stream.LongPipeline.sum(LongPipeline.java:396)
            at com.orientechnologies.orient.core.db.OrientDBEmbedded.calculateInitialMaxWALSegSize(OrientDBEmbedded.java:139)
            at com.orientechnologies.orient.core.db.OrientDBEmbedded.<init>(OrientDBEmbedded.java:100)
            at com.orientechnologies.orient.core.db.OrientDBInternal.embedded(OrientDBInternal.java:105)
            at com.orientechnologies.orient.core.db.OrientDB.<init>(OrientDB.java:164)
            at com.orientechnologies.orient.core.db.OrientDB.<init>(OrientDB.java:117)
            at Main.main(Main.java:10)
    Caused by: java.nio.file.AccessDeniedException: /tmp/systemd-private-8caa36fe767d4f0e98562e90a3e06ba4-upower.service-ZrF1IP
            at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
            at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
            at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
            at sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:427)
            at java.nio.file.Files.newDirectoryStream(Files.java:457)
            at java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:300)
            at java.nio.file.FileTreeWalker.next(FileTreeWalker.java:372)
            at java.nio.file.FileTreeIterator.fetchNextIfNeeded(FileTreeIterator.java:84)
            ... 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'

#2

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?

Thanks

Luigi


#3

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.


#4

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