Posts Tagged ‘java’

Cassandra: java.io.IOError: java.io.IOException: Map failed

Wednesday, April 20th, 2011

Today we ran into a problem with Cassandra in which Cassandra failed to start with the following stack trace:

ERROR 2011-04-18 12:53:01,759 Fatal exception in thread Thread[FlushWriter:1,5,main] 
java.io.IOError: java.io.IOException: Map failed 
at org.apache.cassandra.io.util.MmappedSegmentedFile$Builder.createSegments(MmappedSegmentedFile.java:172) 
at org.apache.cassandra.io.util.MmappedSegmentedFile$Builder.complete(MmappedSegmentedFile.java:149) 
at org.apache.cassandra.io.sstable.SSTableWriter.closeAndOpenReader(SSTableWriter.java:190) 
at org.apache.cassandra.io.sstable.SSTableWriter.closeAndOpenReader(SSTableWriter.java:169) 
at org.apache.cassandra.db.Memtable.writeSortedContents(Memtable.java:163) 
at org.apache.cassandra.db.Memtable.access$000(Memtable.java:51) 
at org.apache.cassandra.db.Memtable$1.runMayThrow(Memtable.java:176) 
at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:30) 
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) 
at java.lang.Thread.run(Thread.java:662) 
Caused by: java.io.IOException: Map failed 
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:748) 
at org.apache.cassandra.io.util.MmappedSegmentedFile$Builder.createSegments(MmappedSegmentedFile.java:164) 
... 10 more 
Caused by: java.lang.OutOfMemoryError: Map failed 
at sun.nio.ch.FileChannelImpl.map0(Native Method) 
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:745) 
... 11 more

(more…)

GlassFish 3.0.1 on Debian Lenny, Puppet style

Thursday, August 5th, 2010

Recently, I found a way to make the GlassFish supplied pkg(5) tool run using Debian’s python interpreter and associated libs. I also spent a while trying to package it in a sane way, but I’m afraid I lack the knowledge of Java and Debian package internals to do this properly (I’ve requested the package, though). But in the meantime we still need a nice way to setup GlassFish on a Debian Lenny machine. So I’ve turned to puppet, as usual.

You can find the module here: glassfish.tar.bz2 (12.8kB)

It doesn’t contain everything, though. You still need to download the glassfish ZIP file from here and rename that file to glassfish.zip and add it in the files directory of the module. After that, you can just include glassfish and it gets set-up!
(more…)

GlassFish 3.0.1’s pkg tool using Debian’s Python packages

Friday, July 23rd, 2010

While setting up GlassFish 3.0.1 for a customer on Debian Lenny using 64 bit machines, I ran into the problem that the update tool shipped with GlassFish (OpenSolaris‘s pkg tool) uses a Python interpreter which is part of the package. That Python interpreter however is 32 bit, which requires the ia32 libraries to be installed. Worse, it requires lididn in 32 bit, which is not part of the default Debian packages, so I had to get that one from the (very nice) Debian Multimedia repository. Although that’s a quick fix to get stuff working, we rather not use these repositories on production machines, due to security concerns and the like. Also, upgrades are easier if you only use the standard Debian repositories.

So I decided to see if I could get it working with the Debian supplied Python interpreter. One problem is that there’s a shared object file written in C which is part of the pkg application. That file is a 32 bit ELF too. So we’re going to download that source and recompile it for 64 bit. If you’re on a 32 bit system, you can skip that step (although it doesn’t hurt to do it anyway). First, we need to install the following packages:
(more…)