Runtime ambiguity error when executing deploy in Wildfly

Asked

Viewed 366 times

2

When trying to deploy the War file in Wildfly, there is a dependency injection ambiguity error in the Httpservletrequest class.

Someone else is going through it or has been through it?

Error returned by Wildfly:

Cannot 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 ". Starweldtservice: 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 [[Backedannotatedmethod] @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 "}}

Filing cabinet 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>

Environmental information:

  • JDK: 1.9
  • JRE: 1.9
  • Server: wildfly-10.0.0.Final
  • OS: Windows 10
  • @Gustavo, Demoiselle follows JEE6 specification and Wildfly 8 follows JEE7 specification, this may be related to the error. I will install Jboss 7.1.1 and JDK 1.7 and try to deploy.

3 answers

1

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

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

However, if you are aware of these limitations and want to test, to see if you really meet your needs (for now, in relation to working in Wildfly) and give feedback to the team, feel free, we have already made available in this version the two archetypes, JSF and HTML-REST, so that an application can be instantiated quickly. Channels for this feedback can be the project tracker (https://demoiselle.atlassian.net/) if you want to report bugs or suggest improvements and/or new features, github (https://github.com/demoiselle) if you have code contributions, the email list or the stackoverflow itself if you want to discuss, post questions, etc.

As it is a SNAPSHOT version, it is not yet in the central Maven repository. So you need to manually add the SNAPSHOTS repository (https://oss.sonatype.org/content/repositories/snapshots) manually in the project pom that you want to use it. The archetypes have the groupid:

br.gov.frameworkdemoiselle.archetypes

and artifact:

Demoiselle-html-Rest

and

Demoiselle-jsf-jpa

respectively.

  • Just to update the project status, I inform you that it has already been released version 3.0.0-ALPHA1. That is, you no longer need to add the SNAPSHOTS repository to run projects dependent on this version.

  • Thanks, great @Emerson!

  • Mass, @Emerson!

  • You can update your response with that information that ALPHA is already published, Emerson?

  • Example: http://pastebin.com/2Hze8XNw

0

I also have this problem, first I was with Wildfly 8.0.0 I switched to 8.2.1 and after 9.0.2 and both the same problem, strange as it is the default server without any modification and just deploying the Bookmark application that is generated by ParentRest-Parent version 2.5.1 to 2.5.0 also generates this problem.

  • Yes, if only we had direct contact with the Demoiselle team, who solve first, warn the other!

  • So in Wildfly 8.0.0 it worked?

  • I was wondering if I could talk to Emerson Saito, one of the members of the Demoiselle team.

  • I tested in the 8.0 gave the same error

  • Then @Cesardraw version 2.5.0 works in Jboss 7.1.1 but version 2.5.1 of the framework does not because it specifies jdk7 and Jboss 7.1.1 because an error does not start with jdk7, this is a known Issue that has been fixed only for wildfly. In other tests Jboss EAP 6.4 runs any version of the framework and runs under jdk7, only this is a paid server. Ai the need for the framework to work with wildfly, which is a free project.

  • Great @Ustavo, I managed to run Joss 7.1.1 with jdk1.7.0_75. .

  • In version 3 they are already solving the problem of CDI: https://github.com/demoiselle/framework3/commit/3950a0c8abfc42a23810a9e6f2ae7a4d19a38939

  • Hello @Cesardraw, how did you manage to run jdk7 with jboss 7.1.1 ? And version 3 is already stable ?

  • One of the changes I made was in pom.xml, I disabled doclint for java 8: tomorrow. <additionalparam>-Xdoclint:None</additionalparam>

Show 4 more comments

0

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

In the case of the generator, I use the video (https://www.youtube.com/watch?v=57kyX-nuKRQ) The Jboss EAP 6.4 (JEE6) version, which also works on Jboss AS 7.1.1, is ideally JDK7. With this environment will work very well, we are preparing the evolution of the generator to come out with the new framework as soon as the final version is released.

  • When the Generator comes out for the new version, let us know, @Paulogladson! !

Browser other questions tagged

You are not signed in. Login or sign up in order to post.