public void inject(InjectionContainer container) { try { Util.rebind(container.getEnc(), encName, obj); } catch (NamingException e) { throw new RuntimeException(new StringBuilder().append("could not bind enc name '").append(encName).append("' for ").append(error).append(" for container ").append(container.getIdentifier()).append(e.getMessage()).toString()); } } }
public void inject(InjectionContainer container) { try { Util.rebind(container.getEnc(), encName, new LinkRef(jndiName)); } catch (NamingException e) { throw new RuntimeException(new StringBuilder().append("could not bind enc name '").append(encName).append("' for ").append(error).append(" for container ").append(container.getIdentifier()).append(e.getMessage()).toString()); } } }
public void inject(InjectionContainer container) { Object factory = null; try { factory = PersistenceUnitHandler.getFactory(injectionType, unitName, container); } catch (NameNotFoundException e) { throw new RuntimeException(e); } if (factory == null) { throw new RuntimeException("Failed to locate " + error + " of unit name: " + unitName + " for " + container.getIdentifier()); } try { Util.rebind(container.getEnc(), encName, factory); } catch (Exception e) { throw new RuntimeException("Failed to bind " + error + " of unit name: " + unitName + " ref-name" + encName + " for container " + container.getIdentifier(), e); } } }
throw new RuntimeException("could not resolve global JNDI name for " + error + " for container " + container.getIdentifier() + ": reference class: " + refClass.getName() + " ejbLink: " + ejbLink + " " + e.getMessage()); throw new RuntimeException("could not bind enc name '" + encName + "' for " + error + " for container " + container.getIdentifier() + ": reference class: " + refClass.getName() + " ejbLink: " + ejbLink + " " + e.getMessage());
throw new RuntimeException("For deployment " + container.getIdentifier() + "not enough information for @EJB. Please fill out the beanName and/or businessInterface attributes"); throw new RuntimeException("For deployment " + container.getIdentifier() + " could not find jndi binding based on interface only for @EJB(" + businessInterface.getName() + ") " + e.getMessage()); throw new RuntimeException("For deployment " + container.getIdentifier() + " could not find jndi binding based on interface only for @EJB(" + businessInterface.getName() + ")"); if (jndiName == null) throw new RuntimeException("For EJB " + container.getIdentifier() + "could not find jndi binding based on beanName and business interface for @EJB(" + ref.beanName() + ", " + businessInterface.getName() + ")");
throw new RuntimeException("For deployment " + container.getIdentifier() + "not enough information for @EJB. Please fill out the beanName and/or businessInterface attributes"); throw new RuntimeException("For deployment " + container.getIdentifier() + " could not find jndi binding based on interface only for @EJB(" + businessInterface.getName() + ") " + e.getMessage()); throw new RuntimeException("For deployment " + container.getIdentifier() + " could not find jndi binding based on interface only for @EJB(" + businessInterface.getName() + ")"); if (jndiName == null) throw new RuntimeException("For EJB " + container.getIdentifier() + "could not find jndi binding based on beanName and business interface for @EJB(" + ref.beanName() + ", " + businessInterface.getName() + ")");
throw new RuntimeException("For deployment " + container.getIdentifier() + "not enough information for @EJB. Please fill out the beanName and/or businessInterface attributes"); throw new RuntimeException("For deployment " + container.getIdentifier() + " could not find jndi binding based on interface only for @EJB(" + businessInterface.getName() + ") " + e.getMessage()); throw new RuntimeException("For deployment " + container.getIdentifier() + " could not find jndi binding based on interface only for @EJB(" + businessInterface.getName() + ")"); if (jndiName == null) throw new RuntimeException("For EJB " + container.getIdentifier() + "could not find jndi binding based on beanName and business interface for @EJB(" + ref.beanName() + ", " + businessInterface.getName() + ")");
throw new RuntimeException("For deployment " + container.getIdentifier() + "not enough information for @EJB. Please fill out the beanName and/or businessInterface attributes"); log.warn("For deployment " + container.getIdentifier() + " could not find jndi binding based on interface only for @EJB(" + businessInterface.getName() + ") " + e.getMessage());
throw new RuntimeException("For deployment " + container.getIdentifier() + "not enough information for @EJB. Please fill out the beanName and/or businessInterface attributes"); log.warn("For deployment " + container.getIdentifier() + " could not find jndi binding based on interface only for @EJB(" + businessInterface.getName() + ") " + e.getMessage());
private static void loadXmlMessageDestinationRefs(InjectionContainer container, Collection<MessageDestinationReferenceMetaData> refs) { for (MessageDestinationReferenceMetaData envRef : refs) { String encName = "env/" + envRef.getMessageDestinationRefName(); if (container.getEncInjectors().containsKey(encName)) continue; String jndiName = envRef.getMappedName(); if (jndiName == null || jndiName.equals("")) { // Look for a message-destination-link String link = envRef.getLink(); if( link != null ) { jndiName = container.resolveMessageDestination(link); if (jndiName == null) throw new RuntimeException("message-destination-link not found " + link + " of deployment " + container.getIdentifier()); // TODO: add dependency } else throw new RuntimeException("mapped-name or message-destination-link is required for " + envRef.getMessageDestinationRefName() + " of deployment " + container.getIdentifier()); } container.getEncInjectors().put(encName, new LinkRefEncInjector(encName, jndiName, "<message-destination-ref>")); InjectionUtil.injectionTarget(encName, envRef, container, container.getEncInjections()); } }
+ container.getIdentifier() + " failed to inject on method " + method.toString(); container.getEncInjectors().put(encName, new PcEncInjector(encName, ref.unitName(), ref.type(), method.getParameterTypes()[0], error));
public void loadXml(X xml, InjectionContainer container) { if (xml == null) return; if (xml instanceof JBossEnterpriseBeanMetaData == false) return; JndiRefsMetaData jndiRefs = ((JBossEnterpriseBeanMetaData) xml).getJndiRefs(); if (jndiRefs == null) return; for (JndiRefMetaData ref : jndiRefs) { if (ref.getMappedName() == null || ref.getMappedName().equals("")) throw new RuntimeException("mapped-name is required for " + ref.getJndiRefName() + " of container " + container.getIdentifier()); String encName = "env/" + ref.getJndiRefName(); if (!container.getEncInjectors().containsKey(encName)) { container.getEncInjectors().put(encName, new LinkRefEncInjector(encName, ref.getMappedName(), "jndi ref")); } InjectionUtil.injectionTarget(encName, ref, container, container.getEncInjections()); } }
private static void loadPersistenceContextClassAnnotation( PersistenceContext ref, InjectionContainer container, Class<?> clazz) { String encName = ref.name(); if (encName == null || encName.equals("")) { throw new RuntimeException( "JBoss requires name() for class level @PersistenceContext"); } encName = "env/" + ref.name(); if (container.getEncInjectors().containsKey(encName)) return; String error = "Unable to load class-level @PersistenceContext(" + ref.unitName() + ") on " + container.getIdentifier(); container.getEncInjectors().put(encName, new PcEncInjector(encName, ref.unitName(), ref.type(), null, error)); try { PersistenceUnitHandler.addPUDependency(ref.unitName(), container); } catch (NameNotFoundException e) { throw new RuntimeException("Illegal @PersistenceUnit on " + clazz.getName() + " of unitname " + ref.unitName() + " :" + e.getMessage()); } }
+ container.getIdentifier() + " failed to inject on field " + field.toString(); container.getEncInjectors().put(encName, new PcEncInjector(encName, ref.unitName(), ref.type(), field.getType(), error));
throw new RuntimeException("mapped-name is required for " + envRef.getResourceRefName() + " of deployment " + container.getIdentifier());
throw new RuntimeException("could not find " + errorType + "'s local interface " + interfaceName + " in " + container.getDeploymentDescriptorType() + " of " + container.getIdentifier());
throw new RuntimeException("could not find " + errorType + "'s local interface " + interfaceName + " in " + container.getDeploymentDescriptorType() + " of " + container.getIdentifier());
throw new RuntimeException("could not find " + errorType + "'s local interface " + interfaceName + " in " + container.getDeploymentDescriptorType() + " of " + container.getIdentifier());
throw new RuntimeException("mapped-name is required for " + envRef.getResourceRefName() + " of deployment " + container.getIdentifier());
if (mappedName == null || mappedName.equals("")) throw new RuntimeException("mapped-name is required for " + envRef.getResourceEnvRefName() + " of deployment " + container.getIdentifier());