neo4j/community — pull request #412 by alexsmirnov (2012-04-13 08:03:40+00:00)
Title: Jboss 7 classloader compatibility

Jboss 7 classloader removes content of META-INF/services from Thread#currentThread#getContextClassLoader by default. https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7
At the same time, Neo4j org.neo4j.helpers.Service class uses java.util.ServiceLoader#load(Class serviceClass) call that tries to find service descriptions using context class loader.
Therefore, if application creates instance of GraphDatabase deployed in separate Jboss7 module, it cannot find any custom service defined in that module. It affects both neo4j-connector and Spring data-graph/neo4j as well.
Proposed patch tries to load services using context class loader first ( to not break any existing code if it relies on the current behavior ) and, if service not found, using classloader wich loads Neo4j kernel itself.