Examples of ExtensionInitializationException


Examples of com.byteslounge.cdi.exception.ExtensionInitializationException

                } else {
                    if (providedResolverMethod != null) {
                        String errorMessage = "Found multiple provided property resolver methods: " + MessageUtils.getMethodDefinition(providedResolverMethod)
                                + ", " + MessageUtils.getMethodDefinition(method);
                        logger.error(errorMessage);
                        throw new ExtensionInitializationException(errorMessage);
                    }
                    providedResolverMethod = method;
                    if (logger.isDebugEnabled()) {
                        logger.debug("Found provided resolver method: " + MessageUtils.getMethodDefinition(providedResolverMethod));
                    }
View Full Code Here

Examples of com.byteslounge.cdi.exception.ExtensionInitializationException

            resolverMethod = providedResolverMethod;
        }
        if (resolverMethod == null) {
            String errorMessage = "Could not find any property resolver method.";
            logger.error(errorMessage);
            throw new ExtensionInitializationException(errorMessage);
        }
        propertyResolverBean = new PropertyResolverBean(resolverMethod, beanManager);
    }
View Full Code Here

Examples of com.byteslounge.cdi.exception.ExtensionInitializationException

     * See {@link ResolverMethodVerifier#verify()}
     */
    @Override
    public void verify() {
        if (localeParameterIndex > -1 && localeParameterIndex != 0) {
            throw new ExtensionInitializationException("Locale parameter, if present in property resolver method, must be the first one.");
        }
        if (bundleNameParameterIndex > -1 && localeParameterIndex == -1 && bundleNameParameterIndex != 0) {
            throw new ExtensionInitializationException(
                    "BundleName parameter, if present in property resolver method without Locale parameter, must be the first one.");
        }
        if (localeParameterIndex > -1 && bundleNameParameterIndex > -1 && (bundleNameParameterIndex - localeParameterIndex != 1)) {
            throw new ExtensionInitializationException("BundleName parameter must be right after Locale parameter in property resolver method.");
        }
    }
View Full Code Here

Examples of com.byteslounge.cdi.exception.ExtensionInitializationException

     */
    private void checkPropertyField(Class<?> originalType, Class<?> type) {
        for (Field field : type.getDeclaredFields()) {
            for (Annotation annotation : field.getAnnotations()) {
                if (annotation.annotationType().equals(Property.class)) {
                    throw new ExtensionInitializationException(
                            "Property resolver method is injecting a Dependent scoped bean which in turn also has an injected @"
                                    + Property.class.getSimpleName()
                                    + " (this would cause a stack overflow because Dependent scoped bean instances are injected directly and not proxied). Type: "
                                    + originalType.getSimpleName() + ", field: " + field.getName());
                }
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.