Package org.jboss.deployers.spi

Examples of org.jboss.deployers.spi.DeploymentException


               final String configPropName = JBossASServerConfig.PROP_KEY_JBOSSAS_SERVER_CONF_URL;
               String configPath = System.getProperty(configPropName);
               if(configPath == null )
               {
                  if(ignoreMissingStandardJBossXml == false)
                     throw new DeploymentException("standardjboss.xml not specified and "+configPropName+" does not exist");
                  return null;
               }
               URL configUrl = new URL(configPath);
               standardJBossXmlPath = new URL(configUrl, "standardjboss.xml");
            }

            VirtualFile stdJBoss = VFS.getChild(standardJBossXmlPath);
            if (stdJBoss == null && ignoreMissingStandardJBossXml == false)
            {
               throw new DeploymentException("standardjboss.xml not found in config dir: " + standardJBossXmlPath);
            }
            standardMetaData = super.parse(stdJBoss);
         }
         catch (Exception ex)
         {
View Full Code Here


      {
         interceptorClasses = this.loadClasses(unit.getClassLoader(), interceptorClassNames);
      }
      catch (ClassNotFoundException cnfe)
      {
         throw new DeploymentException("Exception while loading interceptor classes for unit " + unit.getName(), cnfe);
      }
      // Process the interceptor classes
      AnnotationFinder<AnnotatedElement> annotationFinder = new DefaultAnnotationFinder<AnnotatedElement>();
      InterceptorMetaDataCreator interceptorMetaDataCreator = new InterceptorMetaDataCreator(annotationFinder);
      // create interceptors metadata from the interceptor classes
View Full Code Here

     
      String modulePath = unit.getRelativePath();
      ModulesMetaData modules = appMetaData.getModules();
      if (modules == null)
      {
         throw new DeploymentException(unit + " has attached " + JBossAppMetaData.class.getSimpleName() +
               " but it has no associated " + ModulesMetaData.class.getSimpleName());
      }
      ModuleMetaData ourModule = null;
      String uniqueName = null;
      // Synchronize on the modules to ensure concurrent deployments of the
      // modules pass serially through this logic
      synchronized(modules)
      {
         ourModule = modules.get(modulePath);
         if (ourModule == null)
         {
            String parentUnitName = unit.getParent().getName();
            throw new DeploymentException("No module with relative path " +
                  modulePath + " found  in set of modules for " + parentUnitName + " "  + modules.keySet());
         }
        
          uniqueName = name;
          if (!isNameUnique(uniqueName, ourModule, modules))
View Full Code Here

   {
      VirtualFile root = unit.getRoot();
      String relativePath = unit.getRelativePath();
      VirtualFile ear = unit.getFile(relativePath);
      if (ear == null)
         throw new DeploymentException("No such ear file, relative path: '" + relativePath + "', root: " + root);

      deploy(unit, root, ear);
   }
View Full Code Here

         // If the verifier is in strict mode and an error/warning
         // was found in the Verification process, throw a Deployment
         // Exception
         if( strictVerifier && !allOK )
         {
            throw new DeploymentException("Verification of Enterprise Beans failed, see above for error messages.");
         }
      }

      ServiceMetaData ejbModule = new ServiceMetaData();
      ejbModule.setCode(EjbModule.class.getName());


      // Build an escaped JMX name including deployment shortname
      ObjectName moduleObjectName = null;
      try
      {
         moduleObjectName = this.getObjectName(unit, deployment);
      }
      catch(MalformedObjectNameException e)
      {
         throw new DeploymentException("Failed to create EJB module " + unit.getName() +
            ": malformed EjbModule name", e);
      }

      ejbModule.setObjectName(moduleObjectName);

      ServiceConstructorMetaData ctor = new ServiceConstructorMetaData();
      ctor.setSignature(
         new String[]{VFSDeploymentUnit.class.getName(), ApplicationMetaData.class.getName()}
      );
      ctor.setParameters(new Object[]{unit, legacyMD});
      ejbModule.setConstructor(ctor);

      // set attributes
      List<ServiceAttributeMetaData> attrs = new ArrayList<ServiceAttributeMetaData>();
      // Transaction manager
      ServiceAttributeMetaData attr = new ServiceAttributeMetaData();
      attr.setName("TransactionManagerFactory");
      ServiceDependencyValueMetaData dependencyValue = new ServiceDependencyValueMetaData();
      dependencyValue.setDependency(getTransactionManagerServiceName());
      dependencyValue.setProxyType("attribute");
      attr.setValue(dependencyValue);
      attrs.add(attr);
      // Security management
      attr = new ServiceAttributeMetaData();
      attr.setName("SecurityManagement");
      ServiceInjectionValueMetaData injectionValue = new ServiceInjectionValueMetaData(securityManagementName);
      attr.setValue(injectionValue);
      attrs.add(attr);
      //Policy Registration
      attr = new ServiceAttributeMetaData();
      attr.setName("PolicyRegistration");
      ServiceInjectionValueMetaData prInjectionValue = new ServiceInjectionValueMetaData(policyRegistrationName);
      attr.setValue(prInjectionValue);
      attrs.add(attr);
      // Add injection of the WebServiceName
      String wsName = getWebServiceName();
      if (wsName != null)
      {
         ServiceAttributeMetaData ws = new ServiceAttributeMetaData();
         ws.setName("WebServiceName");
         ServiceDependencyValueMetaData wsDepends = new ServiceDependencyValueMetaData();
         wsDepends.setDependency(wsName);
         ws.setValue(wsDepends);
         attrs.add(ws);
      }
      // Injection of the TimerService
      ServiceAttributeMetaData tms = new ServiceAttributeMetaData();
      ServiceDependencyValueMetaData tmsDepends = new ServiceDependencyValueMetaData();
      tms.setName("TimerService");
      tmsDepends.setDependency(timerServiceName);
      tmsDepends.setProxyType("attribute");
      tms.setValue(tmsDepends);
      attrs.add(tms);

      ejbModule.setAttributes(attrs);

      List<ServiceDependencyMetaData> dependencies = new ArrayList<ServiceDependencyMetaData>();
      // CCM for CachedConnectionInterceptor dependency
      // TODO: this should be injected directly to the interceptor
      if( ccmServiceName != null && ccmServiceName.length() > 0 )
      {
         ServiceDependencyMetaData ccm = new ServiceDependencyMetaData();
         ccm.setIDependOn(ccmServiceName);
         dependencies.add(ccm);
      }
      // Add dependencies on the invoker services in use
      JBossEnterpriseBeansMetaData beans = deployment.getEnterpriseBeans();
      Iterator<JBossEnterpriseBeanMetaData> beansIter = beans.iterator();
      HashSet<String> invokerNames = new HashSet<String>();
      HashSet<String> beanDepends = new HashSet<String>();
      // Process ContainerDependencyMetaData
      VFSDeploymentUnit topUnit = unit.getTopLevel();
      Map<String, ContainerDependencyMetaData> endpoints = (Map<String, ContainerDependencyMetaData>) topUnit.getAttachment(MappedReferenceMetaDataResolverDeployer.ENDPOINT_MAP_KEY);
      if(endpoints == null)
         log.warn(unit+" has no ContainerDependencyMetaData attachment");
      String vfsPath = unit.getRelativePath();
      ArrayList<BeanMetaData> mcBeanMD = new ArrayList<BeanMetaData>();
      while( beansIter.hasNext() )
      {
         JBossEnterpriseBeanMetaData bmd = beansIter.next();
         Set<String> depends = bmd.getDepends();
         if (depends != null)
            beanDepends.addAll(depends);
         String configName = bmd.getConfigurationName();
         ContainerConfigurationMetaData cmd = bmd.determineContainerConfiguration();
         Set<String> invokers = cmd.getInvokerProxyBindingNames();
         if(invokers != null)
         for(String iname : invokers)
         {
            InvokerProxyBindingMetaData imd = deployment.getInvokerProxyBinding(iname);
            if (imd == null)
               throw new DeploymentException("Failed to locate invoker: "+iname);
            String invokerName = imd.getInvokerMBean();
            if( invokerName.equalsIgnoreCase("default") )
            {
               // TODO: JBAS-4306 hack to ingore the invalid default invoker-mbean
               continue;
View Full Code Here

         PolicyConfiguration pc = pcFactory.getPolicyConfiguration(contextID, true);
         unit.addAttachment(PolicyConfiguration.class, pc);
      }
      catch (PolicyContextException e)
      {
         throw new DeploymentException("PolicyContextException generated in deploy", e);
      }
      catch(Exception e)
      {
         throw new DeploymentException("Exception generated in deploy", e);
      }
     
   }
View Full Code Here

      Class interfaceClass = cl.loadClass(interfaceName);

      // Determine the implementation class
      String implName = aomd.getAdminObjectImplementationClass();
      if (implName == null)
         throw new DeploymentException("No implementation class for admin object '" + interfaceClass + "' ra="
               + rarName);

      // Load the implementation class
      if (trace)
         log.trace("AdminObject '" + jndiName + "' loading implementation=" + implName);
      Class implClass = cl.loadClass(implName);
      if (interfaceClass.isAssignableFrom(implClass) == false)
         throw new DeploymentException(implClass.getName() + " is not a '" + interfaceClass + "' ra=" + rarName);

      Object result = implClass.newInstance();
      if (trace)
         log.trace("AdminObject '" + jndiName + "' created instance=" + result);

      // Create ConfigPropertyHandler for the AdminObject
      ConfigPropertyHandler configPropertyHandler = new ConfigPropertyHandler(result, implClass, "AdminObject: ");
     
      // Apply values from the ra.xml
      Collection raProperties = aomd.getProperties();
      if (raProperties != null && raProperties.size() != 0)
      {
        
         for (Iterator i = raProperties.iterator(); i.hasNext();)
         {
            ConfigPropertyMetaData cpmd = (ConfigPropertyMetaData) i.next();
            String name = cpmd.getName();
            String value = cpmd.getValue();
            if (value != null && value.length() > 0)
            {
               if (properties.containsKey(name))
               {
                  if (trace)
                     log.trace("AdminObject '" + jndiName + "' property=" + name + " IGNORING value=" + value
                           + " specified in MBean properties.");
               }
               else
               {
                  // Load the property class as defined in the meta data
                  String typeName = cpmd.getType();
                  if (trace)
                     log.trace("AdminObject '" + jndiName + "' property=" + name + " loading class=" + typeName);

                  try
                  {
                     configPropertyHandler.handle(cpmd);
                  }
                  catch (InvocationTargetException e)
                  {
                     DeploymentException.rethrowAsDeploymentException("Error for property '" + name + "' class="
                           + implClass + "' for admin object '" + interfaceClass + "' ra=" + rarName, e
                           .getTargetException());
                  }
                  catch (Throwable t)
                  {
                     DeploymentException.rethrowAsDeploymentException("Error for property '" + name + "' class="
                           + implClass + "' for admin object '" + interfaceClass + "' ra=" + rarName, t);
                  }
               }
            }
         }
      }

      // Apply the properties
      if (properties != null)
      {
         for (Iterator i = properties.entrySet().iterator(); i.hasNext();)
         {
            Map.Entry property = (Map.Entry) i.next();
            String name = (String) property.getKey();
            String value = (String) property.getValue();
           
            if (trace)
               log.trace("AdminObject '" + jndiName + "' property=" + name + " value=" + value);

            // Pick up the property metadata
            ConfigPropertyMetaData cpmd = aomd.getProperty(name);
            if (cpmd == null)
               throw new DeploymentException("No property '" + name + "' for admin object '" + interfaceClass + "' ra="
                     + rarName);
           
            // Make copy of the ConfigPropertyMetaData with new value
            ConfigPropertyMetaData cpmdCopy = new ConfigPropertyMetaData();
            cpmdCopy.setName(name);
View Full Code Here

      {
         JMXExceptionDecoder.rethrow(e);
      }

      if (ccm == null)
         throw new DeploymentException("cached ConnectionManager not found: " + ccmName);

      if (managedConnectionPoolName == null)
         throw new DeploymentException("managedConnectionPool not set!");
      try
      {
         poolingStrategy = (ManagedConnectionPool) server.getAttribute(managedConnectionPoolName,
               "ManagedConnectionPool");
      }
View Full Code Here

                     {
                        aClasses.add(c);
                     }
                     builder.append(" ").append(c.getName());
                  }
                  if (aClasses.size() > 1) throw new DeploymentException(builder.toString());
                  else if (aClasses.size() == 1)
                  {
                     Class<? extends Application> aClass = applicationClass.iterator().next();
                     resteasyDeploymentData.setScannedApplicationClass(aClass);
                  }
View Full Code Here

         {
            clazz = loader.loadClass(servletClass);
         }
         catch (ClassNotFoundException e)
         {
            throw new DeploymentException(e);
         }
         if (Application.class.isAssignableFrom(clazz))
         {
            servlet.setServletClass(HttpServlet30Dispatcher.class.getName());
            servlet.setAsyncSupported(true);
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.