admin管理员组文章数量:1415119
I inherited java 7 app in my company and was tasked to upgrade it to java 8 and deploy on new jboss servers. I build the app with java 8 with no problem, tried to deploy it, fixed some minor bugs but then AbstractMethodError appeared.
{"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"gui-be-2.1.2.war#gui-be-pu\"" => "java.lang.AbstractMethodError
Caused by: java.lang.AbstractMethodError"}}
I read that either use same version on libs that are on Jboss or specify via jboss-deployment-structure.xml that use project libs. I tried to go with same versions approach, but had no luck.
The hibernate version I used is 5.3.14.Final. Same on jboss and in project poms.
Found some error logs in jboss:
(Caused by: java.lang.AbstractMethodError
at .hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:276)
at .hibernate.boot.internal.SessionFactoryBuilderImpl.build
(SessionFactoryBuilderImpl.java:467)
at .hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build
(EntityManagerFactoryBuilder Impl.java:939)
at .jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44))
*Edit: In maven config I have this.
<dependency>
<groupId>.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.5.2.RELEASE</version>
</dependency>
<!-- MySQl connector -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.29</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.3.14.Final</version>
</dependency>
<dependency>
<groupId>.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.1.0.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.3.15.RELEASE</version>
</dependency>
<dependency>
<groupId>.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>.jboss.arquillian.extension</groupId>
<artifactId>arquillian-persistence-impl</artifactId>
<version>1.0.0.Alpha6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<version>2.1.1.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
</dependency>
<dependency>
<groupId>.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
</dependency>
Jboss version is: JBoss EAP 7.3.0.GA (WildFly Core 10.1.2.Final-redhat-00001)
I inherited java 7 app in my company and was tasked to upgrade it to java 8 and deploy on new jboss servers. I build the app with java 8 with no problem, tried to deploy it, fixed some minor bugs but then AbstractMethodError appeared.
{"WFLYCTL0080: Failed services" => {"jboss.persistenceunit.\"gui-be-2.1.2.war#gui-be-pu\"" => "java.lang.AbstractMethodError
Caused by: java.lang.AbstractMethodError"}}
I read that either use same version on libs that are on Jboss or specify via jboss-deployment-structure.xml that use project libs. I tried to go with same versions approach, but had no luck.
The hibernate version I used is 5.3.14.Final. Same on jboss and in project poms.
Found some error logs in jboss:
(Caused by: java.lang.AbstractMethodError
at .hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:276)
at .hibernate.boot.internal.SessionFactoryBuilderImpl.build
(SessionFactoryBuilderImpl.java:467)
at .hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build
(EntityManagerFactoryBuilder Impl.java:939)
at .jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44))
*Edit: In maven config I have this.
<dependency>
<groupId>.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.5.2.RELEASE</version>
</dependency>
<!-- MySQl connector -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.29</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.3.14.Final</version>
</dependency>
<dependency>
<groupId>.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.1.0.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.3.15.RELEASE</version>
</dependency>
<dependency>
<groupId>.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>.jboss.arquillian.extension</groupId>
<artifactId>arquillian-persistence-impl</artifactId>
<version>1.0.0.Alpha6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<version>2.1.1.Final</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
</dependency>
<dependency>
<groupId>.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
</dependency>
Jboss version is: JBoss EAP 7.3.0.GA (WildFly Core 10.1.2.Final-redhat-00001)
Share Improve this question edited Feb 11 at 13:44 Croksie asked Feb 11 at 13:01 CroksieCroksie 217 bronze badges 5- please post your maven/gradle config, as well as your jboss/wildfly config files – N Sarj Commented Feb 11 at 13:18
- Added pom, please which jboss config file you mean? Fairly new to jboss so don't know which one, sorry. – Croksie Commented Feb 11 at 13:39
- 1 Can you please post the version of the new JBoss servers? – Francesco Poli Commented Feb 11 at 13:40
- As Francesco suggested above, please specify your jboss version(s). Also, just from a quick look, you need to update jboss javaee 6 with this mvnrepository/artifact/.jboss.spec/jboss-javaee-8.0 – N Sarj Commented Feb 11 at 13:47
- 1 Added jboss version, its eap 7.3.0GA – Croksie Commented Feb 11 at 14:13
1 Answer
Reset to default 0The problem was due to a version mismatch between the libraries. One of dependencies(a company-private lib) used jadira lib.
Since Hibernate was excluded(as shown in pom), it was not present in dependency tree, but the code was built with different version of Hibernate. Upgrading this lib to a newer version resolved the AbstractMethodError.
<dependency>
<groupId>.jadira.usertype</groupId>
<artifactId>usertype.core</artifactId>
<version>6.0.0.GA</version>
<exclusions>
<exclusion>
<groupId>.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</exclusion>
</exclusions>
</dependency>
本文标签: javaAbstractMethodError when deploing on jbossStack Overflow
版权声明:本文标题:java - AbstractMethodError when deploing on jboss - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745209929a2647821.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论