Examples of InjectionException


Examples of com.sun.enterprise.container.common.spi.util.InjectionException

                compEnvManager.getJndiNameEnvironment(componentId);

            if( componentEnv != null ) {
                inject(instance.getClass(), instance, componentEnv, componentId, invokePostConstruct);
            } else {
                throw new InjectionException(localStrings.getLocalString(
                        "injection-manager.no-descriptor-registered-for-component",
                        "No descriptor registered for componentId: {0}", componentId));
            }
        } else {
            throw new InjectionException(localStrings.getLocalString(
                    "injection-manager.null-invocation-context", "Null invocation context"));
        }
    }
View Full Code Here

Examples of com.sun.enterprise.container.common.spi.util.InjectionException

          compEnvManager.getJndiNameEnvironment(componentId);

        if( componentEnv != null ) {
          injectClass(clazz, componentEnv, invokePostConstruct);
        } else {
          throw new InjectionException(localStrings.getLocalString(
            "injection-manager.no-descriptor-registered-for-component",
            "No descriptor registered for componentId: {0}", componentId));
        }
      } else {
        throw new InjectionException(localStrings.getLocalString(
          "injection-manager.null-invocation-context", "Null invocation context"));
      }
    }
View Full Code Here

Examples of com.sun.enterprise.container.common.spi.util.InjectionException

            } else if (validate || _logger.isLoggable(Level.FINE)) {
                String msg1 = localStrings.getLocalString(
                        "injection-manager.no-descriptor-registered-for-invocation",
                        "No descriptor registered for current invocation: {0}", inv);
                if (validate) {
                    throw new InjectionException(msg1);
                }
                _logger.log(Level.FINE, msg1);
            }
        } else if (validate || _logger.isLoggable(Level.FINE)) {
            String msg2 = localStrings.getLocalString(
                    "injection-manager.null-invocation-context", "Null invocation context");
            if (validate) {
                throw new InjectionException(msg2);
            }
            _logger.log(Level.FINE, msg2);
        }
    }
View Full Code Here

Examples of com.sun.enterprise.container.common.spi.util.InjectionException

                    injectInstance(managedObject);

                }
            }
        } catch(Exception e) {
            throw new InjectionException(localStrings.getLocalString(
                    "injection-manager.error-creating-managed-object",
                    "Error creating managed object for class: {0}", clazz), e);
        }

        return managedObject;
View Full Code Here

Examples of javax.enterprise.inject.InjectionException

                    field.set(instance, Integer.parseInt(fieldValueFromXml));
                } else if (field.getType().isAssignableFrom(String.class)) {
                    field.set(instance, fieldValueFromXml);
                } else {
                    // TODO: left up for the reader
                    throw new InjectionException("Cannot convert to type " + field.getType());
                }
            } catch (IllegalAccessException e) {
                throw new InjectionException("Cannot access field " + field);
            }
        }
    }
View Full Code Here

Examples of javax.enterprise.inject.InjectionException

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

Examples of javax.enterprise.inject.InjectionException

    /*
    if (context == null)
      return null;
      */
    if (context == null)
      throw new InjectionException(L.l("Bean has an unknown scope '{0}' for bean {1}",
                                       scopeType, bean));
   
    if (isNormalScope(scopeType) && bean instanceof ScopeAdapterBean<?>) {
      ScopeAdapterBean<T> scopeAdapterBean = (ScopeAdapterBean<T>) bean;
     
View Full Code Here

Examples of javax.enterprise.inject.InjectionException

      ownerManager = this;

    Context context = ownerManager.getContextImpl(scopeType);

    if (context == null)
      throw new InjectionException(L.l("Bean has an unknown scope '{0}' for bean {1}",
                                       scopeType, bean));

    return new NormalInstanceReferenceFactory<T>(bean, context);
  }
View Full Code Here

Examples of javax.enterprise.inject.InjectionException

    if (baseType.isGeneric())
      throw new InjectionException(L.l("'{0}' is an invalid type for injection because it's generic. {1}",
                                       baseType, ij));
                                       */
    if (baseType.isGenericVariable())
      throw new InjectionException(L.l("'{0}' is an invalid type for injection because it's a variable generic type.\n  {1}",
                                       baseType, ij));

    Set<Bean<?>> set = resolveRec(baseType, qualifiers, ij);
   
    if (set == null || set.size() == 0) {
      if (InjectionPoint.class.equals(type))
        return new InjectionPointBean(this, ij);
     
      throw unsatisfiedException(type, qualifiers);
    }

    Bean<?> bean = resolve(set);

    if (bean != null
        && type instanceof Class<?>
        && ((Class<?>) type).isPrimitive()
        && bean.isNullable()) {
      throw new InjectionException(L.l("'{0}' cannot be injected because it's a primitive with {1}",
                                       type, bean));                              
    }
   
    return bean;

View Full Code Here

Examples of javax.enterprise.inject.InjectionException

      ClassLoader loader = Thread.currentThread().getContextClassLoader();

      Class<?> serviceClass = Class.forName(className, false, loader);

      if (! serviceApi.isAssignableFrom(serviceClass))
        throw new InjectionException(L.l("'{0}' is not a valid servicebecause it does not implement {1}",
                                         serviceClass, serviceApi.getName()));

      return (Class<T>) serviceClass;
    } catch (Exception e) {
      log.log(Level.WARNING, e.toString(), e);
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.