При преобразовании проекта в spring5 и hibernate 5.2.17 возникает исключение при запуске в jboss 7.1 AP - PullRequest
0 голосов
/ 23 апреля 2019

Я обновляю проект spring-web-mvc на spring5, JDK1.8 и hibernate5.2.17.Проект хорошо компилируется и развертывается в Jboss 7.1.AP, но когда я пытаюсь войти в приложение, он выдает следующую ошибку:

ERROR [default task-2] aspect.ICAMExceptionHandler  - A NestedServletException has occured in the application
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.Session.createSQLQuery(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.ServletSecurityRo

pom.xml

</dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
             <version>5.2.17.Final</version>
            <!-- <version>3.3.2.GA</version>  -->

        </dependency>
        <dependency>
            <groupId>org.hibernate.common</groupId>
            <artifactId>hibernate-commons-annotations</artifactId>
            <version>5.0.1.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>5.2.17.Final</version>

Как только я понижаю спящий режим до 5.0.12. Наконец , я получаю другую ошибку

Apr 23 14:45:29 ERROR [default task-2] stderr  - java.lang.NullPointerException
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.hibernate.internal.util.collections.BoundedConcurrentHashMap.get(BoundedConcurrentHashMap.java:1851)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.hibernate.engine.query.spi.QueryPlanCache.getSQLParameterMetadata(QueryPlanCache.java:123)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.hibernate.internal.AbstractSessionImpl.createSQLQuery(AbstractSessionImpl.java:252)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.hibernate.internal.SessionImpl.createSQLQuery(SessionImpl.java:1914)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at com.gee.gecs.cosmos.dao.BaseDao.loadTransformedObjectWithNativeSQL(BaseDao.java:350)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at com.gee.gecs.cosmos.dao.ServiceDaoImpl.getUserValidation(ServiceDaoImpl.java:448)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at java.lang.reflect.Method.invoke(Method.java:498)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:338)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at com.sun.proxy.$Proxy116.getUserValidation(Unknown Source)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at com.gee.gecs.cosmos.services.ServiceLayerImpl.getUserValidation(ServiceLayerImpl.java:1800)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at com.gee.gecs.cosmos.services.security.SecuritySvcImpl.getUserValidation(SecuritySvcImpl.java:85)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at com.gee.gecs.cosmos.cmd.security.GetUserDetailsCmd.perform(GetUserDetailsCmd.java:77)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at com.gee.gecs.cosmos.cmd.security.GetUserDetailsCmd$$FastClassBySpringCGLIB$$4403c7d7.invoke(<generated>)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:747)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at com.gee.gecs.cosmos.cmd.security.GetUserDetailsCmd$$EnhancerBySpringCGLIB$$8d294553.perform(<generated>)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at com.gee.gecs.cosmos.controller.LegalController.printWelcome(LegalController.java:45)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at com.gee.gecs.cosmos.controller.LegalController$$FastClassBySpringCGLIB$$a04eb3fb.invoke(<generated>)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:747)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:89)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at com.gee.gecs.cosmos.aspect.ExceptionAspectHandler.handleControllerExceptionsWithAroundReturnString(ExceptionAspectHandler.java:45)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at java.lang.reflect.Method.invoke(Method.java:498)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:643)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:632)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at com.gee.gecs.cosmos.controller.LegalController$$EnhancerBySpringCGLIB$$ec0a9239.printWelcome(<generated>)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at java.lang.reflect.Method.invoke(Method.java:498)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:871)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:777)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:881)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
Apr 23 14:45:29 ERROR [default task-2] stderr  -    at org.springframework.web.servlet.FrameworkS

1 Ответ

0 голосов
/ 23 апреля 2019

https://docs.oracle.com/javase/7/docs/api/java/lang/NoSuchMethodError.html

NoSuchMethodError is caused when the called method does not exists. In your case: org.hibernate.Session.createSQLQuery(String)

Пожалуйста, проверьте, подходит ли версия Hibernate для использования с другими библиотеками.

Похоже на проблему совместимости.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...