Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hornetq can't start, error: NATIVE_ERROR_CANT_OPEN_CLOSE_FILE

Tags:

ubuntu

hornetq

all. I am trying to start using a torquebox application server (JBoss AS7) and everything seems to be ok, except the messaging subsystem. At first I thought it was an error with my torquebox setup, but then I downloaded standalone HornetQ (2.3.0 final) and tried to run the bin/start.sh. The same error occured:

21:29:03,128 WARN  [org.hornetq.core.server] HQ222010: Critical IO Error, shutting down the server. file=AIOSequentialFile:/home/gintaras/Downloads/hornetq-2.3.0.Final/bin/../data/journal/hornetq-data-1.hq.tmp, message=Can't open file: HornetQException[errorType=NATIVE_ERROR_CANT_OPEN_CLOSE_FILE message=Can't open file]
at org.hornetq.core.asyncio.impl.AsynchronousFileImpl.init(Native Method) [hornetq-journal.jar:]
at org.hornetq.core.asyncio.impl.AsynchronousFileImpl.open(AsynchronousFileImpl.java:220) [hornetq-journal.jar:]
at org.hornetq.core.journal.impl.AIOSequentialFile.open(AIOSequentialFile.java:190) [hornetq-journal.jar:]

I also added a comment here with some more info: https://issues.jboss.org/browse/HORNETQ-818 (last post by Gintaras)

Any ideas whats wrong?

like image 540
HouseMD Avatar asked Jan 13 '23 12:01

HouseMD


1 Answers

It seems you are starting the system on a configuration that doesn't support direct IO. you can just switch it to NIO.

   <subsystem xmlns="urn:jboss:domain:messaging:1.1">
        <hornetq-server>
            <persistence-enabled>true</persistence-enabled>
            ...
            **<journal-type>NIO</journal-type>**

libAIO needs direct access to the files, meaning DMA and direct writes, and an encripted file will put an extra layer so you won't be able to have direct access to the files.

If you need that you can use NIO which will use regular java NIO files.

If you don't need that you will have to move the journal directory away from the encripted files.

I have also written at the thread you mentioned here: https://community.jboss.org/message/750503

like image 131
Clebert Suconic Avatar answered Jan 16 '23 03:01

Clebert Suconic