Веб-сервис Spring не развертывается в jboss - PullRequest
0 голосов
/ 05 мая 2020

Разработал веб-сервис с использованием Spring и Hibernate. Развернул реализованный веб-сервис в Tomcat 7.0.99. Работает как положено. При попытке развернуть то же самое в jboss eap 6.4.0 получается ошибка ниже

18:14:06,517 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/SampleWS-API-0.0.1]] (ServerService Thread Pool -- 60) JBWEB000287: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customerServiceImpl': Unsatisfied dependency expressed through field 'customerDao'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customerDaoImpl': Unsatisfied dependency expressed through field 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getSessionFactory' defined in com.tch.spring.config.HibernateConfig: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.internal.CoreMessageLogger.debugf(Ljava/lang/String;II)V

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'customerDaoImpl': Unsatisfied dependency expressed through field 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getSessionFactory' defined in com.tch.spring.config.HibernateConfig: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.internal.CoreMessageLogger.debugf(Ljava/lang/String;II)V
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getSessionFactory' defined in com.tch.spring.config.HibernateConfig: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.internal.CoreMessageLogger.debugf(Ljava/lang/String;II)V
Caused by: java.lang.NoSuchMethodError: org.hibernate.internal.CoreMessageLogger.debugf(Ljava/lang/String;II)V

18:14:06,527 ERROR [org.apache.catalina.core] (ServerService Thread Pool -- 60) JBWEB001103: Error detected during context /SampleWS-API-0.0.1 start, will stop it
18:14:06,529 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/SampleWS-API-0.0.1]] (ServerService Thread Pool -- 60) Closing Spring root WebApplicationContext
18:14:06,548 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 60) MSC000001: Failed to start service jboss.web.deployment.default-host."/SampleWS-API-0.0.1": org.jboss.msc.service.StartException in service jboss.web.deployment.default-host."/SampleWS-API-0.0.1": org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
18:14:06,557 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014612: Operation ("deploy") failed - address: ([("deployment" => "SampleWS-API-0.0.1.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host.\"/SampleWS-API-0.0.1\"" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host.\"/SampleWS-API-0.0.1\": org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context
    Caused by: org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context"}}
18:14:06,600 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS015859: Deployed "SampleWS-API-0.0.1.war" (runtime-name : "SampleWS-API-0.0.1.war")
18:14:06,602 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.web.deployment.default-host."/SampleWS-API-0.0.1": org.jboss.msc.service.StartException in service jboss.web.deployment.default-host."/SampleWS-API-0.0.1": org.jboss.msc.service.StartException in anonymous service: JBAS018040: Failed to start context

18:14:06,620 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://0.0.0.0:9990/management
18:14:06,620 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://0.0.0.0:9990
18:14:06,620 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss EAP 6.4.0.GA (AS 7.5.0.Final-redhat-21) started (with errors) in 12653ms - Started 514 of 555 services (2 services failed or missing dependencies, 60 services are lazy, passive or on-demand)
18:14:06,887 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment SampleWS-API-0.0.1.war (runtime-name: SampleWS-API-0.0.1.war) in 58ms
18:14:06,927 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015858: Undeployed "SampleWS-API-0.0.1.war" (runtime-name: "SampleWS-API-0.0.1.war")
18:14:06,938 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014775:    New missing/unsatisfied dependencies:
JBAS014777:   Services which failed to start:      service jboss.web.deployment.default-host."/SampleWS-API-0.0.1"

customerDao и sessionFactory подключены автоматически

 @Service
    public class CustomerServiceImpl implements CustomerService {
        private static final Logger logger = CustomLogger.getLogger(CustomerServiceImpl.class);
       @Autowired
   private CustomerDao customerDao;

============================================

    @Repository
    public class CustomerDaoImpl implements CustomerDao {
        private static final Logger logger = CustomLogger.getLogger(CustomerDaoImpl.class);
        @Autowired
        private SessionFactory sessionFactory;

pom. xml file:

<spring.version>5.2.0.RELEASE</spring.version>
<hibernate.version>5.2.11.Final</hibernate.version>
<hibernate.validator>5.4.1.Final</hibernate.validator>

Как избавиться от этой ошибки ?? Сообщите мне, если я пропущу какие-либо детали

...