Package org.jboss.deployment

Examples of org.jboss.deployment.DeploymentException


      URL docURL = di.localUrl;
      if (di.isXML == false)
         docURL = di.localCl.findResource("META-INF/jboss-aop.xml");
      // Validate that the descriptor was found
      if (docURL == null)
         throw new DeploymentException("Failed to find META-INF/jboss-aop.xml");
      return docURL;
   }
View Full Code Here


               log.debug("Loaded config: "+configNames[n]);
            }
         }
         else
         {
            throw new DeploymentException("Failed to find authConf as resource: "+authConf);
         }
      }
   }
View Full Code Here

               log.debug("Loaded config: "+configNames[n]);
            }
         }
         else
         {
            throw new DeploymentException("Failed to find authConf as resource: "+authConf);
         }
      }
   }
View Full Code Here

        // Setup the third constructor argument (vfs deployment unit).
        bmdBuilder.addConstructorParameter(VFSDeploymentUnit.class.getName(), deploymentUnit);
        if (warFilesDir == null)
        {
            final String errorMsg = String.format("No property named '%s' was configured in jbossesb.sar/META-INF/jboss-service.xml for %s", "warFilesDir", getClass().getName());
            throw new DeploymentException(errorMsg);
        }
       
        final File tmpDir = new File(warFilesDir);
        if (!tmpDir.exists())
        {
            final String errorMsg = String.format("The directory configured for %s='%s' does not exist.", "warFilesDir", tmpDir);
            throw new DeploymentException(errorMsg);
        }
        // Setup the fourth constructor argument (temp war directory).
        File esbWarFiles = JBossDeployerUtil.createDir(tmpDir, "esbwarfiles");
        bmdBuilder.addConstructorParameter(File.class.getName(), esbWarFiles);
        // Add management annotation.
View Full Code Here

        {
            esbConfigFiles = file.getChildrenRecursively(configFileFilter);
        }
        catch (final IOException e)
        {
            throw new DeploymentException(e.getMessage(), e);
        }

        if (esbConfigFiles.size() == 0)
        {
            throw new DeploymentException("No JBossESB configuration could be located the archive '" + file + "'");
        }
        else if (esbConfigFiles.size() > 1)
        {
            throw new DeploymentException("Only one JBossESB configuration can exist in an archive. Please check '" + file + "'");
        }
        else
        {
            return esbConfigFiles.get(0);
        }
View Full Code Here

                }
            }
        }
        catch (final IOException e)
        {
            throw new DeploymentException(e.getMessage(), e);
        }
        return dependencies;
    }
View Full Code Here

                    ObjectName on = ObjectNameConverter.convert(canonicalName);
                    deps.add(on) ;
                }
                catch (MalformedObjectNameException e)
                {
                    throw new DeploymentException(e.getMessage(), e);
                }
            }
        }
        return deps;
    }
View Full Code Here

                        publishers.add(publisher);
                    }
                }
                catch (final Exception ex)
                {
                    throw new DeploymentException("Failed to create webservice artifact", ex);
                }
            }
        }
    }
View Full Code Here

   public void init(DeploymentInfo di) throws DeploymentException
   {
      if (warFilesDir == null)
      {
          final String errorMsg = String.format("No property named '%s' was configured in jbossesb.sar/META-INF/jboss-service.xml for %s", "warFilesDir", getClass().getName());
          throw new DeploymentException(errorMsg);
      }
         
      final File tmpDir = new File(warFilesDir);
      if (!tmpDir.exists())
      {
          final String errorMsg = String.format("The directory configured for %s='%s' does not exist.", "warFilesDir", tmpDir);
          throw new DeploymentException(errorMsg);
      }
     
      esbWarFiles = JBossDeployerUtil.createDir(tmpDir, "esbwarfiles");
     
      try
      {
         if (di.url.getProtocol().equalsIgnoreCase("file"))
         {
            File file = new File(di.url.getFile());

            if (!file.isDirectory())
            {
               // If not directory we watch the package
               di.watch = di.url;
            }
            else
            {
               // If directory we watch the xml files
               di.watch = new URL(di.url, "META-INF/jboss-esb.xml");
            }
         }
         else
         {
            // We watch the top only, no directory support
            di.watch = di.url;
         }

         XmlFileLoader xfl = new XmlFileLoader();
         InputStream in = di.localCl.getResourceAsStream("META-INF/deployment.xml");
         if (in != null)
         {
            try
            {
               Element jboss = xfl.getDocument(in, "META-INF/deployment.xml").getDocumentElement();
               // Check for a ejb level class loading config
               Element loader = MetaData.getOptionalChild(jboss, "loader-repository");
               if (loader != null)
               {
                  LoaderRepositoryFactory.LoaderRepositoryConfig config =
                          LoaderRepositoryFactory.parseRepositoryConfig(loader);
                  di.setRepositoryInfo(config);
               }

            }
            finally
            {
               in.close();
            }
         }
        
         final URL document = getDocumentUrl(di);
        
         if (document == null)
         {
            throw new DeploymentException("Unable to find document url of META-INF/jboss-esb.xml in: "
                    + di.url);
         }

         JBoss4ESBDeployment deployment = new JBoss4ESBDeployment(document, di, esbWarFiles);
         final Set<ObjectName> deps = new HashSet<ObjectName>();
         addActionDependencies(di.shortName, deployment.getModel(), deps) ;

         initialiseDeploymentName(deployment) ;
         final String deploymentName = deployment.getDeploymentName() ;
         di.context.put(JBoss4ESBDeploymentMetaData.class, new JBoss4ESBDeploymentMetaData(deployment, deploymentName, deps)) ;

         // invoke super-class initialization
         super.init(di);

      }
      catch (Exception e)
      {
         if (e instanceof DeploymentException)
         {
            throw(DeploymentException) e;
         }
         throw new DeploymentException("failed to initialize", e);
      }
   }
View Full Code Here

                        final String deployablePath = (urlPath.endsWith("/") ? urlPath.substring(0, urlPath.length()-1) : urlPath) ;
                        final int lastSeparator = deployablePath.lastIndexOf('/') ;
                        final String deployable = (lastSeparator >= 0 ? deployablePath.substring(lastSeparator+1) : deployablePath) ;
                        if (subDeploymentLocationMap.put(deployable, subDI) != null)
                        {
                           throw new DeploymentException("Duplicate subDeployment name: " + deployable) ;
                        }
                     }
                  }
                  else
                  {
                     throw new DeploymentException("No subdeployments to match esb-depends") ;
                  }
                 
                  do
                  {
                     Element depend = (Element)esbDepends.next();
                     final String deployable = MetaData.getElementContent(depend) ;
                     final DeploymentInfo subDI = subDeploymentLocationMap.get(deployable) ;
                     if ((subDI != null) && subDI.context.containsKey(AbstractWebContainer.WEB_MODULE))
                     {
                        final ObjectName jmxName = (ObjectName) subDI.context.get(AbstractWebContainer.WEB_MODULE) ;
                        deps.add(jmxName) ;
                     }
                     else
                     {
                         throw new DeploymentException("Could not locate WAR subdeployment matching: " + deployable) ;
                     }
                  }
                  while (esbDepends.hasNext()) ;
               }
            }
            finally
            {
               in.close();
            }
         }

         String name = PREFIX_CANONICAL_NAME + metaData.getDeploymentName();
         ObjectName on = ObjectNameConverter.convert(name);
         // Check that the name is not registered
         if (server.isRegistered(on) == true)
         {
            throw new DeploymentException("Duplicate registration for " + name) ;
         }
        
         final JBoss4ESBDeployment deployment = metaData.getDeployment() ;
         deployment.setClassloader(di.ucl);
         server.registerMBean(deployment, on);
         di.deployedObject = on;
         log.debug("Deploying: " + di.url);
         // Invoke the create life cycle method
         serviceController.create(di.deployedObject, deps);
      }
      catch (Exception e)
      {
         throw new DeploymentException("Error during create of ESB Module: "
                 + di.url, e);
      }
      super.create(di);
   }
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.