Package org.jboss.deployment

Examples of org.jboss.deployment.DeploymentException


         JDBCTypeFactory typeFactory = manager.getJDBCTypeFactory();
         JDBCTypeMappingMetaData typeMapping = typeFactory.getTypeMapping();
         JDBCFunctionMappingMetaData rowLockingTemplate = typeMapping.getRowLockingTemplate();
         if(rowLockingTemplate == null)
         {
            throw new DeploymentException("Row locking template is not defined for mapping: " + typeMapping.getName());
         }

         selectSql = rowLockingTemplate.getFunctionSql(new Object[]{selectColumns, tableName, whereColumns, null},
            new StringBuffer()).toString();
      }
      else
      {
         selectSql = "select ";
         selectSql += selectColumns;
         selectSql += " from " + tableName + " where ";
         selectSql += whereColumns;
      }
      log.debug("select sql: " + selectSql);

      // DUPLICATE KEY
      if(dontFlushCreated)
      {
         duplicatePkSql = "select ";
         duplicatePkSql += pkFields[0].getColumnName();
         for(int i = 1; i < pkFields.length; ++i)
         {
            duplicatePkSql += ", " + pkFields[i].getColumnName();
         }
         duplicatePkSql += " from " + tableName + " where ";
         duplicatePkSql += pkFields[0].getColumnName() + "=?";
         for(int i = 1; i < pkFields.length; ++i)
         {
            duplicatePkSql += " and " + pkFields[i].getColumnName() + "=?";
         }
         log.debug("duplicate pk sql: " + duplicatePkSql);
      }

      if(cacheName != null)
      {
         try
         {
            serviceController.start(cacheName);
         }
         catch(Exception e)
         {
            throw new DeploymentException("Failed to start table cache.", e);
         }
      }
   }
View Full Code Here


      this.log = Logger.getLogger(getClass().getName() + "." + entityBridge.getEntityName());

      final JDBCFieldBridge[] pkFields = entityBridge.getPrimaryKeyFields();
      if(pkFields.length > 1)
      {
         throw new DeploymentException("This entity-command cannot be used with composite primary keys!");
      }

      this.pkField = (JDBCCMPFieldBridge2) pkFields[0];
      this.pkSql = "";
   }
View Full Code Here

     
      // Load standardjbosscmp-jdbc.xml from the default classLoader
      // we always load defaults first
      URL stdJDBCUrl = container.getClassLoader().getResource("standardjbosscmp-jdbc.xml");
      if(stdJDBCUrl == null) {
         throw new DeploymentException("No standardjbosscmp-jdbc.xml found");
      }

      boolean debug = log.isDebugEnabled();
      if (debug)
         log.debug("Loading standardjbosscmp-jdbc.xml : " + stdJDBCUrl.toString());
View Full Code Here

    */
   private void addContainer(Container con) throws DeploymentException
   {
      String ejbName = con.getBeanMetaData().getEjbName();
      if (containers.containsKey(ejbName))
         throw new DeploymentException("Duplicate ejb-name. Container for " + ejbName + " already exists.");
      containers.put(ejbName, con);
      containerOrdering.add(con);
      con.setEjbModule(this);
   }
View Full Code Here

         Class clazz = unitCl.loadClass(webClassLoaderName);
         wcl = WebClassLoaderFactory.createWebClassLoader(clazz, container.getJmxName(), (RealClassLoader) unitCl);
      }
      catch (Exception e)
      {
         throw new DeploymentException("Failed to create WebClassLoader of class " + webClassLoaderName + ": ", e);
      }

      if (webServiceName != null)
      {
         WebServiceMBean webServer = (WebServiceMBean) MBeanProxyExt.create(WebServiceMBean.class, webServiceName);
         URL[] codebase = {webServer.addClassLoader(wcl)};

         wcl.setWebURLs(codebase);
      } // end of if ()

      container.setWebClassLoader(wcl);
      // Create classloader for this container
      // Only used to unique the bean ENC and does not augment class loading
      container.setClassLoader(new DelegatingClassLoader(wcl));

      // Set transaction manager
      InitialContext iniCtx = new InitialContext();
      container.setTransactionManager(tmFactory.getTransactionManager());

      // Set
      container.setTimerService(timerService);

      // Set security domain manager
      String securityDomain = bean.getApplicationMetaData().getSecurityDomain();
      // JBAS-5960: Set default security domain if there is security metadata
      boolean hasSecurityMetaData = hasSecurityMetaData(bean);
      if (securityDomain == null && hasSecurityMetaData)
      {
         securityDomain = SecurityConstants.DEFAULT_EJB_APPLICATION_POLICY;
      }
      String confSecurityDomain = conf.getSecurityDomain();
      // Default the config security to the application security manager
      if (confSecurityDomain == null)
         confSecurityDomain = securityDomain;

      // Check for an empty confSecurityDomain which signifies to disable security
      if (confSecurityDomain != null && confSecurityDomain.length() == 0)
         confSecurityDomain = null;

      if (confSecurityDomain != null)
      { // Either the application has a security domain or the container has security setup
         try
         {
            String unprefixed = SecurityUtil.unprefixSecurityDomain(confSecurityDomain);
            log.debug("Setting security domain from: " + confSecurityDomain);
            String domainCtx = SecurityConstants.JAAS_CONTEXT_ROOT + "/" + unprefixed + "/domainContext";
            SecurityDomainContext sdc = (SecurityDomainContext) iniCtx.lookup(domainCtx);
            Object securityMgr = sdc.getSecurityManager();

            // Object securityMgr = iniCtx.lookup(confSecurityDomain);
            AuthenticationManager ejbS = (AuthenticationManager) securityMgr;
            RealmMapping rM = (RealmMapping) securityMgr;
            container.setSecurityManager(ejbS);
            container.setRealmMapping(rM);

            container.setSecurityManagement(securityManagement);
            container.setPolicyRegistration(policyRegistration);

            container.setDefaultSecurityDomain((String) unit.getAttachment("EJB.defaultSecurityDomain"));
            container.setSecurityContextClassName((String) unit.getAttachment("EJB.securityContextClassName"));
         }
         catch (NamingException e)
         {
            throw new DeploymentException("Could not find the security-domain, name=" + confSecurityDomain, e);
         }
         catch (Exception e)
         {
            throw new DeploymentException("Invalid security-domain specified, name=" + confSecurityDomain, e);
         }
      }
      else
      {
         if ("".equals(securityDomain) && hasSecurityMetaData)
            log.warn("EJB configured to bypass security. Please verify if this is intended. Bean=" + bean.getEjbName()
                  + " Deployment=" + unit.getName());
      }

      // Load the security proxy instance if one was configured
      String securityProxyClassName = bean.getSecurityProxy();
      if (securityProxyClassName != null)
      {
         try
         {
            Class proxyClass = unitCl.loadClass(securityProxyClassName);
            Object proxy = proxyClass.newInstance();
            container.setSecurityProxy(proxy);
            log.debug("setSecurityProxy, " + proxy);
         }
         catch (Exception e)
         {
            throw new DeploymentException("Failed to create SecurityProxy of type: " + securityProxyClassName, e);
         }
      }

      // Install the container interceptors based on the configuration
      addInterceptors(container, transType, conf.getContainerInterceptorsConf());
View Full Code Here

         InvokerProxyBindingMetaData imd = amd.getInvokerProxyBindingMetaDataByName(invoker);
         if (imd == null)
         {
            String msg = "Failed to find InvokerProxyBindingMetaData for: '" + invoker
                  + "'. Check the invoker-proxy-binding-name to " + "invoker-proxy-binding/name mappings in jboss.xml";
            throw new DeploymentException(msg);
         }

         Element proxyFactoryConfig = imd.getProxyFactoryConfig();
         String webCL = MetaData.getOptionalChildContent(proxyFactoryConfig, "web-class-loader");
         if (webCL != null)
View Full Code Here

                  + " We will ignore this error, but you may miss a transport for this bean.");
         }
      }
      if (!foundOne)
      {
         throw new DeploymentException("Missing or invalid Container Invokers (in jboss.xml or standardjboss.xml).");
      }
   }
View Full Code Here

            beanLock = "org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock";
         lockClass = cl.loadClass(beanLock);
      }
      catch (Exception e)
      {
         throw new DeploymentException("Missing or invalid lock class (in jboss.xml or standardjboss.xml): " + beanLock
               + " - " + e);
      }

      lockManager.setLockCLass(lockClass);
      lockManager.setReentrant(reentrant);
View Full Code Here

      {
         ip = (InstancePool) cl.loadClass(conf.getInstancePool()).newInstance();
      }
      catch (Exception e)
      {
         throw new DeploymentException("Missing or invalid Instance Pool (in jboss.xml or standardjboss.xml)", e);
      }

      if (ip instanceof XmlLoadable)
         ((XmlLoadable) ip).importXml(conf.getContainerPoolConf());
View Full Code Here

      {
         ic = (InstanceCache) cl.loadClass(conf.getInstanceCache()).newInstance();
      }
      catch (Exception e)
      {
         throw new DeploymentException("Missing or invalid Instance Cache (in jboss.xml or standardjboss.xml)", e);
      }

      if (ic instanceof XmlLoadable)
         ((XmlLoadable) ic).importXml(conf.getContainerCacheConf());
View Full Code Here

TOP

Related Classes of org.jboss.deployment.DeploymentException

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.