SortedTableMap ClassFormatError issue

128 views
Skip to first unread message

SeanM

unread,
Aug 22, 2016, 1:40:36 PM8/22/16
to MapDB
I am looking to use MapDB for a project at work.  For some reason I am unable to use SortedTableMap.  When I try to use it I get a an java.lang.ClassFormatError exception.  I've had absolutely no problems using HTreeMap, so I'm not sure what could be causing this issue for SortedTableMap only?  Below is some example code (Scala) with stack trace incase it's helpful.

Thanks,

Sean

Exception in thread "main" java.lang.ClassFormatError: Class name contains illegal character '.' in descriptor in class file test/Test$
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at test.Test.main(Test.scala)

package test

import org.mapdb.serializer.SerializerArrayTuple
import org.mapdb.{Serializer, SortedTableMap}
import org.mapdb.volume.MappedFileVol


object Test {
def main(args: Array[String]): Unit = {
val volume = MappedFileVol
.FACTORY
.makeVolume("/tmp/mapdbvolume", false)


val sink = SortedTableMap.create(
volume,
Serializer.STRING,
new SerializerArrayTuple(Serializer.STRING, Serializer.STRING)
)

sink.createFromSink() // calling this this is what causes the exception
}
}

SeanM

unread,
Aug 22, 2016, 2:00:26 PM8/22/16
to MapDB
Actually, it appears to be an issue with sinks in general.  With the other map types I wasn't using sinks before.  I can trigger the same behavior with:

DBMaker
.fileDB("/tmp/mapdbtest")
.make()
.treeMap("test", Serializer.STRING, Serializer.STRING)
.createFromSink() // causes same exception

It's strange because all the unit tests work in mapdb work great for me (I tried building and using 3.0.2-SNAPSHOT). But in my project I get the CassFormatError when the class loader is called.  Without sinks mapdb works great.  So, it seems to be related to something dealing with sinks.  Does anyone have any insight as to what could be going on?

Thanks

Sean

Jan Kotek

unread,
Aug 22, 2016, 2:09:56 PM8/22/16
to ma...@googlegroups.com
Will look soon. 

There is some documentation which applies to not yet released 3.1

Jan
--
You received this message because you are subscribed to the Google Groups "MapDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapdb+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

SeanM

unread,
Aug 22, 2016, 6:23:00 PM8/22/16
to MapDB
Thanks, it seems to just be some odd issue with Scala I think.  In the same project I created a java class to access the sink and it works fine from there for some reason.

Cheers,

Sean
Reply all
Reply to author
Forward
0 new messages