spring-projects / spring-data-mongodb

Provides support to increase developer productivity in Java when using MongoDB. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-mongodb/
Apache License 2.0
1.62k stars 1.09k forks source link

Remove use of Class.forName to support use in an OSGi environment [DATAMONGO-194] #1129

Closed spring-projects-issues closed 11 years ago

spring-projects-issues commented 13 years ago

Mark Pollack opened DATAMONGO-194 and commented

Investigate status of mongodb library and other deps for osgi readyness


Affects: 1.0 M3

Issue Links:

5 votes, 4 watchers

spring-projects-issues commented 13 years ago

Oliver Drotbohm commented

Apparently the Mongo driver is not having a valid OSGi manifest yet. Querydsl also does not package the Bundlor generated manifest correctly (see this issue for details)

spring-projects-issues commented 13 years ago

Dmitry Axenenko commented

Method MappingMongoConverter.findTypeToBeUsed use Class.forName It's not valid for OSGI. Maybe use Thread.currentThread().getContextClassLoader().loadClass? Or some better?

spring-projects-issues commented 13 years ago

Dmitry Axenenko commented

Implemenatation of method " MappingMongoConverter.findTypeToBeUsed " uses "Class.forName". It doesn't work for OSGI platform. May be it will be better to use "Thread.currentThread().getContextClassLoader().loadClass" instead? Or can you propose better solution for it?

spring-projects-issues commented 13 years ago

Mark Pollack commented

This is now delegating to DefaultTypeMapper which in turn is now using Spirng's ClassUtils.forName that will be ok for osgi