0

Im using following hibernate jars [1]; When I deploy my war file in wildfly 9 I get following error.

How can I overcome this issue?

5:34:53,204 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 88) MSC000001: Failed to start service jboss.persistenceunit."test2dbwar.war#test2dbwar-persistence-unit": org.jboss.msc.service.StartException in service jboss.persistenceunit."test2dbwar.war#test2dbwar-persistence-unit": java.util.ServiceConfigurationError: org.hibernate.service.spi.ServiceContributor: Provider org.hibernate.spatial.integration.SpatialInitializer not a subtype
    at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172)
    at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117)
    at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:665)
    at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.util.ServiceConfigurationError: org.hibernate.service.spi.ServiceContributor: Provider org.hibernate.spatial.integration.SpatialInitializer not a subtype
    at java.util.ServiceLoader.fail(ServiceLoader.java:239)
    at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
    at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.loadJavaServices(ClassLoaderServiceImpl.java:341)
    at org.hibernate.boot.registry.StandardServiceRegistryBuilder.applyServiceContributors(StandardServiceRegistryBuilder.java:270)
    at org.hibernate.boot.registry.StandardServiceRegistryBuilder.build(StandardServiceRegistryBuilder.java:249)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.buildServiceRegistry(EntityManagerFactoryBuilderImpl.java:1035)
    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842)
    at org.jboss.as.jpa.hibernate4.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)
    at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154)
    ... 7 more

15:34:53,211 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 12) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "test2dbwar.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"test2dbwar.war#test2dbwar-persistence-unit\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"test2dbwar.war#test2dbwar-persistence-unit\": java.util.ServiceConfigurationError: org.hibernate.service.spi.ServiceContributor: Provider org.hibernate.spatial.integration.SpatialInitializer not a subtype
    Ca

[1]

  • hibernate-core-5.1.0.Final.jar
  • hibernate-entitymanager-5.0.1.Final.jar
  • hibernate-java8-5.1.0.Final.jar
  • hibernate-jpa-2.1-api-1.0.0.Final.jar
  • hibernate-spatial-5.1.0.Final.jar
  • hibernate-validator-5.2.1.Final.jar

EDIT Jboss-deployment-structure.xml;

<jboss-deployment-structure >

  <deployment>

     <!-- exclude-subsystem prevents a subsystems deployment unit processors running on a deployment -->

     <!-- which gives basically the same effect as removing the subsystem, but it only affects single deployment -->

     <exclude-subsystems>

        <subsystem name="org.hibernate" />

    </exclude-subsystems>

    <!-- Exclusions allow you to prevent the server from automatically adding some dependencies     -->

    <exclusions>

        <module name="org.hibernate" />

    </exclusions>

  </deployment>

</jboss-deployment-structure>
Ratha
  • 9,434
  • 17
  • 85
  • 163

1 Answers1

1

As with your previous question, you are likely to get all kind of surprising errors when you use incompatible versions. As you can see in the stack trace, you are actually using Hibernate 4 since Wildfly 9 includes Hibernate 4.

Community
  • 1
  • 1
user140547
  • 7,750
  • 3
  • 28
  • 80
  • I have excluded Hibernate 4 version in jboss-deployment structure.xml (Kept in WEB_INF folder root level)and allowing to use packaged jars in my war. I don't know how it still uses jboss libraries. After the jboss-deployment-structure.xml change,I get above issue. – Ratha May 31 '16 at 10:33
  • @Ratha: well, how does your jboss-deployment-structure.xml look like? – user140547 May 31 '16 at 10:59
  • I edited my question with my jboss-deployment-structure.xml – Ratha May 31 '16 at 11:03
  • @Ratha; maybe you have to exclude other stuff, like jpa as well. unfortunately, that is maybe not straightforward. if possible you could try if it works with Wildfly 10. – user140547 May 31 '16 at 11:43
  • I was able to overcome this Hibernate issue in wildfly 10, but unfornately, i had another issue in wildfly 10 with my kafka initialisation. (Please check http://stackoverflow.com/questions/36761018/jboss-gives-org-apache-kafka-common-kafkaexception-auth-conf-cannot-be-read) Due to that issue, I have moved to wildfly 9, where i didn't face that //auth.confcannot be read.// issue. – Ratha Jun 01 '16 at 04:27