Package org.jboss.deployment

Examples of org.jboss.deployment.DeploymentException


          try
          {
              //String contextPath = webApp.getMetaData().getContextRoot();

              if (_deployed.get(warUrl) != null)
                  throw new DeploymentException(warUrl+" is already deployed");

              //make a context for the webapp and configure it from the jetty jboss-service.xml defaults
              //and the jboss-web.xml descriptor
              JBossSipAppContext app = new JBossSipAppContext(di, warUrl);
             
              // In case of directory, there is a '/' after .ssar.
              int index1 = warUrl.lastIndexOf('/', warUrl.length() - 4);
              int index2= warUrl.lastIndexOf(".ssar");
              String contextPath = warUrl.substring(index1, index2);
               
              app.setContextPath(contextPath);
             
              URL webXml = di.localCl.findResource("WEB-INF/web.xml");
          if (webXml != null)
          {
                app.setConfigurationClasses (new String[]{
                    "org.mortbay.jetty.webapp.WebInfConfiguration",
                    "org.cipango.jboss.JBossWebXmlConfiguration",
                    "org.mortbay.jetty.webapp.JettyWebXmlConfiguration"
                    "org.mortbay.jetty.webapp.TagLibConfiguration",
                    "org.cipango.jboss.JBossSipXmlConfiguration"});
          }
          else
          {
                app.setConfigurationClasses (new String[]{
                    "org.mortbay.jetty.webapp.WebInfConfiguration",
                    "org.cipango.jboss.JBossSipXmlConfiguration"});
          }
              app.setExtractWAR(_service.getUnpackWars());
              app.setParentLoaderPriority(_service.getJava2ClassLoadingCompliance());
             
              //permit urls without a trailing '/' even though it is not a valid url
              //as the jboss webservice client tests seem to use these invalid urls
              if (Log.isDebugEnabled())
                Log.debug("Allowing non-trailing '/' on context path");
              app.setAllowNullPathInfo(true);
                  
              // if a different webdefault.xml file has been provided, use it
              if (_service.getWebDefaultResource() != null)
              {
                  try
                  {
                      URL url = getClass().getClassLoader().getResource(_service.getWebDefaultResource());
                      String fixedUrl = (fixURL(url.toString()));
                      app.setDefaultsDescriptor(fixedUrl);
                      if (Log.isDebugEnabled())
                        Log.debug("webdefault specification is: " + _service.getWebDefaultResource());
                  }
                  catch (Exception e)
                  {
                    Log.warn("Could not find resource: " + _service.getWebDefaultResource()+" using default", e);
                  }
              }

              // Add the webapp to jetty
              _contexts.addHandler(app);
             

              //if jetty has been started, then start the
              //handler just added
              if (_contexts.isStarted())
                  app.start();
             
              // keep track of deployed contexts for undeployment
              _deployed.put(warUrl, app);
     

              //tell jboss about the jsr77 mbeans we've created              
              //first check that there is an mbean for the webapp itself
              ObjectName webAppMBean = new ObjectName(CipangoService.MBEAN_DOMAIN + ":J2EEServer=none,J2EEApplication=none,J2EEWebModule="+app.getUniqueName());
              if (server.isRegistered(webAppMBean)) {
                  di.deployedObject = webAppMBean;
              } else {
                  throw new IllegalStateException("No mbean registered for webapp at "+app.getUniqueName());
              }
             
              //now get all the mbeans that represent servlets and set them on the
              //deployment info so they will be found by the jsr77 management system
              ObjectName servletQuery = new ObjectName
              (CipangoService.MBEAN_DOMAIN + ":J2EEServer=none,J2EEApplication=none,J2EEWebModule="+app.getUniqueName()+ ",j2eeType=Servlet,*");
              Iterator iterator = server.queryNames(servletQuery, null).iterator();
              while (iterator.hasNext())
              {
                  di.mbeans.add(iterator.next());
              }
          }
          catch (Exception e)
          {
            Log.warn("Undeploying on start due to error", e);
              throw new DeploymentException(e);
          }
     
     
     
     
    } catch (Exception ex) {
      throw new DeploymentException(ex);
    }

    super.start(di);
  }
View Full Code Here


                  app = null;
                  Log.info("Successfully undeployed " + warUrl);
              }
              catch (Exception e)
              {
                  throw new DeploymentException(e);
              }
              finally
              {
                  _deployed.remove(warUrl);
              }
          }
    } catch (Exception ex) {
      throw new DeploymentException(ex);
    }
    super.stop(di);
  }
View Full Code Here

        {
            String contextPath = webApp.getMetaData().getContextRoot();
            webApp.setURL(new URL(warUrl));

            if (_deployed.get(warUrl) != null)
                throw new DeploymentException(warUrl+" is already deployed");

            //make a context for the webapp and configure it from the jetty jboss-service.xml defaults
            //and the jboss-web.xml descriptor
            JBossSipAppContext app = new JBossSipAppContext(parser, webApp, warUrl);
            app.setContextPath(contextPath);
            app.setConfigurationClasses (new String[]{
                "org.mortbay.jetty.webapp.WebInfConfiguration",
                "org.cipango.jboss.JBossWebXmlConfiguration",
                "org.mortbay.jetty.webapp.JettyWebXmlConfiguration"
                "org.mortbay.jetty.webapp.TagLibConfiguration",
                "org.cipango.jboss.JBossSipXmlConfiguration"});
            app.setExtractWAR(getUnpackWars());
            app.setParentLoaderPriority(getJava2ClassLoadingCompliance());
           
            //permit urls without a trailing '/' even though it is not a valid url
            //as the jboss webservice client tests seem to use these invalid urls
            if (Log.isDebugEnabled())
              Log.debug("Allowing non-trailing '/' on context path");
            app.setAllowNullPathInfo(true);
                
            Manager manager = (Manager) getDistributableSessionManagerPrototype();
            if (manager != null)
            {
                throw new UnsupportedOperationException("NOT IMPLEMENTED - please ask");
//                app.setDistributableSessionManager((Manager) manager.clone());
//                if (getForceDistributable())
//                    app.setDistributable(true);
            }

            // if a different webdefault.xml file has been provided, use it
            if (_configData.getWebDefaultResource() != null)
            {
                try
                {
                    URL url = getClass().getClassLoader().getResource(_configData.getWebDefaultResource());
                    String fixedUrl = (fixURL(url.toString()));
                    app.setDefaultsDescriptor(fixedUrl);
                    if (Log.isDebugEnabled())
                      Log.debug("webdefault specification is: " + _configData.getWebDefaultResource());
                }
                catch (Exception e)
                {
                  Log.warn("Could not find resource: " + _configData.getWebDefaultResource()+" using default", e);
                }
            }

            Iterator hosts = webApp.getMetaData().getVirtualHosts();
            List hostList = new ArrayList();
            while(hosts.hasNext())
                hostList.add((String)hosts.next());
            app.setVirtualHosts((String[])LazyList.toArray(hostList, String.class));

            // Add the webapp to jetty
            _contexts.addHandler(app);
           

            //tell jboss about the classloader the webapp is using - ensure
            //this is done before the context is started, because webservices
            //want to get access to this classloader
            //System.err.println("In JettyDeployer, setting webapp.metadata.contextloader="+app.getClassLoader());
            webApp.getMetaData().setContextLoader(app.getClassLoader());

            //if jetty has been started, then start the
            //handler just added
            if (_contexts.isStarted())
                app.start();
           
            // keep track of deployed contexts for undeployment
            _deployed.put(warUrl, app);
   

            //tell jboss about the jsr77 mbeans we've created              
            //first check that there is an mbean for the webapp itself
            ObjectName webAppMBean = new ObjectName(_configData.getMBeanDomain() + ":J2EEServer=none,J2EEApplication=none,J2EEWebModule="+app.getUniqueName());
            if (server.isRegistered(webAppMBean)) {
                _deploymentInfo.deployedObject = webAppMBean;
            } else {
                throw new IllegalStateException("No mbean registered for webapp at "+app.getUniqueName());
            }
           
            //now get all the mbeans that represent servlets and set them on the
            //deployment info so they will be found by the jsr77 management system
            ObjectName servletQuery = new ObjectName
            (_configData.getMBeanDomain() + ":J2EEServer=none,J2EEApplication=none,J2EEWebModule="+app.getUniqueName()+ ",j2eeType=Servlet,*");
            Iterator iterator = server.queryNames(servletQuery, null).iterator();
            while (iterator.hasNext())
            {
                _deploymentInfo.mbeans.add((ObjectName) iterator.next());
            }


            Log.info("successfully deployed " + warUrl + " to " + contextPath);
        }
        catch (Exception e)
        {
          Log.warn("Undeploying on start due to error", e);
            performUndeploy(warUrl, webApp);
            throw new DeploymentException(e);
        }
    }
View Full Code Here

                app = null;
                Log.info("Successfully undeployed " + warUrl);
            }
            catch (Exception e)
            {
                throw new DeploymentException(e);
            }
            finally
            {
                _deployed.remove(warUrl);
            }
View Full Code Here

        {
            String contextPath = webApp.getMetaData().getContextRoot();
            webApp.setURL(new URL(warUrl));

            if (_deployed.get(warUrl) != null)
                throw new DeploymentException(warUrl+" is already deployed");

            //make a context for the webapp and configure it from the jetty jboss-service.xml defaults
            //and the jboss-web.xml descriptor
            JBossWebAppContext app = new JBossWebAppContext(parser, webApp, warUrl);
            app.setContextPath(contextPath);
            app.setConfigurationClasses (new String[]{ "org.mortbay.jetty.webapp.WebInfConfiguration","org.jboss.jetty.JBossWebXmlConfiguration", "org.mortbay.jetty.webapp.JettyWebXmlConfiguration""org.mortbay.jetty.webapp.TagLibConfiguration"});
            app.setExtractWAR(getUnpackWars());
            app.setParentLoaderPriority(getJava2ClassLoadingCompliance());
           
            //permit urls without a trailing '/' even though it is not a valid url
            //as the jboss webservice client tests seem to use these invalid urls
            if (_log.isDebugEnabled())
                _log.debug("Allowing non-trailing '/' on context path");
            app.setAllowNullPathInfo(true);
                
            SessionManager manager = getDistributableSessionManagerPrototype();
            if (manager != null)
            {
                throw new UnsupportedOperationException("NOT IMPLEMENTED - please ask");
//                app.setDistributableSessionManager((Manager) manager.clone());
//                if (getForceDistributable())
//                    app.setDistributable(true);
            }

            // if a different webdefault.xml file has been provided, use it
            if (_configData.getWebDefaultResource() != null)
            {
                try
                {
                    URL url = getClass().getClassLoader().getResource(_configData.getWebDefaultResource());
                    String fixedUrl = (fixURL(url.toString()));
                    app.setDefaultsDescriptor(fixedUrl);
                    if (_log.isDebugEnabled())
                        _log.debug("webdefault specification is: " + _configData.getWebDefaultResource());
                }
                catch (Exception e)
                {
                    _log.error("Could not find resource: " + _configData.getWebDefaultResource()+" using default", e);
                }
            }

            Iterator hosts = webApp.getMetaData().getVirtualHosts();
            List hostList = new ArrayList();
            while(hosts.hasNext())
                hostList.add((String)hosts.next());
            app.setVirtualHosts((String[])LazyList.toArray(hostList, String.class));

            // Add the webapp to jetty
            _contexts.addHandler(app);
           

            //tell jboss about the classloader the webapp is using - ensure
            //this is done before the context is started, because webservices
            //want to get access to this classloader
            System.err.println("In JettyDeployer, setting webapp.metadata.contextloader="+app.getClassLoader());
            webApp.getMetaData().setContextLoader(app.getClassLoader());

            //if jetty has been started, then start the
            //handler just added
            if (_contexts.isStarted())
                app.start();
           
            // keep track of deployed contexts for undeployment
            _deployed.put(warUrl, app);
   

            //tell jboss about the jsr77 mbeans we've created              
            //first check that there is an mbean for the webapp itself
            ObjectName webAppMBean = new ObjectName(_configData.getMBeanDomain() + ":J2EEServer=none,J2EEApplication=none,J2EEWebModule="+app.getUniqueName());
            if (server.isRegistered(webAppMBean))
                _deploymentInfo.deployedObject = webAppMBean;
            else
                throw new IllegalStateException("No mbean registered for webapp at "+app.getUniqueName());

            //now get all the mbeans that represent servlets and set them on the
            //deployment info so they will be found by the jsr77 management system
            ObjectName servletQuery = new ObjectName
            (_configData.getMBeanDomain() + ":J2EEServer=none,J2EEApplication=none,J2EEWebModule="+app.getUniqueName()+ ",j2eeType=Servlet,*");
            Iterator iterator = server.queryNames(servletQuery, null).iterator();
            while (iterator.hasNext())
            {
                _deploymentInfo.mbeans.add((ObjectName) iterator.next());
            }


            _log.info("successfully deployed " + warUrl + " to " + contextPath);
        }
        catch (Exception e)
        {
            _log.error("Undeploying on start due to error", e);
            performUndeploy(warUrl, webApp);
            throw new DeploymentException(e);
        }
    }
View Full Code Here

                app = null;
                _log.info("Successfully undeployed " + warUrl);
            }
            catch (Exception e)
            {
                throw new DeploymentException(e);
            }
            finally
            {
                _deployed.remove(warUrl);
            }
View Full Code Here

                contextPath = "/";

            webApp.setURL(new URL(warUrl));

            if (_deployed.get(warUrl) != null)
                throw new DeploymentException(warUrl+" is already deployed");

            //make a context for the webapp and configure it from the jetty jboss-service.xml defaults
            //and the jboss-web.xml descriptor
            JBossWebAppContext app = new JBossWebAppContext(parser, webApp, warUrl);
            app.setContextPath(contextPath);
            app.setConfigurationClasses (new String[]{ "org.mortbay.jetty.webapp.WebInfConfiguration","org.jboss.jetty.JBossWebXmlConfiguration", "org.mortbay.jetty.webapp.JettyWebXmlConfiguration""org.mortbay.jetty.webapp.TagLibConfiguration"});
            app.setExtractWAR(getUnpackWars());
            app.setParentLoaderPriority(getJava2ClassLoadingCompliance());
           
            //permit urls without a trailing '/' even though it is not a valid url
            //as the jboss webservice client tests seem to use these invalid urls
            if (_log.isDebugEnabled())
                _log.debug("Allowing non-trailing '/' on context path");
            app.setAllowNullPathInfo(true);
                
            SessionManager manager = getDistributableSessionManagerPrototype();
            if (manager != null)
            {
                throw new UnsupportedOperationException("NOT IMPLEMENTED - please ask");
//                app.setDistributableSessionManager((Manager) manager.clone());
//                if (getForceDistributable())
//                    app.setDistributable(true);
            }

            // if a different webdefault.xml file has been provided, use it
            if (_configData.getWebDefaultResource() != null)
            {
                try
                {
                    URL url = getClass().getClassLoader().getResource(_configData.getWebDefaultResource());
                    String fixedUrl = (fixURL(url.toString()));
                    app.setDefaultsDescriptor(fixedUrl);
                    if (_log.isDebugEnabled())
                        _log.debug("webdefault specification is: " + _configData.getWebDefaultResource());
                }
                catch (Exception e)
                {
                    _log.error("Could not find resource: " + _configData.getWebDefaultResource()+" using default", e);
                }
            }

            Iterator hosts = webApp.getMetaData().getVirtualHosts();
            List hostList = new ArrayList();
            while(hosts.hasNext())
                hostList.add((String)hosts.next());
            app.setVirtualHosts((String[])LazyList.toArray(hostList, String.class));

            // Add the webapp to jetty
            _contexts.addHandler(app);
           

            //tell jboss about the classloader the webapp is using - ensure
            //this is done before the context is started, because webservices
            //want to get access to this classloader
            System.err.println("In JettyDeployer, setting webapp.metadata.contextloader="+app.getClassLoader());
            webApp.getMetaData().setContextLoader(app.getClassLoader());

            //if jetty has been started, then start the
            //handler just added
            if (_contexts.isStarted())
                app.start();
           
            // keep track of deployed contexts for undeployment
            _deployed.put(warUrl, app);
   

            //tell jboss about the jsr77 mbeans we've created              
            //first check that there is an mbean for the webapp itself
            ObjectName webAppMBean = new ObjectName(_configData.getMBeanDomain() + ":J2EEServer=none,J2EEApplication=none,J2EEWebModule="+app.getUniqueName());
            if (server.isRegistered(webAppMBean))
                _deploymentInfo.deployedObject = webAppMBean;
            else
                throw new IllegalStateException("No mbean registered for webapp at "+app.getUniqueName());

            //now get all the mbeans that represent servlets and set them on the
            //deployment info so they will be found by the jsr77 management system
            ObjectName servletQuery = new ObjectName
            (_configData.getMBeanDomain() + ":J2EEServer=none,J2EEApplication=none,J2EEWebModule="+app.getUniqueName()+ ",j2eeType=Servlet,*");
            Iterator iterator = server.queryNames(servletQuery, null).iterator();
            while (iterator.hasNext())
            {
                _deploymentInfo.mbeans.add((ObjectName) iterator.next());
            }


            _log.info("successfully deployed " + warUrl + " to " + contextPath);
        }
        catch (Exception e)
        {
            _log.error("Undeploying on start due to error", e);
            performUndeploy(warUrl, webApp);
            throw new DeploymentException(e);
        }
    }
View Full Code Here

                app = null;
                _log.info("Successfully undeployed " + warUrl);
            }
            catch (Exception e)
            {
                throw new DeploymentException(e);
            }
            finally
            {
                _deployed.remove(warUrl);
            }
View Full Code Here

         }
      }
      catch (Exception e)
      {
         log.error("failed to parse AOP document: ", e);
         throw new DeploymentException(e);
      }
      super.init(di);
   }
View Full Code Here

         log.debug("Deployed AOP: " + di.url);
      }
      catch (Exception ex)
      {
         ex.printStackTrace();
         throw new DeploymentException(ex);
      }
      finally
      {
         Thread.currentThread().setContextClassLoader(old);
      }
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.