Examples of DeploymentException


Examples of org.apache.geronimo.common.DeploymentException

   
    public void configureEJB(GBeanData targetGBean, JarFile moduleFile, Object portInfo,
                             ClassLoader classLoader)
        throws DeploymentException {

        throw new DeploymentException("configureEJB NYI");
    }
View Full Code Here

Examples of org.apache.geronimo.common.DeploymentException

   
    Class<?> loadSEI(String className, ClassLoader loader) throws DeploymentException {
        try {
            return loader.loadClass(className);
        } catch (ClassNotFoundException ex) {
            throw new DeploymentException("unable to load Service Endpoint Interface: " + className, ex);
        }
    }
View Full Code Here

Examples of org.apache.geronimo.deployment.DeploymentException

        return true;
    }

    public void execute(PrintWriter out, ServerConnection connection, String[] args) throws DeploymentException {
        if(connection.isOnline()) {
            throw new DeploymentException("This command cannot be run when the server is running.  Make sure the server is shut down first.");
        }
        String classPath = null;
        String mainClass = null;
        File module = null;
        File plan = null;
View Full Code Here

Examples of org.apache.jetspeed.deployment.DeploymentException

            new JetspeedDeploy(event.getPath(), toFile.getAbsolutePath(), stripLoggers);
            event.setStatus(DeploymentStatus.STATUS_OKAY);
        }
        catch (Exception e)
        {
            throw new DeploymentException(e);
        }
    }
View Full Code Here

Examples of org.apache.pluto.util.deploy.DeploymentException

     */
    protected File getConfigDir(DeploymentConfig config) throws DeploymentException {
        File dir = super.getConfigDir(config);
        String serv = config.getDeploymentProperty("tomcat.service");
        if(serv == null) {
            throw new DeploymentException("tomcat.service is not defined");
        }
        dir = new File(dir, serv);
        String host = config.getDeploymentProperty("tomcat.host");
        if(host == null) {
            throw new DeploymentException("tomcat.host is not defined");
        }
        dir = new File(dir, host);
        dir.mkdirs();
        return dir;
    }
View Full Code Here

Examples of org.apache.webbeans.exception.inject.DeploymentException

    {
        String id = (String) s.readObject();
        Bean<T> b = (Bean<T>) WebBeansContext.currentInstance().getBeanManagerImpl().getPassivationCapableBean(id);
        if (b == null)
        {
            throw new DeploymentException("cannot deserialize Bean with PassivationCapable id=" + id);
        }
        if (b instanceof SerializableBean)
        {
            b = ((SerializableBean<T>)b).getBean();
        }
View Full Code Here

Examples of org.gatein.pc.portlet.impl.deployment.DeploymentException

            bytes = IOTools.getBytes(is);
            is = new ByteArrayInputStream(bytes);
         }
         catch (IOException e)
         {
            throw new DeploymentException("Could not read portlet.xml descriptor", e);
         }
      }

      PortletApplication20MetaData md = new PortletApplication20MetaData();

      //
      inputFactory.setProperty("javax.xml.stream.isCoalescing", true);
      StaxNavigator<Element> nav = null;
      try
      {
         XMLStreamReader stream = inputFactory.createXMLStreamReader(is);
         nav = StaxNavigatorFactory.create(new Naming.Enumerated.Simple<Element>(Element.class, null), stream);
      }
      catch (XMLStreamException e)
      {
         throw new DeploymentException("Could not create a STAX reader", e);
      }

      // We want to trim content (mandated by the spec)
      nav.setTrimContent(true);

      // Get the root element qname
      QName qname = nav.getQName();
      String rootNS = qname.getNamespaceURI();

      // Determine the correct version to parse
      int version;
      if (PORTLET_1_0.equals(rootNS))
      {
         md.setVersion("1.0");
         version = 1;
      }
      else if (PORTLET_2_0.equals(rootNS))
      {
         md.setVersion("2.0");
         version = 2;
      }
      else
      {
         throw new StaxNavException("Illegal portlet xml namespace " + rootNS);
      }

      // Perform schema validation if required
      if (schemaValidation)
      {
         XSD xsd = version == 1 ? XSD.PORTLET_1_0 : XSD.PORTLET_2_0;
         try
         {
            xsd.validate(new StreamSource(new ByteArrayInputStream(bytes)));
         }
         catch (Exception e)
         {
            throw new DeploymentException("The portlet.xml file is not valid XML", e);
         }
      }

      //
      assert Element.portlet_app == nav.getName();

      //
      if (nav.child() == null)
      {
         return md;
      }

      //
      for (StaxNavigator<Element> portletNav : nav.fork(Element.portlet))
      {
         PortletMetaData portletMD = new PortletMetaData();

         //
         portletMD.setId(portletNav.getAttribute("id"));
         portletMD.setDescription(readLocalizedString(portletNav, Element.description));
         portletMD.setPortletName(getContent(portletNav, Element.portlet_name));
         portletMD.setDisplayName(readLocalizedString(portletNav, Element.display_name));
         portletMD.setPortletClass(getContent(portletNav, Element.portlet_class));

         //
         for (InitParamMetaData initParamMD : readInitParams(portletNav))
         {
            portletMD.addInitParam(initParamMD);
         }

         //
         if (portletNav.next(Element.expiration_cache))
         {
            portletMD.setExpirationCache(Integer.parseInt(portletNav.getContent()));
         }
         if (portletNav.next(Element.cache_scope))
         {
            portletMD.setCacheScope(PortletCacheScopeEnum.valueOf(portletNav.getContent()));
         }

         //
         while (portletNav.next(Element.supports))
         {
            SupportsMetaData supportsMD = new SupportsMetaData();
            supportsMD.setId(portletNav.getAttribute("id"));
            supportsMD.setMimeType(getContent(portletNav, Element.mime_type));
            while (portletNav.next(Element.portlet_mode)) {
               PortletModeMetaData portletModeMD = new PortletModeMetaData();
               portletModeMD.setPortletMode(Mode.create(portletNav.getContent()));
               supportsMD.addPortletMode(portletModeMD);
            }
            while (portletNav.next(Element.window_state)) {
               WindowStateMetaData windowStateMD = new WindowStateMetaData();
               windowStateMD.setWindowState(WindowState.create(portletNav.getContent()));
               supportsMD.addWindowState(windowStateMD);
            }
            portletMD.addSupport(supportsMD);
         }

         //
         while (portletNav.next(Element.supported_locale))
         {
            SupportedLocaleMetaData supportedLocaleMD = new SupportedLocaleMetaData();
            supportedLocaleMD.setLocale(portletNav.getContent());
            portletMD.addSupportedLocale(supportedLocaleMD);
         }
         if (portletNav.next(Element.resource_bundle))
         {
            portletMD.setResourceBundle(portletNav.getContent());
         }

         //
         if (portletNav.next(Element.portlet_info))
         {
            PortletInfoMetaData portletInfoMD = new PortletInfoMetaData();
            if (portletNav.next(Element.title))
            {
               portletInfoMD.setTitle(portletNav.getContent());
            }
            if (portletNav.next(Element.short_title))
            {
               portletInfoMD.setShortTitle(portletNav.getContent());
            }
            if (portletNav.next(Element.keywords))
            {
               portletInfoMD.setKeywords(portletNav.getContent());
            }
            portletMD.setPortletInfo(portletInfoMD);
         }

         //
         if (portletNav.next(Element.portlet_preferences))
         {
            PortletPreferencesMetaData portletPreferencesMD = new PortletPreferencesMetaData();
            while (portletNav.next(Element.preference))
            {
               PortletPreferenceMetaData portletPreferenceMD = new PortletPreferenceMetaData();
               portletPreferenceMD.setName(getContent(portletNav, Element.name));
               while (portletNav.next(Element.value))
               {
                  portletPreferenceMD.addValue(portletNav.getContent());
               }
               if (portletNav.next(Element.read_only))
               {
                  portletPreferenceMD.setReadOnly(portletNav.parseContent(ValueType.BOOLEAN));
               }
               portletPreferencesMD.addPortletPreference(portletPreferenceMD);
            }
            if (portletNav.next(Element.preferences_validator))
            {
               portletPreferencesMD.setPreferenceValidator(portletNav.getContent());
            }
            portletMD.setPortletPreferences(portletPreferencesMD);
         }

         //
         while (portletNav.next(Element.security_role_ref))
         {
            SecurityRoleRefMetaData securityRoleRefMD = new SecurityRoleRefMetaData();
            securityRoleRefMD.setDescription(readLocalizedString(portletNav, Element.description));
            securityRoleRefMD.setRoleName(getContent(portletNav, Element.role_name));
            if (portletNav.next(Element.role_link))
            {
               securityRoleRefMD.setRoleLink(portletNav.getContent());
            }
            portletMD.addSecurityRoleRef(securityRoleRefMD);
         }

         //
         while (portletNav.next(Element.supported_processing_event) || portletNav.next(Element.supported_publishing_event))
         {
            boolean processing = portletNav.getName() == Element.supported_processing_event;
            EventDefinitionReferenceMetaData eventDefinitionReferenceMD = new EventDefinitionReferenceMetaData();
            switch (portletNav.next(NAME_OR_QNAME))
            {
               case name:
                  eventDefinitionReferenceMD.setName(portletNav.getContent());
                  break;
               case qname:
                  eventDefinitionReferenceMD.setQname(readQName(portletNav));
                  break;
            }
            if (processing)
            {
               portletMD.addSupportedProcessingEvent(eventDefinitionReferenceMD);
            }
            else
            {
               portletMD.addSupportedPublishingEvent(eventDefinitionReferenceMD);
            }
         }
         while (portletNav.next(Element.supported_public_render_parameter))
         {
            portletMD.addSupportedPublicRenderParameter(portletNav.getContent());
         }
         while (portletNav.next(Element.container_runtime_option))
         {
            ContainerRuntimeMetaData containerRuntimeOptionMD = new ContainerRuntimeMetaData();
            containerRuntimeOptionMD.setName(getContent(portletNav, Element.name));
            while (portletNav.next(Element.value))
            {
               containerRuntimeOptionMD.addValue(portletNav.getContent());
            }
            portletMD.addContainerRuntime(containerRuntimeOptionMD);
         }

         //
         md.addPortlet(portletMD);
      }

      //
      for (StaxNavigator<Element> customPortletModeNav : nav.fork(Element.custom_portlet_mode))
      {
         CustomPortletModeMetaData customPortletModeMD = new CustomPortletModeMetaData();
         customPortletModeMD.setId(customPortletModeNav .getAttribute("id"));
         customPortletModeMD.setDescription(readLocalizedString(customPortletModeNav , Element.description));
         customPortletModeMD.setPortletMode(getContent(customPortletModeNav, Element.portlet_mode));
         if (customPortletModeNav .next(Element.portal_managed))
         {
            customPortletModeMD.setPortalManaged(customPortletModeNav .parseContent(ValueType.BOOLEAN));
         }
         md.addCustomPortletMode(customPortletModeMD);
      }

      //
      for (StaxNavigator<Element> customWindowStateNav : nav.fork(Element.custom_window_state))
      {
         CustomWindowStateMetaData customWindowStateMD = new CustomWindowStateMetaData();
         customWindowStateMD.setId(customWindowStateNav.getAttribute("id"));
         customWindowStateMD.setDescription(readLocalizedString(customWindowStateNav, Element.description));
         customWindowStateMD.setWindowState(getContent(customWindowStateNav, Element.window_state));
         md.addCustomWindowState(customWindowStateMD);
      }

      //
      for (StaxNavigator<Element> userAttributeNav : nav.fork(Element.user_attribute))
      {
         UserAttributeMetaData userAttributeMD = new UserAttributeMetaData();
         userAttributeMD.setId(userAttributeNav.getAttribute("id"));
         userAttributeMD.setDescription(readLocalizedString(userAttributeNav, Element.description));
         userAttributeMD.setName(getContent(userAttributeNav, Element.name));
         md.addUserAttribute(userAttributeMD);
      }

      //
      for (StaxNavigator<Element> securityConstraintNav  : nav.fork(Element.security_constraint))
      {
         SecurityConstraintMetaData securityConstraintMD = new SecurityConstraintMetaData();
         securityConstraintMD.setId(securityConstraintNav.getAttribute("id"));
         securityConstraintMD.setDisplayName(readLocalizedString(securityConstraintNav, Element.display_name));
         if (securityConstraintNav.next() != Element.portlet_collection)
         {
            throw new StaxNavException(nav.getLocation(), "Was expecting a portlet-collection element instead of " + securityConstraintNav.getName());
         }
         PortletCollectionMetaData portletCollectionMD = new PortletCollectionMetaData();
         while (securityConstraintNav.next(Element.portlet_name))
         {
            portletCollectionMD.addPortletname(securityConstraintNav.getContent());
         }
         securityConstraintMD.setPortletList(portletCollectionMD);
         if (securityConstraintNav.next() != Element.user_data_constraint)
         {
            throw new StaxNavException(nav.getLocation(), "Was expecting a security-constraint element instead of " + securityConstraintNav.getName());
         }
         UserDataConstraintMetaData userDataConstraintMD = new UserDataConstraintMetaData();
         userDataConstraintMD.setDescription(readLocalizedString(securityConstraintNav, Element.description));
         if (securityConstraintNav.next() != Element.transport_guarantee)
         {
            throw new StaxNavException(nav.getLocation(), "Was expecting a transport-guarantee element instead of " + securityConstraintNav.getName());
         }
         userDataConstraintMD.setTransportGuarantee(securityConstraintNav.parseContent(TRANSPORT_GUARANTEE));
         securityConstraintMD.setUserDataConstraint(userDataConstraintMD);
         md.addSecurityConstraint(securityConstraintMD);
      }

      //
      if (nav.sibling(Element.resource_bundle))
      {
         md.setResourceBundle(nav.getContent());
         nav.next();
      }

      //
      for (StaxNavigator<Element> filterNav : nav.fork(Element.filter))
      {
         if (version < 2)
         {
            throw new DeploymentException("Cannot declare filter with " + PORTLET_1_0 + " descriptor");
         }
         FilterMetaData filterMD = new FilterMetaData();
         filterMD.setDescription(readLocalizedString(filterNav, Element.description));
         filterMD.setDisplayName(readLocalizedString(filterNav, Element.display_name));
         filterMD.setFilterName(getContent(filterNav, Element.filter_name));
         filterMD.setFilterClass(getContent(filterNav, Element.filter_class));
         while (filterNav.next(Element.lifecycle))
         {
            filterMD.addLifecycle(filterNav.parseContent(LIFE_CYCLE));
         }
         for (InitParamMetaData initParamMD : readInitParams(filterNav))
         {
            filterMD.addInitParam(initParamMD);
         }
         md.addFilter(filterMD);
      }

      //
      for (StaxNavigator<Element> filterMappingNav : nav.fork(Element.filter_mapping))
      {
         if (version < 2)
         {
            throw new DeploymentException("Cannot declare filter mapping with " + PORTLET_1_0 + " descriptor");
         }
         FilterMappingMetaData filterMappingMD = new FilterMappingMetaData();
         filterMappingMD.setName(getContent(filterMappingNav, Element.filter_name));
         while (filterMappingNav.next(Element.portlet_name))
         {
            filterMappingMD.addPortletName(filterMappingNav.getContent());
         }
         md.addFilterMapping(filterMappingMD);
      }

      //
      if (nav.find(Element.default_namespace))
      {
         String val = nav.getContent();
         try
         {
            md.setDefaultNamespace(new URI(val));
         }
         catch (URISyntaxException e)
         {
            throw new DeploymentException("Invalid URI " + val, e);
         }
         nav.next();
      }

      //
View Full Code Here

Examples of org.glassfish.deployment.common.DeploymentException

                } else {
                    JAXRPCCodeGenFacade facade= habitat.getService(JAXRPCCodeGenFacade.class);
                    if (facade != null) {
                        facade.run(habitat, dc, moduleCP, false);
                    else {
                        throw new DeploymentException(rb.getString(LogUtils.JAXRPC_CODEGEN_FAIL)) ;
                    }
                }
            }
            doWebServicesDeployment(app,dc);
            Thread.currentThread().setContextClassLoader(oldCl);
View Full Code Here

Examples of org.jboss.arquillian.container.spi.client.container.DeploymentException

      try {
         // If the deployment is to server.xml, then update server.xml with the application information
         if (containerConfiguration.isDeployTypeXML()) {
            // Throw error if deployment type is not ear, war, or eba
            if (!archiveType.equalsIgnoreCase("ear") && !archiveType.equalsIgnoreCase("war") && !archiveType.equalsIgnoreCase("eba"))
               throw new DeploymentException("Invalid archive type: " + archiveType + ".  Valid archive types are ear, war, and eba.");

            // Save the archive to disk so it can be loaded by the container.
            String appDir = getAppDirectory();
            File exportedArchiveLocation = new File(appDir, archiveName);
            archive.as(ZipExporter.class).exportTo(exportedArchiveLocation, true);

            // Read server.xml file into Memory
            Document document = readServerXML();

            // Add the archive as appropriate to the server.xml file
            addApplication(document, deployName, archiveName, archiveType);

            // Update server.xml on file system
            writeServerXML(document);
         }
         // Otherwise put the application in the dropins directory
         else {
            // Save the archive to disk so it can be loaded by the container.
            String dropInDir = getDropInDirectory();
            File exportedArchiveLocation = new File(dropInDir, archiveName);
            archive.as(ZipExporter.class).exportTo(exportedArchiveLocation, true);
         }

         // Wait until the application is deployed and available
         waitForApplicationTargetState(deployName, true, containerConfiguration.getAppDeployTimeout());

         // Return metadata on how to contact the deployed application
         ProtocolMetaData metaData = new ProtocolMetaData();
         HTTPContext httpContext = new HTTPContext("localhost", containerConfiguration.getHttpPort());
         httpContext.add(new Servlet("ArquillianServletRunner", deployName));
         metaData.addContext(httpContext);

         if (log.isLoggable(Level.FINER)) {
            log.exiting(className, "deploy");
         }

         return metaData;
      } catch (Exception e) {
         throw new DeploymentException("Exception while deploying application.", e);
      }
   }
View Full Code Here

Examples of org.jboss.arquillian.spi.DeploymentException

   public ContainerMethodExecutor deploy(Context context, Archive<?> archive) throws DeploymentException
   {
      if (deploymentManager == null)
      {
         throw new DeploymentException("Could not deploy since deployment manager was not loaded");
      }

      TargetModuleID moduleInfo = null;
      try {
         PROGRESS_BARRIER.reset();
         resetModuleStatus();
         ProgressObject progress = deploymentManager.distribute(
               deploymentManager.getTargets(), moduleTypeMapper.getModuleType(archive),
               archive.as(ZipExporter.class).exportZip(), null);
         progress.addProgressListener(new JSR88DeploymentListener(this, progress.getResultTargetModuleIDs(), CommandType.DISTRIBUTE));
         waitForModuleToStart();
         // QUESTION when is getResultTargetModuleIDs() > 0?
         moduleInfo =  progress.getResultTargetModuleIDs()[0];
         context.add(TargetModuleID.class, moduleInfo);
      }
      catch (Exception e)
      {
         throw new DeploymentException("Could not deploy archive", e);
      }

      if (moduleInfo == null || moduleInfo.getModuleID() == null)
      {
         throw new DeploymentException("Could not determine module id, likely because module did not deploy");
      }

      try
      {
         // FIXME pass moduleId to ServletMethodExecutor since we can't guarantee anymore it's /test
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.