Package org.jboss.deployers.spi

Examples of org.jboss.deployers.spi.DeploymentException


      {
         this.activateProfile(true);
      }
      catch (Exception e)
      {
         throw new DeploymentException("Could not activate on-demand profile: " + this.getProfileName()
               + " while deploying unit: " + unit);
      }
   }
View Full Code Here


      }
      catch(Exception e)
      {
         log.error("Could not deploy " + unit.getName(), e);
         undeploy(unit, metaData);
         throw new DeploymentException("Could not deploy " + unit.getName(), e);
      }
   }
View Full Code Here

         // TODO: temporarily disable the security deployment
         unit.addAttachment(JaccPolicyUtil.IGNORE_ME_NAME, true, Boolean.class);
      }
      catch (Exception e)
      {
         throw new DeploymentException(e);
      }
   }
View Full Code Here

   }

   protected void startService() throws Exception
   {
      if (mcf != null)
         throw new DeploymentException("Stop the RARDeployment before restarting it");

      ResourceAdapter resourceAdapter = null;
      ConnectionDefinitionMetaData cdmd = cmd.getConnectionDefinition(dmd.getConnectionDefinition());
      rarName = dmd.getRarName();
      try
      {
         resourceAdapter = (ResourceAdapter) getServer().getAttribute(oldRarDeployment, "ResourceAdapter");

         if (cdmd == null)
            throw new DeploymentException("ConnectionDefinition '" + connectionDefinition + "' not found in rar '"
                  + rarName + "'");

         setManagedConnectionFactoryClass(cdmd.getManagedConnectionFactoryClass());
         setReauthenticationSupport(cmd.getReauthenticationSupport());
      }
      catch (Exception e)
      {
         throw new DeploymentException("couldn't get oldRarDeployment! " + oldRarDeployment, e);
      }
     
      try
      {
         mcfClass = Thread.currentThread().getContextClassLoader().loadClass(cdmd.getManagedConnectionFactoryClass());
      }
      catch (ClassNotFoundException cnfe)
      {
         log.error("Could not find ManagedConnectionFactory class: " + managedConnectionFactoryClass, cnfe);
         throw new DeploymentException("Could not find ManagedConnectionFactory class: "
               + managedConnectionFactoryClass);
      }
      try
      {
         mcf = (ManagedConnectionFactory) mcfClass.newInstance();
      }
      catch (Exception e)
      {
         log.error("Could not instantiate ManagedConnectionFactory: " + managedConnectionFactoryClass, e);
         throw new DeploymentException("Could not instantiate ManagedConnectionFactory: "
               + managedConnectionFactoryClass);
      }
     
      if (cmd != null)
      {
View Full Code Here

      try
      {
         // Find the meta data
         MessageListenerMetaData mlmd = cmd.getMessageListener(messagingType.getName());
         if (mlmd == null)
            throw new DeploymentException("MessagingType '" + messagingType.getName() + "' not found in resource deployment " + getServiceName());
        
         return ActivationSpecFactory.createActivationSpec(getServiceName(), messagingType.getName(), activationConfig, mlmd);
      }
      catch (Exception e)
      {
View Full Code Here

      else if ("ByApplication".equals(criteria))
         poolingStrategy = new PoolByCri(mcf, poolParams, noTxSeparatePools, this, log);
      else if ("ByNothing".equals(criteria))
         poolingStrategy = new OnePool(mcf, poolParams, noTxSeparatePools, this, log);
      else
         throw new DeploymentException("Unknown pooling criteria: " + criteria);
        
   }
View Full Code Here

   }

   protected void startService() throws Exception
   {
      if (mcf != null)
         throw new DeploymentException("Stop the RARDeployment before restarting it");

      ConnectorMetaData cmd = null;
      ConnectionDefinitionMetaData cdmd = null;
      ResourceAdapter resourceAdapter = null;
      if (oldRarDeployment != null)
      {
         try
         {
            resourceAdapter = (ResourceAdapter) getServer().getAttribute(oldRarDeployment, "ResourceAdapter");
            cmd = (ConnectorMetaData) getServer().getAttribute(oldRarDeployment, "MetaData");
            cdmd = cmd.getConnectionDefinition(connectionDefinition);
            if (cdmd == null)
               throw new DeploymentException("ConnectionDefinition '" + connectionDefinition + "' not found in rar '" + rarName + "'");
            setManagedConnectionFactoryClass(cdmd.getManagedConnectionFactoryClass());
            setReauthenticationSupport(cmd.getReauthenticationSupport());
         }
         catch (Exception e)
         {
            throw new DeploymentException("couldn't get oldRarDeployment! " + oldRarDeployment, e);
         }
      }
      try
      {
         mcfClass = Thread.currentThread().getContextClassLoader().loadClass(managedConnectionFactoryClass);
      }
      catch (ClassNotFoundException cnfe)
      {
         log.error("Could not find ManagedConnectionFactory class: " + managedConnectionFactoryClass, cnfe);
         throw new DeploymentException("Could not find ManagedConnectionFactory class: "
               + managedConnectionFactoryClass);
      }
      try
      {
         mcf = (ManagedConnectionFactory) mcfClass.newInstance();
      }
      catch (Exception e)
      {
         log.error("Could not instantiate ManagedConnectionFactory: " + managedConnectionFactoryClass, e);
         throw new DeploymentException("Could not instantiate ManagedConnectionFactory: "
               + managedConnectionFactoryClass);
      }
      if (cmd != null)
      {
         // Set the resource adapter properties
View Full Code Here

         Util.rebind(ctx, bindName, cf);
         log.info("Bound ConnectionManager '" + serviceName + "' to JNDI name '" + bindName + "'");
      }
      catch (NamingException ne)
      {
         throw new DeploymentException("Could not bind ConnectionFactory into jndi: " + bindName, ne);
      }
      finally
      {
         ctx.close();
      }
View Full Code Here

            + ",J2EEApplication=none,J2EEServer=none";

      ObjectName objectName = new ObjectName(objectNameS);

      if (Registry.getRegistry(null, null).getMBeanServer().isRegistered(objectName))
         throw new DeploymentException("Web mapping already exists for deployment URL " + warUrlStr);

      Registry.getRegistry(null, null).registerComponent(context, objectName, config.getContextClassName());

      context.setInstanceManager(injectionContainer);
      context.setPublicId(metaData.getPublicID());

      String docBase = depUnit.getAttachment("org.jboss.web.explicitDocBase", String.class);
      if (docBase == null)
         docBase = VFS.getChild(warUrl).getPhysicalFile().getAbsolutePath();

      context.setDocBase(docBase);

      // If there is an alt-dd set it
      if (metaData.getAlternativeDD() != null)
      {
         log.debug("Setting altDDName to: " + metaData.getAlternativeDD());
         context.setAltDDName(metaData.getAlternativeDD());
      }
      context.setJavaVMs(javaVMs);
      context.setServer(serverName);

      if (webLoader != null)
      {
         context.setLoader(webLoader);
      }
      else
      {
         context.setParentClassLoader(loader);
      }

      // Set the session cookies flag according to metadata
      switch (metaData.getSessionCookies())
      {
         case JBossWebMetaData.SESSION_COOKIES_ENABLED:
            context.setCookies(true);
            log.debug("Enabling session cookies");
            break;
         case JBossWebMetaData.SESSION_COOKIES_DISABLED:
            context.setCookies(false);
            log.debug("Disabling session cookies");
            break;
         default:
            log.debug("Using session cookies default setting");
      }

      String metaDataSecurityDomain = metaData.getSecurityDomain();
      if (metaDataSecurityDomain != null)
         metaDataSecurityDomain = metaDataSecurityDomain.trim();
     
      // Add a valve to establish security and naming context
      SecurityContextEstablishmentValve scevalve = new SecurityContextEstablishmentValve(metaDataSecurityDomain, SecurityUtil.unprefixSecurityDomain(config
            .getDefaultSecurityDomain()), SecurityActions.loadClass(config.getSecurityContextClassName()), getSecurityManagement(), component);
      context.addValve(scevalve);

      // Add a valve to estalish the JACC context before authorization valves
      Certificate[] certs = null;
      CodeSource cs = new CodeSource(warUrl, certs);
      JaccContextValve jaccValve = new JaccContextValve(metaData, cs);
      context.addValve(jaccValve);

      // Set listener
      context.setConfigClass("org.jboss.web.tomcat.service.deployers.JBossContextConfig");
      context.addLifecycleListener(new EncListener(loader, webLoader, injectionContainer, webApp));
     
      // Pass the metadata to the RunAsListener via a thread local
      RunAsListener.metaDataLocal.set(metaData);
      JBossContextConfig.metaDataLocal.set(metaData);
      JBossContextConfig.deployerConfig.set(config);
      JBossContextConfig.tldMetaDataMapLocal.set(tldMetaDataMap);
      NamingListener.idLocal.set(component);

      JBossContextConfig.kernelLocal.set(kernel);
      JBossContextConfig.deploymentUnitLocal.set(unit);
      try
      {
         // JBAS-8406: Temp hack, will move to NamingListener
         CurrentComponent.push(component);
         // Start it
         CDIExceptionStore.reset();
         context.start();
         // Build the ENC
         // JBAS-8278: abort deployment if there are CDI definitions errors
         if (CDIExceptionStore.currentExceptions().size()>0)
         {
            throw CDIExceptionStore.currentExceptions().get(0);
         }
      }
      catch (Throwable t)
      {
         context.destroy();
         DeploymentException.rethrowAsDeploymentException("URL " + warUrlStr + " deployment failed", t);
      }
      finally
      {
         RunAsListener.metaDataLocal.set(null);
         JBossContextConfig.metaDataLocal.set(null);
         JBossContextConfig.deployerConfig.set(null);
         JBossContextConfig.tldMetaDataMapLocal.set(null);
         NamingListener.idLocal.set(null);

         JBossContextConfig.kernelLocal.set(null);
         JBossContextConfig.deploymentUnitLocal.set(null);
         // JBAS-8406: Temp hack, will move to NamingListener
         CurrentComponent.pop();
         // JBAS-8278
         CDIExceptionStore.reset();
      }
      if (context.getState() != 1)
      {
         context.destroy();
         throw new DeploymentException("URL " + warUrlStr + " deployment failed");
      }

      /*
       * Add security association valve after the authorization valves so that the authenticated user may be associated
       * with the request thread/session.
View Full Code Here

         {
            resolve(unit, endpointMap, beans, resolver, unresolvedPaths);
         }
         catch (Exception e)
         {
            throw new DeploymentException(e);
         }
         if(unresolvedPaths.size() > 0)
            log.warn("Unresolved references exist in JBossMetaData:"+unresolvedPaths);
      }
      if(webMetaData != null)
      {
         // Process web app references
         ContainerDependencyMetaData webAppCDMD = new ContainerDependencyMetaData(unit.getSimpleName(), "web-app", unit.getRelativePath());
         try
         {
            resolve(webAppCDMD, unit, endpointMap, webMetaData.getJndiEnvironmentRefsGroup(), resolver, unresolvedPaths);
         }
         catch (Exception e)
         {
            throw new DeploymentException(e);
         }
         if(unresolvedPaths.size() > 0)
            log.warn("Unresolved references exist in JBossWebMetaData:"+unresolvedPaths);
      }
      if(clientMetaData != null)
      {
         // Process client app references
         ContainerDependencyMetaData clientCDMD = new ContainerDependencyMetaData(unit.getSimpleName(), "client", unit.getRelativePath());
         try
         {
            resolve(clientCDMD, unit, endpointMap, clientMetaData.getJndiEnvironmentRefsGroup(), resolver, unresolvedPaths);
         }
         catch (Exception e)
         {
            throw new DeploymentException(e);
         }
         if(unresolvedPaths.size() > 0)
            log.warn("Unresolved references exist in JBossClientMetaData: "+unresolvedPaths);
      }
      // Add the unique set of ContainerDependencyMetaData
View Full Code Here

TOP

Related Classes of org.jboss.deployers.spi.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.