1 Reply Latest reply on May 20, 2019 5:15 PM by Tomaž Cerar

    Hibernate jar clash in JBoss EAP7.1

    Romit Saha Newbie

      I have an ear application which uses hibernate5.2.17Final.jar. So I added the following in jboss-deployment-structure.xml to stop loading the default hibernate jars of the server.

      But I am still getting the below error..Any idea whats going wrong.

      My code compiles fine, but its giving this runtime error.

       

      <?xml version="1.0" encoding="UTF-8"?>

      <jboss-deployment-structure>

      <deployment>

      <exclude-subsystems>

      <subsystem name="org.hibernate" />

      <subsystem name="org.hibernate.validator" />

      <subsystem name="org.jboss.as.jpa.hibernate" />

      </exclude-subsystems>

      <exclusions>

      <module name="org.hibernate" />

      <module name="org.jboss.as.jpa.hibernate" />

      <module name="org.hibernate.validator" />

      <module name="org.apache.commons.logging" />

      </exclusions>

      </deployment>

      </jboss-deployment-structure>

       

      -----------------------------------------ERROR LOG ---------------------

       

       

      16:11:11,815 INFO  [com.gee.gecs.cosmos.dao.ServiceDaoImpl] (default task-2) ***************select cud.user_id validUser from cost_user cud where sso_id = ? and cud.rec_status_ind = '1'

      16:11:11,817 INFO  [com.gee.gecs.cosmos.dao.ServiceDaoImpl] (default task-2) ###############{validUser=org.hibernate.type.StringType@47b7b7e2}

      16:11:11,835 ERROR [com.gee.gecs.cosmos.aspect.ICAMExceptionHandler] (default task-2) A NestedServletException has occured in the application: org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.Session.createNativeQuery(Ljava/lang/String;)Lorg/hibernate/query/NativeQuery;

        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1006)

        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)

        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)

        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:881)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:855)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)

        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

        at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)

        at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

        at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

        at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)

        at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)

        at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

        at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)

        at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)

        at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)

        at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)

        at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)

        at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

        at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)

        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)

        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)

        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)