Runtime ambiguity error when running deploy on WildFly

2

When attempting to deploy the war file in WildFly, a dependency injection ambiguity error is occurring in the HttpServletRequest class.

Is anyone else going through this?

Error returned by WildFly:

  

Can not upload deployment: {"WFLYCTL0080: Failed services" = >   {"jboss.deployment.unit. \" infoconv-proxy-0.0.1-SNAPSHOT.war \ ". WeldStartService"   = > "org.jboss.msc.service.StartException in service jboss.deployment.unit. \" infoconv-proxy-0.0.1-SNAPSHOT.war \ "WeldStartService:   Failed to start service Caused by:   org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous   dependencies for type HttpServletRequest with qualifiers @Default at   injection point [BackedAnnotatedParameter] Parameter 1 of   [BackedAnnotatedMethod] @Default @Produces public   br.gov.frameworkdemoiselle.internal.producer.HttpSessionProducer.create (HttpServletRequest)   at   br.gov.frameworkdemoiselle.internal.producer.HttpSessionProducer.create (HttpSessionProducer.java:53)   Possible dependencies: - Producer Method [HttpServletRequest] with   qualifiers [@Default @Any] declared as [[BackedAnnotedMethod]   @Default @Produces public   br.gov.frameworkdemoiselle.internal.producer.HttpServletRequestProducer.create ()],   - WELD% AbstractBuiltInBean% infoconv-proxy-0.0.1-SNAPSHOT.war / WEB-INF / lib / demoiselle-servlet-2.5.1.jar% HttpServletRequest   "}}

File POM of the project:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>br.gov.serpro.infoconv</groupId>
<artifactId>infoconv-proxy</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>

<name></name>
<description></description>
<url></url>

<parent>
    <groupId>br.gov.frameworkdemoiselle</groupId>
    <artifactId>demoiselle-rest-parent</artifactId>
    <version>2.5.1</version>
</parent>

<dependencies>

    <!-- https://github.com/infoconv/infoconv-ws -->
    <dependency>
        <groupId>br.gov.serpro.rfb.infoconv.ws</groupId>
        <artifactId>infoconv-ws</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </dependency>


    <!-- Demoiselle dependencies -->
    <!-- <dependency> <groupId>br.gov.frameworkdemoiselle</groupId> <artifactId>demoiselle-jpa</artifactId> 
        <scope>compile</scope> </dependency> -->
    <!-- Uncomment this dependency if you are using a JTA -->
    <!-- <dependency> <groupId>br.gov.frameworkdemoiselle</groupId> <artifactId>demoiselle-jta</artifactId> 
        <scope>compile</scope> </dependency> -->

    <!-- Jackson dependencies -->
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.9.9</version>
        <scope>provided</scope>
    </dependency>

    <!-- GZip dependencies -->
    <dependency>
        <groupId>org.tuckey</groupId>
        <artifactId>urlrewritefilter</artifactId>
        <version>4.0.4</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>io.swagger</groupId>
        <artifactId>swagger-jaxrs</artifactId>
        <version>1.5.4</version>
        <!-- <exclusions> <exclusion> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> 
            </exclusion> </exclusions> -->
    </dependency>

    <!-- Tests dependencies -->
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.3.4</version><!--$NO-MVN-MAN-VER$ -->
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>3.12.1.GA</version>
    </dependency>

</dependencies>

<profiles>
    <profile>
        <id>doclint-java8-disable</id>
        <activation>
            <jdk>[1.8,)</jdk>
        </activation>

        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <configuration>
                        <additionalparam>-Xdoclint:none</additionalparam>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

<build>
<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ear-plugin</artifactId>
        <configuration>
            <archive>
                <manifestEntries>
                    <Dependencies>com.jersey.jersey-server,com.jersey.jersey-client,com.jersey.jersey-json</Dependencies>
                </manifestEntries>
            </archive>
        </configuration>
    </plugin>
</plugins>

</build>
<repositories>
    <repository>
        <id>component.internal</id>
        <name>SERPRO Component Maven Repository</name>
        <url>http://archiva.desenv.serpro/repository/component-internal</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <releases>
            <enabled>true</enabled>
        </releases>
    </repository>
</repositories>

Environment Information:

  • JDK: 1.9
  • JRE: 1.9
  • Server: wildfly-10.0.0.Final
  • OS: Windows 10
asked by anonymous 02.06.2016 / 15:20

3 answers

1

As some people have pointed out, Demoiselle 2.x follows the JEE 6 specification, while WildFly follows the JEE 7 specification, which generates some incompatibilities (in addition to the issue of Java 8 support as well).

You are already working on a version of Demoiselle that follows the JEE 7 specification and therefore runs on WildFly. For now we have a version 3.0.0-ALPHA1-SNAPSHOT (which we released 06/17/2016). That is, it is just an embryo, an experiment, a known version without all the features that we intend to have in the final version, with some known bugs, and that could not by a load of more robust tests. Also, not all of the features in version 2.5.1 are in this release; we prioritize security, persistence, pagination, configuration.

However, even if you are aware of these limitations and want to test them, check if they really meet your needs (for now, in relation to running WildFly) and give feedback to the team, feel free to do so, archetypes, JSF and HTML-REST, so that an application can be instantiated quickly. The channels for this feedback can be the project tracker ( link ) if you want to report bugs or suggest improvements and / or new features, github ( link ) if you have code contributions, the mailing list or the stackoverflow itself if you want to discuss, post doubts, etc.

Since it is a SNAPSHOT version, it is not yet in the central Maven repository. So you need to manually add the SNAPSHOTS repository ( link ) manually to the project pom that you want to use it. The archetypes have groupId:

  

br.gov.frameworkdemoiselle.archetypes

and artefactId:

  

demoiselle-html-rest

and

  

demoiselle-jsf-jpa

respectively.

    
20.06.2016 / 14:38
0

I'm also having this problem, I was first with WildFly 8.0.0 and I switched to 8.2.1 and after 9.0.2 and both the same problem, strange because it is the default server without any modification and just deploy of the Bookmark application that is generated by the parent demoiselle-rest-parent version 2.5.1 to 2.5.0 also generates this problem.

    
02.06.2016 / 19:04
0

Demoiselle 2.5 is JEE6, so it will run on JBoss EAP 6.x and JBoss AS 7.x, JBoss EAP 7 and Wildfly are JEE7 versions, which will be compatible with version 3 of the Demoiselle which will be based on JEE7

In the case of the generator, I use the JBoss EAP 6.4 (JEE6) version in the video ( link ) , which also works on JBoss AS 7.1.1, the ideal is to use the JDK7. With this environment will work very well, we are preparing the evolution of the generator to leave with the new framework as soon as the final version is released.

    
17.06.2016 / 16:30