Приложение мигрировало в jboss 7.2. Но я получаю ошибку версии Hibernate. Поэтому я обновил версию hibernate до 5, чтобы убрать эту ошибку. Теперь я получаю следующую ошибку. Я обновил постоянство. xml, pom. xml, сервлет. xml
Error.txt
09:40:57,019 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0207: Starting subdeployment (runtime-name: "oper-alerts-web.war")
09:41:09,473 INFO [org.jboss.as.jpa] (MSC service thread 1-6) WFLYJPA0002: Read persistence.xml for ODSPersistenceUnit
09:41:09,644 WARN [org.jboss.as.jsf] (MSC service thread 1-2) WFLYJSF0005: Unknown JSF version 'NONE'. Default version'main' will be used instead.
09:41:13,091 WARN [org.jboss.weld.deployer] (MSC service thread 1-5) WFLYWELD0013: Deployment ODS-oper-alerts-ear.ear contains CDI annotations but no bean archive was found (no beans.xml or class with bean defining annotations was present)
.
09:41:13,308 WARN [org.jboss.as.ee] (MSC service thread 1-5) WFLYEE0007: Not installing optional component org.springframework.http.server.reactive.ServletServerHttpRequest$RequestAsyncListener due to an exception (enable DEBUG log level t
o see the cause)
09:41:13,315 WARN [org.jboss.as.ee] (MSC service thread 1-5) WFLYEE0007: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to an exception (enable DEBUG log level to see the cause)
09:41:13,317 WARN [org.jboss.as.ee] (MSC service thread 1-5) WFLYEE0007: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to an exception (enable DEBUG log level to see the
cause)
09:41:13,364 WARN [org.jboss.as.ee] (MSC service thread 1-5) WFLYEE0007: Not installing optional component org.springframework.http.server.reactive.ServletServerHttpResponse$ResponseAsyncListener due to an exception (enable DEBUG log level
to see the cause)
09:41:13,381 WARN [org.jboss.as.ee] (MSC service thread 1-5) WFLYEE0007: Not installing optional component org.springframework.http.server.reactive.ServletHttpHandlerAdapter$HandlerResultAsyncListener due to an exception (enable DEBUG log
level to see the cause)
09:41:15,049 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("depl
oy") failed - address: ([("deployment" => "ODS-oper-alerts-ear.ear")]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.persistenceunit.\"ODS-oper-alerts-ear.ear/oper-alerts-web.war#ODSPersistenceUnit\""],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"jboss.naming.context.java.module.ODS-oper-alerts-ear.oper-alerts-web.env.\"org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean\".entityManager is missing [jboss.persistenceunit.\"ODS-oper-alerts-ear.ear/oper-al
erts-web.war#ODSPersistenceUnit\"]",
"jboss.naming.context.java.module.ODS-oper-alerts-ear.oper-alerts-web.env.\"org.springframework.data.jpa.repository.support.QueryDslRepositorySupport\".entityManager is missing [jboss.persistenceunit.\"ODS-oper-alerts-ear.ear/oper-a
lerts-web.war#ODSPersistenceUnit\"]"
]
}
09:41:15,775 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0010: Deployed "ojdbc6.jar" (runtime-name : "oj
dbc6.jar")
09:41:15,777 INFO [org.jboss.as.server] (ServerService Thread Pool -- 42) WFLYSRV0010: Deployed "ODS-oper-alerts-ear.ea
r" (runtime-name : "ODS-oper-alerts-ear.ear")
09:41:15,916 INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.persistenceunit."ODS-oper-alerts-ear.ear/oper-alerts-web.war#ODSPersistenceUnit" (missing) dependent
s: [service jboss.naming.context.java.module.ODS-oper-alerts-ear.oper-alerts-web.env."org.springframework.data.jpa.repos
itory.support.QueryDslRepositorySupport".entityManager, service jboss.naming.context.java.module.ODS-oper-alerts-ear.ope
r-alerts-web.env."org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean".entityManager]
WFLYCTL0448: 122 additional services are down due to their dependencies being missing or failed
09:41:16,918 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
09:41:17,071 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://12
7.0.0.1:9990/management
09:41:17,270 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
09:41:17,426 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: JBoss EAP 7.2.0.GA (WildFly Core 6.0.11.Final-re
dhat-00001) started (with errors) in 87485ms - Started 856 of 1167 services (123 services failed or missing dependencies
, 339 services are lazy, passive or on-demand)
Постоянство. xml
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd "version =" 2.0 ">
<persistence-unit name="ODSPersistenceUnit" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>java:jboss/datasources/OracleDS</jta-data-source>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="jboss.as.jpa.managed" value="false" />
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
<property name="hibernate.default_schema" value="ODS" />
<property name="hibernate.globally_quoted_identifiers" value="true" />
<property name="hibernate.archive.autodetection" value="class" />
<property name="hibernate.jdbc.batch_size" value="500" />
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
<!-- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup" /> -->
</properties>
</persistence-unit>
сервлет. xml
<mvc:annotation-driven>
<mvc:argument-resolvers>
<bean class="org.springframework.security.web.method.annotation.AuthenticationPrincipalArgumentResolver" />
</mvc:argument-resolvers>
<mvc:message-converters register-defaults="false">
<bean id="jacksonMessageConverter" class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" />
</mvc:message-converters>
</mvc:annotation-driven>
<mvc:cors>
<mvc:mapping path="/api/**" />
</mvc:cors>
<context:component-scan base-package="com" />
<tx:annotation-driven />
<aop:aspectj-autoproxy proxy-target-class="true" />
<mvc:resources mapping="/resources/**" location="/resources/" />
<mvc:resources mapping="/js/**" location="/js/" />
<mvc:resources mapping="/js-min/**" location="/js-min/" />
<!-- Used to use any existing transaction managers -->
<tx:jta-transaction-manager />
<jpa:repositories base-package="com.repository" entity-manager-factory-ref="entityManagerFactory" />
<jee:jndi-lookup id="dealerAlertDataSource" jndi-name="java:jboss/datasources/OTDS" proxy-interface="javax.sql.DataSource" />
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="systemPropertiesMode" value="2" />
<property name="locations">
<list>
<value>classpath:security-config/env/qa/security.properties</value>
<value>classpath:config/webservices/serviceLocation.properties</value>
<value>classpath:config/pcs.properties</value>
</list>
</property>
</bean>
<import resource="operational-dashboard-ldap.xml" />
<import resource="security-config/legacy/operational-dashboard-security.xml" />
<!-- <import resource="security-config/legacy/operational-dashboard-security.xml" /> -->
<import resource="spring-ws-servlet.xml" />
<import resource="od-cache.xml" />
<!-- ================================================================== -->
<!-- === Basic Configuration -->
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" >
<property name="persistenceUnitName" value="ODSPersistenceUnit" />
</bean>
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
<bean id="beanNameViewResolver" class="org.springframework.web.servlet.view.BeanNameViewResolver">
<property name="order" value="1" />
</bean>
<bean id="internalResourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="order" value="2" />
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<property name="order" value="3" />
<property name="defaultViews">
<list>
<bean class="org.springframework.web.servlet.view.json.MappingJackson2JsonView" />
</list>
</property>
</bean>
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" />
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" />
<bean class="org.springframework.http.converter.FormHttpMessageConverter" />
</list>
</property>
</bean>
<bean id="exceptionHandlerExceptionResolver" class="org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver" />
<bean id="responseStatusExceptionResolver" class="org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver" />
<!-- <mvc:interceptors> <bean class="com.web.security.NTLMInterceptor" /> </mvc:interceptors> -->
<!-- Spring-security stuff to be added on a future version -->
<!-- Aspect -->
<bean id="environmentAspect" class="com.aspect.EnvironmentAspect" />
DealerAlarmRepository. java
@ Repository publi c class DealerAlarmRepository {
private SimpleJdbcCall summaryCall;
private SimpleJdbcCall detailedCall;
private static Logger LOGGER = LoggerFactory.getLogger(DealerAlarmRepository.class);
@Autowired
@Qualifier("dealerAlertDataSource")
public void setDataSource(DataSource dataSource) {
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
pom. xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>oper-alerts-persistence</artifactId>
<packaging>jar</packaging>
<name>Test</name>
<properties>
<spring.version>5.1.6.RELEASE</spring.version>
<log4j.version>1.2.14</log4j.version>
<junit.version>4.10</junit.version>
<jackson.version>2.8.5</jackson.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<slf4j.version>1.5.8</slf4j.version>
<mockito.version>1.9.5</mockito.version>
</properties>
<dependencies>
<!-- Jackson JSON Mapper -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<!-- Just the annotations; use this dependency if you want to attach annotations
to classes without connecting them to the code. -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
<!-- databinding; ObjectMapper, JsonNode and related classes are here -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.dbunit</groupId>
<artifactId>dbunit</artifactId>
<version>2.4.8</version>
<type>jar</type>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.springtestdbunit</groupId>
<artifactId>spring-test-dbunit</artifactId>
<version>1.2.1</version>
</dependency>
<!-- Core Spring Dependencies (and appropriate logging exclusions) -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Spring AOP + AspectJ -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.6.11</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.6.11</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.10.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.3.7.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.3.7.Final</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.7</version>
</dependency>
<!-- H2 Dependencies -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.167</version>
</dependency>
</dependencies>
<parent>
<artifactId>oper-alerts-parent</artifactId>
<groupId>com</groupId>
<version>4.0.22-SNAPSHOT</version>
</parent>
</project>