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
Add a comment  | 

1 Answer 1

Reset to default 0

The 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