[ 
https://issues.apache.org/jira/browse/TIKA-2795?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16715588#comment-16715588
 ] 

Tim Allison commented on TIKA-2795:
-----------------------------------

{{DELETE_ON_CLOSE}} is a bad idea on a file used by different processes.  I 
tried a number of options, and I found it very hard to guarantee that the tmp 
file was deleted and that nothing seriously bad happened when two processes 
shared the tmp file when I shared a memorymapped file between processes..  
Different platforms handle the details in different ways.

For now, I've chosen the simplest option, which is the writer opens the file, 
waits for trylock, writes the status and closes the file.  The reader does the 
same.  This appears to avoid synchronization issues within a process (if more 
than one thread calls close()) and across processes.

> Error starting Tika 2.0 server with -spawnChild on Ubuntu
> ---------------------------------------------------------
>
>                 Key: TIKA-2795
>                 URL: https://issues.apache.org/jira/browse/TIKA-2795
>             Project: Tika
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 2.0
>            Reporter: Mario Bisonti
>            Priority: Major
>
> Hallo.
> I triend to download Tika server 2.0.0 from here:
> [https://builds.apache.org/job/Tika-trunk/lastStableBuild/org.apache.tika$tika-server/]
>  
> I tried to start on my Ubuntu server but with the -spawnChild, it doesn't 
> work.
>  
> sudo java -jar /opt/tika/tika-server-2.0.0-20181203.205013-340.jar -spawnChild
> Dec 05, 2018 2:22:32 PM org.apache.tika.config.InitializableProblemHandler$3 
> handleInitializableProblem
> WARNING: J2KImageReader not loaded. JPEG2000 files will not be processed.
> See https://pdfbox.apache.org/2.0/dependencies.html#jai-image-io
> for optional dependencies.
> Dec 05, 2018 2:22:32 PM org.apache.tika.config.InitializableProblemHandler$3 
> handleInitializableProblem
> WARNING: org.xerial's sqlite-jdbc is not loaded.
> Please provide the jar on your classpath to parse sqlite files.
> See tika-parsers/pom.xml for the correct version.
> INFO Starting Apache Tika 2.0.0-SNAPSHOT server
> INFO server watch dog is starting up
> Dec 05, 2018 2:22:32 PM org.apache.tika.config.InitializableProblemHandler$3 
> handleInitializableProblem
> WARNING: J2KImageReader not loaded. JPEG2000 files will not be processed.
> See https://pdfbox.apache.org/2.0/dependencies.html#jai-image-io
> for optional dependencies.
> Dec 05, 2018 2:22:32 PM org.apache.tika.config.InitializableProblemHandler$3 
> handleInitializableProblem
> WARNING: org.xerial's sqlite-jdbc is not loaded.
> Please provide the jar on your classpath to parse sqlite files.
> See tika-parsers/pom.xml for the correct version.
> INFO Starting Apache Tika 2.0.0-SNAPSHOT server
> java.nio.file.NoSuchFileException: 
> /tmp/tika-server-child-process-mmap-2180120677326747096
>  at 
> java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
>  at 
> java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
>  at 
> java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
>  at 
> java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
>  at 
> java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:145)
>  at 
> java.base/sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
>  at java.base/java.nio.file.Files.readAttributes(Files.java:1755)
>  at java.base/java.nio.file.Files.size(Files.java:2372)
>  at 
> org.apache.tika.server.TikaServerWatchDog$ChildProcess.<init>(TikaServerWatchDog.java:234)
>  at 
> org.apache.tika.server.TikaServerWatchDog$ChildProcess.<init>(TikaServerWatchDog.java:210)
>  at 
> org.apache.tika.server.TikaServerWatchDog.execute(TikaServerWatchDog.java:66)
>  at org.apache.tika.server.TikaServerCli.execute(TikaServerCli.java:146)
>  at org.apache.tika.server.TikaServerCli.main(TikaServerCli.java:127)
> ERROR Can't start:
> java.nio.file.NoSuchFileException: 
> /tmp/tika-server-child-process-mmap-2180120677326747096
> at 
> java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
>  at 
> java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
>  at 
> java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
>  at 
> java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
>  at 
> java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:145)
>  at 
> java.base/sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
>  at java.base/java.nio.file.Files.readAttributes(Files.java:1755)
>  at java.base/java.nio.file.Files.size(Files.java:2372)
>  at 
> org.apache.tika.server.TikaServerWatchDog$ChildProcess.<init>(TikaServerWatchDog.java:234)
>  at 
> org.apache.tika.server.TikaServerWatchDog$ChildProcess.<init>(TikaServerWatchDog.java:210)
>  at 
> org.apache.tika.server.TikaServerWatchDog.execute(TikaServerWatchDog.java:66)
>  at org.apache.tika.server.TikaServerCli.execute(TikaServerCli.java:146)
>  at org.apache.tika.server.TikaServerCli.main(TikaServerCli.java:127)
> administrator@sengvivv02:/opt/tika$
>  
>  
> Instead, on a Windows machine, it starts right.
> Thanks a lot
> Mario



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to