Examples of UnsatisfiedDependencyException


Examples of javax.inject.UnsatisfiedDependencyException

            Set<Bean<T>> set = InjectionResolver.getInstance().implResolveByType(ClassUtil.getFirstRawType(type), ClassUtil.getActualTypeArguements(type), annot);
            ProducerComponentImpl<?> pr = (ProducerComponentImpl<?>) set.iterator().next();

            if (pr == null)
            {
                throw new UnsatisfiedDependencyException("Producer method component of the disposal method : " + declaredMethod.getName() + " in class : " + clazz.getName() + "is not found");
            }

            if (previous == null)
            {
                previous = pr;
View Full Code Here

Examples of javax.inject.UnsatisfiedDependencyException

    public static <T> void checkResolvedBeans(Set<Bean<T>> resolvedSet, Class<?> type)
    {
        if (resolvedSet.isEmpty())
        {
            throw new UnsatisfiedDependencyException("Api type : " + type.getName() + " is not found");
        }

        if (resolvedSet.size() > 1)
        {
            throw new AmbiguousDependencyException("There is more than one api type with : " + type.getName());
View Full Code Here

Examples of javax.inject.UnsatisfiedDependencyException

                }
            }
           
            message.append("]");
           
            throw new UnsatisfiedDependencyException(message.toString());
        }

        if (resolvedSet.size() > 1)
        {
            throw new AmbiguousDependencyException("There is more than one api type with : " + type.getName());
View Full Code Here

Examples of javax.inject.UnsatisfiedDependencyException

            Bean<T> bean = set.iterator().next();
            ProducerComponentImpl<?> pr = null;

            if (bean == null || !(bean instanceof ProducerComponentImpl))
            {
                throw new UnsatisfiedDependencyException("Producer method component of the disposal method : " + declaredMethod.getName() + " in class : " + clazz.getName() + "is not found");
            }

            else
            {
                pr = (ProducerComponentImpl<?>) bean;
View Full Code Here

Examples of org.glassfish.hk2.api.UnsatisfiedDependencyException

        ActiveDescriptor<?> ad = locator.getInjecteeDescriptor(injectee);
       
        if (ad == null) {
            if (injectee.isOptional()) return null;
           
            throw new MultiException(new UnsatisfiedDependencyException(injectee));
        }
       
        return locator.getService(ad, root, injectee);
    }
View Full Code Here

Examples of org.springframework.beans.factory.UnsatisfiedDependencyException

          }
        }
        autowiredBeanNames.clear();
      }
      catch (BeansException ex) {
        throw new UnsatisfiedDependencyException(
            mbd.getResourceDescription(), beanName, propertyName, ex.getMessage());
      }
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.UnsatisfiedDependencyException

        boolean isSimple = BeanUtils.isSimpleProperty(pds[i].getPropertyType());
        boolean unsatisfied = (dependencyCheck == RootBeanDefinition.DEPENDENCY_CHECK_ALL) ||
          (isSimple && dependencyCheck == RootBeanDefinition.DEPENDENCY_CHECK_SIMPLE) ||
          (!isSimple && dependencyCheck == RootBeanDefinition.DEPENDENCY_CHECK_OBJECTS);
        if (unsatisfied) {
          throw new UnsatisfiedDependencyException(
              mbd.getResourceDescription(), beanName, pds[i].getName(),
              "Set this property value or disable dependency checking for this bean.");
        }
      }
    }
View Full Code Here

Examples of org.springframework.beans.factory.UnsatisfiedDependencyException

              resolveNecessary = true;
              args.preparedArguments[paramIndex] = sourceValue;
            }
          }
          catch (TypeMismatchException ex) {
            throw new UnsatisfiedDependencyException(
                mbd.getResourceDescription(), beanName, paramIndex, paramType,
                "Could not convert " + methodType + " argument value of type [" +
                ObjectUtils.nullSafeClassName(valueHolder.getValue()) +
                "] to required type [" + paramType.getName() + "]: " + ex.getMessage());
          }
        }
      }
      else {
        // No explicit match found: we're either supposed to autowire or
        // have to fail creating an argument array for the given constructor.
        if (!autowiring) {
          throw new UnsatisfiedDependencyException(
              mbd.getResourceDescription(), beanName, paramIndex, paramType,
              "Ambiguous " + methodType + " argument types - " +
              "did you specify the correct bean references as " + methodType + " arguments?");
        }
        try {
          MethodParameter param = MethodParameter.forMethodOrConstructor(methodOrCtor, paramIndex);
          Object autowiredArgument = resolveAutowiredArgument(param, beanName, autowiredBeanNames, converter);
          args.rawArguments[paramIndex] = autowiredArgument;
          args.arguments[paramIndex] = autowiredArgument;
          args.preparedArguments[paramIndex] = new AutowiredArgumentMarker();
          resolveNecessary = true;
        }
        catch (BeansException ex) {
          throw new UnsatisfiedDependencyException(
              mbd.getResourceDescription(), beanName, paramIndex, paramType, ex.getMessage());
        }
      }
    }
View Full Code Here

Examples of org.springframework.beans.factory.UnsatisfiedDependencyException

          }
          autowiredBeanNames.clear();
        }
      }
      catch (BeansException ex) {
        throw new UnsatisfiedDependencyException(mbd.getResourceDescription(), beanName, propertyName, ex);
      }
    }
  }
View Full Code Here

Examples of org.springframework.beans.factory.UnsatisfiedDependencyException

        boolean isSimple = BeanUtils.isSimpleProperty(pd.getPropertyType());
        boolean unsatisfied = (dependencyCheck == RootBeanDefinition.DEPENDENCY_CHECK_ALL) ||
            (isSimple && dependencyCheck == RootBeanDefinition.DEPENDENCY_CHECK_SIMPLE) ||
            (!isSimple && dependencyCheck == RootBeanDefinition.DEPENDENCY_CHECK_OBJECTS);
        if (unsatisfied) {
          throw new UnsatisfiedDependencyException(mbd.getResourceDescription(), beanName, pd.getName(),
              "Set this property value or disable dependency checking for this bean.");
        }
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.