HouseMD
HouseMD

Reputation: 242

hornetq can't start, error: NATIVE_ERROR_CANT_OPEN_CLOSE_FILE

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?

Upvotes: 4

Views: 2072

Answers (3)

Ondrej Burkert
Ondrej Burkert

Reputation: 7272

In my case it was caused by the libaio1 installed as a dependency of Amarok and MySQL. I haven't used any of the two so I just uninstalled it and HornetMQ started normally.

Upvotes: 0

Clebert Suconic
Clebert Suconic

Reputation: 5383

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

Upvotes: 8

Francisco
Francisco

Reputation: 4110

As far as I know, disk encryption should not be a problem for as long as the partition is mounted as, say, ext4. FWIW, you added a lot information to that bug report but nothing on the exact version of the libaio that you are using (which was the source of the problem of the original bug reported of that case).

You should consider bringing this issue to the HornetQ Users forum where more people (with HQ experience) would be able to share their experience with you. Stackoverflow works well for simple objective questions, but for something that requires a discussion, a user forum is probably a better place to go.

https://community.jboss.org/en/hornetq?view=discussions

Upvotes: 1

Related Questions