Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Ambiguous injectinon point" error with vaadin-cdi-integration and Seam Solder - Produces #4

Closed
twadzins opened this issue Dec 19, 2012 · 1 comment

Comments

@twadzins
Copy link

JaasTools contains:

@produces
@RequestScoped
public static HttpServletRequest getCurrentRequest() {
HttpServletRequest request = VaadinServletService
.getCurrentServletRequest();
getLogger().info("Getting request " + request);

    return request;
}

The @produces allows the following, for instance:
@Inject HttpServletRequest request;

However, if any other part of the app (Seam Solder, in my case) also produces that, the app won't start (see Exception below). There's no way around it that I know of , without either changing the source of vaadin-cdi-integration or Seam Solder.

Is the @produces really needed here? (I don't see any @Inject usages). If it is deemed needed, perhaps it could be qualified? It would be nice to allow Seam Solder to be used along side vaadin-cdi, and Seam solder is not likely to remove it, I think...

Exceptions:
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.RequestParamProducer.request]. Possible dependencies [[Producer Method [HttpServletRequest] with qualifiers [@Any @default] declared as [[method] @produces @typed @RequestScoped protected org.jboss.solder.servlet.http.ImplicitHttpServletObjectsProducer.getHttpServletRequest()], Producer Method [HttpServletRequest] with qualifiers [@Any @default] declared as [[method] @produces @RequestScoped public static com.vaadin.cdi.component.JaasTools.getCurrentRequest()]]]

@Artur-
Copy link
Member

Artur- commented Aug 15, 2013

All CDI issues in GitHub have been moved to http://dev.vaadin.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants