Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception with null problems in "Property.path()" #138

Closed
LarsArtmann opened this issue Jun 23, 2019 · 11 comments
Closed

Exception with null problems in "Property.path()" #138

LarsArtmann opened this issue Jun 23, 2019 · 11 comments

Comments

@LarsArtmann
Copy link

http://prntscr.com/o5h5gl

MongoPlayerEntryHandler: https://gist.github.com/LartyHD/83a39b010c6976a6339032b4a5b6e4f1
PlayerId: https://gist.github.com/LartyHD/fcc75723df3582948504b6494635bc97

@LarsArtmann
Copy link
Author

kmongo don't support inline classes, dose it?

@LarsArtmann
Copy link
Author

@zigzago
Copy link
Member

zigzago commented Jun 23, 2019

The root exception is : "Service ClassMappingTypeService not found".
If you look at the source code (https://github.com/Litote/kmongo/blob/master/kmongo-shared/src/main/kotlin/org/litote/kmongo/service/ClassMappingType.kt#L26), you can see that ClassMappingTypeServices are loaded using ServiceLoader mechanism : it seems you have a classpath issue.

Checks that you have this file in your classpath: https://github.com/Litote/kmongo/blob/master/kmongo-jackson-mapping/src/main/resources/META-INF/services/org.litote.kmongo.service.ClassMappingTypeService

@LarsArtmann
Copy link
Author

It is already in the jar file

@zigzago
Copy link
Member

zigzago commented Jun 25, 2019

Please provide a reproducible test case

@LarsArtmann
Copy link
Author

The Velocity version of (AstrideUG/MC-Data@5d33b74) (the Jar (in the Zip))
in the plugins folder of a Velocity Server version 1.0.0

@zigzago
Copy link
Member

zigzago commented Jul 6, 2019

@LartyHD IS there other lib in the classpath? When I try to use the jar, I have this exception :

java.lang.ClassNotFoundException: org.bson.codecs.pojo.annotations.BsonId

Because there is no mongo java driver class

And If I add the bson-3-10-2.jar in the classpath( where there is already only MCData-Velocity-1.0.0.jar + kotlin runtime), this code returns null as expected:

class A(val r:String)

/**
*
*/
fun main() {
println(ClassMappingType.findIdProperty(A::class))
}

// -> print null - no error

@LarsArtmann
Copy link
Author

@zigzago sorry i forgot the lib 😞
You can get it here: https://workupload.com/file/wd3ZaXQG

@zigzago
Copy link
Member

zigzago commented Aug 14, 2019

@LartyHD Still ok with the additional jar - and still no bson dependency in it

By the way there is no class org.litote.kmongo.jackson.JacksonClassMappingTypeService in the two jars you provide - and it's a problem ;)

@LarsArtmann
Copy link
Author

LarsArtmann commented Aug 28, 2019

@zigzago i added the missing class and bson to the jar.
I had this exeption in my test: http://prntscr.com/oyf0rl
I found this line: https://github.com/Litote/kmongo/blob/master/kmongo-shared/src/main/kotlin/org/litote/kmongo/service/ClassMappingType.kt#L38 an i don't know whats the problem is, again 😬

@zigzago
Copy link
Member

zigzago commented Oct 13, 2019

Sorry but I have not more time to expore a particular case that look like a class path issue

@zigzago zigzago closed this as completed Oct 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants