0

I'm trying to get hibernate-ogm-neo4j (5.1.0.Alpha1) running in my glassfish (4.1.1). When starting the application server with the datastorprovider <property name="hibernate.ogm.datastore.provider" value="neo4j_embedded"/> it shows a long stacktrace constantly repeating the following exceptions:

java.util.ServiceConfigurationError: org.neo4j.kernel.extension.KernelExtensionFactory: Provider org.neo4j.jmx.impl.JmxExtensionFactory not a subtype
java.util.ServiceConfigurationError: org.neo4j.kernel.extension.KernelExtensionFactory: Provider org.neo4j.index.lucene.LuceneKernelExtensionFactory not a subtype
java.util.ServiceConfigurationError: org.neo4j.kernel.extension.KernelExtensionFactory: Provider org.neo4j.kernel.api.impl.labelscan.LuceneLabelScanStoreExtension not a subtype
java.util.ServiceConfigurationError: org.neo4j.kernel.extension.KernelExtensionFactory: Provider org.neo4j.kernel.api.impl.schema.LuceneSchemaIndexProviderFactory not a subtype
java.util.ServiceConfigurationError: org.neo4j.kernel.extension.KernelExtensionFactory: Provider org.neo4j.ext.udc.impl.UdcKernelExtensionFactory not a subtype

Using the <property name="hibernate.ogm.datastore.provider" value="neo4j_bolt"/> the exceptions change to

java.util.ServiceConfigurationError: org.neo4j.driver.internal.spi.Connector: Provider org.neo4j.driver.internal.connector.socket.SocketConnector not a subtype

I would prefer to connect in the Bolt mode but I am not sure if I misconfigured something or if it is a bug in hibernate-ogm or neo4j.

This is my complete persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">

  <persistence-unit name="ogm-neo4j" transaction-type="JTA">
      <provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
      <properties>
        <property name="hibernate.ogm.datastore.provider" value="neo4j_bolt"/>
        <property name="hibernate.ogm.neo4j.database_path" value="C:\temp\vtc.neo4j" />
      </properties>
  </persistence-unit>
</persistence>

Update

I looked a little bit deeper into the error message. It is actually thrown in the Java ServiceLoader class and says something like org.neo4j.driver.internal.spi.Connector is not a superclass of org.neo4j.driver.internal.connector.socket.SocketConnector. But of course it is

public class SocketConnector implements Connector

And there is also a META-INF.services description in the related neo4j-java-driver-1.0.4.jar which contains the path expected absolut class name org.neo4j.driver.internal.connector.socket.SocketConnector.

This makes me even more confused. Do I have to apply this configuration to my Glassfish because it is not done automatically?

Update 2

The issue disappears if neo4j-java-driver-1.1.0-M6.jar is used (just declare the dependency in your pom and it will be used instead of 1.0.4. which is bundled with hibernate-ogm-neo4j-5.1.0.Alpha1). Still no clue whats wrong with version 1.0.x though, but I've contacted the developers to find it out.

Richard
  • 582
  • 5
  • 19
  • Do you think you can create a test or example project for this issue? – Davide D'Alto Nov 14 '16 at 15:14
  • I've created an example project on github: https://github.com/Restage/HibernateOgmExample Just run a neo4j instance with the given connection settings from the persistence.xml and than deploy the ear on a glassfish and hopefully you will see the issue. For me changing the neo4j-java-driver to version 1.1.0-M6 resolved the problem. I've also created an issue at their project page (https://github.com/neo4j/neo4j-java-driver/issues/261) but did not receive any comment yet. If you've got any issues to reproduce the error just let me know. – Richard Nov 16 '16 at 18:10

0 Answers0