I am trying to use kotlin/jvm with neo4j and I end...
# announcements
a
I am trying to use kotlin/jvm with neo4j and I end getting
MalformedClass Name
Why is this?
s
More information is needed here. Can you give us maybe the first 3 lines of the stacktrace?
a
Somehow kotlin generate class names which aren't acceptable by the JVM. I am getting the following runtime error. kotlin 1.3.72
Copy code
java.lang.InternalError: Malformed class name
        at java.lang.Class.getSimpleName(Class.java:1330)
        at java.lang.Class.isAnonymousClass(Class.java:1411)
        at org.neo4j.ogm.metadata.DomainInfo.lambda$create$0(DomainInfo.java:81)
        at org.neo4j.ogm.metadata.DomainInfo.create(DomainInfo.java:93)
        at org.neo4j.ogm.metadata.MetaData.<init>(MetaData.java:66)
        at org.neo4j.ogm.session.SessionFactory.<init>(SessionFactory.java:114)
        at org.neo4j.ogm.session.SessionFactory.<init>(SessionFactory.java:100)
        at org.neo4j.ogm.session.SessionFactory.<init>(SessionFactory.java:89)
        at tz.co.asoft.Neo4jDao$session$2.invoke(Neo4jDao.kt:23)
        at tz.co.asoft.Neo4jDao$session$2.invoke(Neo4jDao.kt:13)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at tz.co.asoft.Neo4jDao.getSession(Neo4jDao.kt)
        at tz.co.asoft.Neo4jDao$all$2.invokeSuspend(Neo4jDao.kt:68)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
n
Can you set a breakpoint at DomainInfo.java:81 and see what the classname is?
a
After setting a breaking point. I managed to track down the problem (more of avoid the problem). It seems there is a third party lib (looks like it's build by scala) that has a class that doesn't fit to the java standards. So, I just made added my package to narrow down neo4j's scope for mapping classes
👍 1