简体   繁体   中英

Migrating web application from JBoss 7.1.1 + Java 6 to Wildfly 9.0.2 + Java 8

I'm trying to migrate an application from JBoss 7.1.1 to Wildfly 9.0.2, but I'm facing some problems.

The first thing that I'd made was remove all the PROVIDED dependencies, overwriting them for the specific version that JBoss 7.1.1 was providing to me. Otherwise I would use all the new versions from Wildfly 9, resulting in more errors.

Meanwhile, I'd also updated my JDK version from 6 to 8, without any compilation problems.

Well, I'd started Wildfly 9 and the project started normally. I was able to log in the application, check my credentials at my database and load the first page without any problems. But testing all the application, I started to face a lot of errors, as described below.

Searching for an update guide, I'd found something about Wildup project, but I'd wasn't able to finish the report. The performance is terrible and it freeze at [340/379] MigrationRulesPhase - ValidateXmlFilesRuleProvider - ValidateXmlFilesRuleProvider_1 .

**UPDAT

  • UPDATED:** Following @mjn's hint, I'd removed all JBoss specific dependencies from pom.xml and it didn't affect the project. But the problem quoted here still happ

ens. Pom.xml updated without this libs.

Can anybody help me, please? Thanks for the attention!

Cheers, Pimenta

Libs that was set as PROVIDED:

<groupId>org.jboss.spec.javax.el</groupId>
<artifactId>jboss-el-api_2.2_spec</artifactId>

<groupId>org.jboss.spec.javax.faces</groupId>
<artifactId>jboss-jsf-api_2.1_spec</artifactId>

<groupId>org.jboss.spec.javax.ejb</groupId>
<artifactId>jboss-ejb-api_3.1_spec</artifactId>

<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>

<groupId>org.jboss.spec.javax.annotation</groupId>
<artifactId>jboss-annotations-api_1.1_spec</artifactId>

<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>

<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>

Error:

2016-07-13 10:36:29 DEBUG component:402 - /pages/layout/rodape.xhtml @20,69 <h:outputLabel> Component[-494748661_63d08f28] Created: javax.faces.component.html.HtmlOutputLabel
2016-07-13 10:36:29 ERROR cad:81 - 
2016-07-13 10:36:29 ERROR context:218 - java.lang.StackOverflowError
    at org.apache.myfaces.extensions.cdi.jsf.impl.bv.resolver.SerializableValidatorFactory.getValidatorFactory(SerializableValidatorFactory.java:104)
    at org.apache.myfaces.extensions.cdi.jsf.impl.bv.resolver.InvalidValueAwareValidatorFactory.usingContext(InvalidValueAwareValidatorFactory.java:41)
    at org.jboss.as.ee.beanvalidation.LazyValidatorFactory.usingContext(LazyValidatorFactory.java:93)
    at org.apache.myfaces.extensions.cdi.jsf.impl.bv.resolver.InvalidValueAwareValidatorFactory.usingContext(InvalidValueAwareValidatorFactory.java:41)
    at org.jboss.as.ee.beanvalidation.LazyValidatorFactory.usingContext(LazyValidatorFactory.java:93)
    at org.apache.myfaces.extensions.cdi.jsf.impl.bv.resolver.InvalidValueAwareValidatorFactory.usingContext(InvalidValueAwareValidatorFactory.java:41)
    at org.jboss.as.ee.beanvalidation.LazyValidatorFactory.usingContext(LazyValidatorFactory.java:93)
    at org.apache.myfaces.extensions.cdi.jsf.impl.bv.resolver.InvalidValueAwareValidatorFactory.usingContext(InvalidValueAwareValidatorFactory.java:41)
    at org.jboss.as.ee.beanvalidation.LazyValidatorFactory.usingContext(LazyValidatorFactory.java:93)
    at org.apache.myfaces.extensions.cdi.jsf.impl.bv.resolver.InvalidValueAwareValidatorFactory.usingContext(InvalidValueAwareValidatorFactory.java:41)
    at org.jboss.as.ee.beanvalidation.LazyValidatorFactory.usingContext(LazyValidatorFactory.java:93)
    at org.apache.myfaces.extensions.cdi.jsf.impl.bv.resolver.InvalidValueAwareValidatorFactory.usingContext(InvalidValueAwareValidatorFactory.java:41)
    at org.jboss.as.ee.beanvalidation.LazyValidatorFactory.usingContext(LazyValidatorFactory.java:93)

POM:

<?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>
    <groupId>br.pmt</groupId>
    <artifactId>cad</artifactId>
    <version>1.0</version>
    <packaging>war</packaging>
    <name>Cad</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jboss.as.plugin.version>7.3.Final</jboss.as.plugin.version>
        <jboss.bom.version>1.0.4.Final</jboss.bom.version>
        <compiler.plugin.version>2.3.2</compiler.plugin.version>
        <surefire.plugin.version>2.4.3</surefire.plugin.version>
        <war.plugin.version>2.1.1</war.plugin.version>
        <maven.compiler.target>1.6</maven.compiler.target>
        <maven.compiler.source>1.6</maven.compiler.source>
        <codi.version>1.0.3</codi.version>
        <pmt.context.root>/cad</pmt.context.root>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.picketlink</groupId>
            <artifactId>picketlink</artifactId>
            <version>2.7.0.Final</version>
        </dependency>

        <dependency>
            <groupId>ch.ethz.ganymed</groupId>
            <artifactId>ganymed-ssh2</artifactId>
            <version>262</version>
        </dependency>

        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.2.12</version>
        </dependency>

        <dependency>
            <groupId>javax.xml.ws</groupId>
            <artifactId>jaxws-api</artifactId>
            <version>2.2.11</version>
        </dependency>

        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>1.0-SP4</version>
        </dependency>

        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.4</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
        </dependency>

        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.2.1</version>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.4</version>
        </dependency>

        <dependency>
            <groupId>portlet-api</groupId>
            <artifactId>portlet-api</artifactId>
            <version>1.0</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.0-api</artifactId>
            <version>1.0.1.Final</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.3.5.Final</version><!--$NO-MVN-MAN-VER$ -->
            <exclusions>
                <exclusion>
                    <groupId>antlr</groupId>
                    <artifactId>antlr</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>5.2</version>
        </dependency>

        <dependency>
            <groupId>org.primefaces.extensions</groupId>
            <artifactId>primefaces-extensions</artifactId>
            <version>3.1.0</version>
        </dependency>

        <dependency>
            <groupId>org.primefaces.themes</groupId>
            <artifactId>all-themes</artifactId>
            <version>1.0.10</version>
        </dependency>

        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>2.2</version>
            <type>jar</type>
        </dependency>

        <dependency>
            <groupId>org.jadira.usertype</groupId>
            <artifactId>usertype.core</artifactId>
            <version>3.1.0.CR1</version>
        </dependency>

        <dependency>
            <groupId>org.apache.myfaces.extensions.cdi.core</groupId>
            <artifactId>myfaces-extcdi-core-api</artifactId>
            <version>${codi.version}</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.myfaces.extensions.cdi.core</groupId>
            <artifactId>myfaces-extcdi-core-impl</artifactId>
            <version>${codi.version}</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
            <artifactId>myfaces-extcdi-jsf20-module-api</artifactId>
            <version>${codi.version}</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.myfaces.extensions.cdi.modules</groupId>
            <artifactId>myfaces-extcdi-jsf20-module-impl</artifactId>
            <version>${codi.version}</version>
            <scope>runtime</scope>
        </dependency>

    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <finalName>${pmt.context.root}</finalName>

        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler.plugin.version}</version>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>${war.plugin.version}</version>
                <configuration>
                    <warName>${pmt.context.root}</warName>
                    <failOnMissingWebXml>false</failOnMissingWebXml>

                    <webResources>
                        <resource>
                            <filtering>true</filtering>
                            <directory>src/main/webapp</directory>
                            <includes>
                                <include>**/*.xml</include>
                            </includes>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jboss.as.plugins</groupId>
                <artifactId>jboss-as-maven-plugin</artifactId>
                <version>${jboss.as.plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>2.3</version>
            </plugin>

        </plugins>
    </build>


    <profiles>

        <profile>
            <id>sonar</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <sonar.jdbc.url>xxxxxx</sonar.jdbc.url>
                <sonar.jdbc.username>xxxxx</sonar.jdbc.username>
                <sonar.jdbc.password>xxxxxxx</sonar.jdbc.password>
                <sonar.host.url>xxxxxxxx</sonar.host.url>
            </properties>
        </profile>
    </profiles>

</project>

I've found the solution.

Based on @mjn hint, I cleaned a little bit my pom.xml. I don't think this is part of the solution, but it helps to decrease possible problems. So, first of all, I removed all specific libs from JBoss. The pom.xml exposed in the question is already updated.

After that, we figured out that the problem was related with the new implementation of Weld, provided buy the Wildfly. Based on this, we updated some dependencies and then everything worked perfectly.

- Update cdi-api:

<dependency>
    <groupId>javax.enterprise</groupId>
    <artifactId>cdi-api</artifactId>
    <version>2.0-EDR1</version>
</dependency>

- Update codi.version:

<codi.version>1.0.6</codi.version>

Take a look at my pom.xml as a reference.

Thanks for the attention. Cheers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM