Uploaded image for project: 'Solder'
  1. Solder
  2. SOLDER-322

Solder Servlet extensions clashing with CDI 1.1

    Details

    • Steps to Reproduce:
      Hide

      Use the attached .war file directly, or:


      Using jboss-as-quickstarts example kitchensink-jsp. Add the following to POM

      <dependency>
      <groupId>org.jboss.seam.persistence</groupId>
      <artifactId>seam-persistence</artifactId>
      <version>3.1.0.Final</version>
      </dependency>

      maven clean and install

      Following Exceptions thrown on Enable in JBoss following deployment

      org.jboss.weld.exceptions.DeploymentException:
      WELD-001409 Ambiguous dependencies for type [HttpServletRequest] with qualifiers [@Default] at injection point [[field]
      @Inject private org.jboss.solder.servlet.http.RedirectBuilderImpl.request].
      Possible dependencies [[
      Producer Method [HttpServletRequest] with qualifiers [@Any @Default] declared as [[method] @Produces @Typed @RequestScoped protected
      org.jboss.solder.servlet.http.ImplicitHttpServletObjectsProducer.getHttpServletRequest()],
      org.jboss.weld.bean-jboss-as-kitchensink-jsp.war/C:/jboss-as-7.1.0.CR1b/bin/content/jboss-as-kitchensink-jsp.war/WEB-INF/lib/solder-impl-3.1.0.Final.jar-Built-in-org.jboss.weld.bean.builtin.ee.HttpServletRequestBean]]

      Show
      Use the attached .war file directly, or: Using jboss-as-quickstarts example kitchensink-jsp. Add the following to POM <dependency> <groupId>org.jboss.seam.persistence</groupId> <artifactId>seam-persistence</artifactId> <version>3.1.0.Final</version> </dependency> maven clean and install Following Exceptions thrown on Enable in JBoss following deployment org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [HttpServletRequest] with qualifiers [@Default] at injection point [ [field] @Inject private org.jboss.solder.servlet.http.RedirectBuilderImpl.request]. Possible dependencies [[ Producer Method [HttpServletRequest] with qualifiers [@Any @Default] declared as [ [method] @Produces @Typed @RequestScoped protected org.jboss.solder.servlet.http.ImplicitHttpServletObjectsProducer.getHttpServletRequest()], org.jboss.weld.bean-jboss-as-kitchensink-jsp.war/C:/jboss-as-7.1.0.CR1b/bin/content/jboss-as-kitchensink-jsp.war/WEB-INF/lib/solder-impl-3.1.0.Final.jar-Built-in-org.jboss.weld.bean.builtin.ee.HttpServletRequestBean]]

      Description

      Solder's Servlet extensions use the default qualifier for certain beans such as ServletRequest. This clashes with built-in beans added in CDI 1.1 and results in AmbiguousResolutionException during deployment.

      I think there are two ways around:

      • to introduce a Solder-specific qualifier so that the "@Default" space is not poluted or
      • detect CDI version and based on that either provide or not provide the overlapping Servlet integration

      When trying out Weld 2.0.0 Alpha implementation as suggested by Weld developer (Jozef) as per Forum reference, I encountered problems starting application when including seam-persistence 3.1.0.Final in project.

      I have reproduced this in quickstart example in 7.1.0.CR1b with Weld 2.0.0. The error doesn't happen in 7.0.2.Final and 7.1.1.Final

      Code files and result details for these can be provided if required (can't see how to upload).

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                dazed David Hubbard
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: