Package javax.enterprise.inject

Examples of javax.enterprise.inject.UnsatisfiedResolutionException


    }

    try {
      return Class.forName(beanDefinition.getBeanClassName());
    } catch (ClassNotFoundException e) {
      throw new UnsatisfiedResolutionException(String.format("Unable to resolve class for '%s'",
          beanDefinition.getBeanClassName()), e);
    }
  }
View Full Code Here


        return OldSPIBridge.getInstanceByName(getCurrentManager(), name);
    }

    private <T> Bean<T> resolveUniqueBean(Type type, Set<Bean<T>> beans) {
        if (beans.size() == 0) {
            throw new UnsatisfiedResolutionException("Unable to resolve any beans of " + type);
        } else if (beans.size() > 1) {
            throw new AmbiguousResolutionException("More than one bean available (" + beans + ")");
        }
        return beans.iterator().next();
    }
View Full Code Here

        ViolationMessageBuilder violationMessage = newViolation(createProducerMethodMessage(producerMethod));

        violationMessage.append(" in class: ", ClassUtil.getClass(type).getName());
        violationMessage.addLine(createQualifierMessage(qualifiers));

        throw new UnsatisfiedResolutionException(violationMessage.toString());
    }
View Full Code Here

        if (injectionPoint != null)
        {
            violationMessage.addLine("for injection into ", injectionPoint.toString());
        }

        throw new UnsatisfiedResolutionException(violationMessage.toString());
    }
View Full Code Here

                                       ij.getMember().getDeclaringClass().getName(),
                                       ij.getMember().getName(),
                                       e.getMessage()),
                                   e);
    } catch (UnsatisfiedResolutionException e) {
      throw new UnsatisfiedResolutionException(L.l("{0}.{1}: {2}",
                                                   ij.getMember().getDeclaringClass().getName(),
                                                   ij.getMember().getName(),
                                                   e.getMessage()),
                                   e);
    } catch (IllegalProductException e) {
View Full Code Here

                                               Annotation []qualifiers)
  {
    WebComponent component = getWebComponent(createTargetBaseType(type));

    if (component == null) {
      throw new UnsatisfiedResolutionException(L.l("Can't find a bean for '{0}' because no beans implementing that class have been registered with the injection manager {1}.",
                                                   type, this));
    }
    else {
      ArrayList<Bean<?>> enabledList = component.getEnabledBeanList();

      if (enabledList.size() == 0) {
        throw new UnsatisfiedResolutionException(L.l("Can't find a bean for '{0}' because no beans implementing that class have been registered with the injection manager {1}.",
                                                     type, this));
      }
      else {
        return new UnsatisfiedResolutionException(L.l("Can't find a bean for '{0}' because no beans match the type and qualifiers {1}.\nBeans:{2}",
                                                      type,
                                                      toList(qualifiers),
                                                      listToLines(enabledList)));
      }
    }
View Full Code Here

    {
        ViolationMessageBuilder violationMessage = newViolation(message);

        violationMessage.addLine(createProducerMethodMessage(producerMethod));

        throw new UnsatisfiedResolutionException(violationMessage.toString());
    }
View Full Code Here

        ViolationMessageBuilder violationMessage = newViolation(createProducerMethodMessage(producerMethod));

        violationMessage.append(" in class: ", ClassUtil.getClass(type).getName());
        violationMessage.addLine(createQualifierMessage(qualifiers));

        throw new UnsatisfiedResolutionException(violationMessage.toString());
    }
View Full Code Here

        if (injectionPoint != null)
        {
            violationMessage.addLine("for injection into ", injectionPoint.toString());
        }

        throw new UnsatisfiedResolutionException(violationMessage.toString());
    }
View Full Code Here

        if (instance.isUnsatisfied()) {
            if (preferedTemplatingProvider == null) {
                log.debug("No TemplateProvider found. Templating support disabled.");
                return;
            } else {
                throw new UnsatisfiedResolutionException("Unable to load prefered TemplateProvider "
                        + preferedTemplatingProvider.getName());
            }
        }

        // multiple templating engines found
View Full Code Here

TOP

Related Classes of javax.enterprise.inject.UnsatisfiedResolutionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.