Announcement Announcement Module
No announcement yet.
Maven redeploy fails Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Maven redeploy fails

    I've been using command line roo on a Windows XP machine.
    The command: 'mvn tomcat:deploy' is working great, but the redeploy is failing.

    I run 'mvn tomcat:redeploy' (and I tried 'mvn package tomcat:redeploy'), but it fails for me. It will delete the war file and all directories of the exploded war file except the lib directory. And then when it tries to copy over the new war file and explode it, it fails because the exploded directory is still there.

    Any ideas about how to fix this?

  • #2

    Can you post the Tomcat log file when the redeployment fails?

    I am using Windows XP too and I don't have that issue.

    Are you also using Surf M2?



    • #3
      There is no error reported at the tomcat console or the roo console. But after redeploy there is only a single directory under the deployed WEB-INF -- the lib directory and it appears to have all lib files under it. But all other files and directories have been deleted.

      The result is a 404 error when I try to hit the page from the browser -- since most of the application files never were redeployed.

      If I shut down tomcat and delete the deployed files, I can then restart tomcat and do a fresh deploy and it all works. It is just on the redeploy where I have a problem.

      My guess is that something in the lib directory is still being accessed blocking that directory from being deleted.

      Tomcat log:

      INFO : icationContext - Closing WebApplicationContext for namespace 'Spring Surf Dispatcher Servlet-servlet':
      startup date [Tue Jan 12 08:19:00 PST 2010]; root of context hierarchy
      INFO : istableBeanFactory - Destroying singletons in istable
      BeanFactory@1108522: defining beans [web.configsource,web.config,webscripts.abde
      ra,webscripts.formatregistry,webscripts.formatmap, webscripts.adaptorset,webscrip
      ts.adaptors,webscripts.formats,webscripts.formats. IE,webscripts.resources,webscr
      ipts.classpathstore,webscripts.remotestore,webscri pts.jarstore,,,webscripts.systemstore,w ebscripts.searchpath,webscript
      s.abstractcontainer,webscripts.web.templateregistr y,webscripts.web.scriptregistr
      y,webscripts.container,webscripts.templateprocesso r.freemarker,webscripts.script
      processor.javascript,webscripts.script.remote,webs cripts.connector.provider,webs
      cripts.index,webscripts.registry,connector.service ,credential.vault.provider,cre
      dential.vault.provider.xml,webscript,webscriptdesc ,webscript.default,scriptDebug
      ger,webscriptHandlerMappings,handlerMappings,endpo intController,resourceControll
      er,webscriptViewResolver,webscripts.registrar.apis tore,
      work.extensions.webscripts.index.get, .springframework.extensions.we
      bscripts.indexall.get, k.extensions.webscripts.indexf
      amily.get, .webscripts.indexlifecycle.get
      , ts.indexuri.get,
      springframework.extensions.webscripts.indexpackage .get,,webscript.or g.springframework.extensions.w
      ebscripts.scriptdescription.get, ngframework.extensions.webscri
      pts.scriptdump.get, xtensions.webscripts.scriptins, .webscripts.jsdebugger.get,web,
      nfigsource,webframework.previewcontext.provider,we bframework.connector.provider,,webframework .store.remote.abstract,webfram, pp.abstract,
      .system.abstract,,we,,webframework.webs,webfram,webframework.webscri,webframework.w,webframework.webscripts.sto re.alfresco.classpath,webframe,webframework,webfra,webframework.webscr ipts.searchpath,webframework.w
      ebscripts.registry.templateprocessor,webframework. webscripts.registry.scriptproc
      essor, eemarker,webframework.webscrip
      ts.scriptprocessor.javascript,webframework.webscri pts.index,webframework.webscri
      pts.scriptremote, spath,webframework.templates.s
      em, ,
      alfresco.custom,webframework.templates.searchpath, webframework.templates.registr
      y.templateprocessor,webframework.templates.registr y.scriptprocessor,webframework
      .templates.container,webframework.templates.templa teprocessor.freemarker,webfram
      ons.messages.get,webscripts.authenticator.basic,we bscripts.authenticator.delegat
      ingbasic,webframework.processor.webscript,webframe work.processor.freemarker,webf
      ramework.processor.jsp,webframework.renderer.chrom e,webframework.renderer.compon
      ent,,webframework.render er.region,webframework.rendere
      r.template,webframework.rendercontext.provider,web framework.sitedata.persister.a
      ta.persister.alfresco-system,,webfr amework.
      sitedata.persister.classpath,webframework.sitedata .store.system,webframework.sit
      edata.persister.system,webframework.webinf.persist er.remote,webframework.webinf.
      persister.local,webframework.webinf.persister.root ,webframework.objects.persiste
      r,abstractWebFrameworkController,abstractWebFramew orkViewResolver,abstractWebFra
      meworkInterceptor,webframeworkHandlerMappings,feed Controller,previewController,r
      emoteController,loginController,logoutController,o bjectViewResolver,componentVie
      wResolver,regionViewResolver,pageTypeViewResolver, pageViewResolver,requestContex
      tInterceptor,previewContextInterceptor,themeInterc eptor,localeResolver,webframew
      ork.classpathstore.presets,webframework.classpaths tore.presets.custom,webframewo
      rk.remotestore.presets, path,webframework.presets.mana
      ger,baseScriptExtension,webframework.factory.base, webframework.service.registry,
      webframework.service.resource,webframework.service .render,webframework.service.t
      ag,webframework.service.persister,webframework.ser vice.objectpersistence,webfram
      ework.service.modelobject,webframework.service.aut owire,webframework.factory.res
      ource.loader.url,webframework.factory.resource.loa der.cmis,webframework.factory.
      resource.loader.alfresco,webframework.factory.requ estcontext.default,webframewor
      k.factory.pagemapper.default,webframework.factory. linkbuilder.requestparameter,w
      ebframework.factory.linkbuilder.default,webframewo rk.factory.user.default,webfra
      mework.factory.user.alfresco,baseTemplateExtension ,org.springframework.extension,org.springframew
      StoreRegistrar#1, rf.TemplatesStoreRegistrar#0,w le.get,, springframework.extensions.sur
      f.messages.get,org.springframework.web.servlet.mvc .annotation.DefaultAnnotationH
      andlerMapping#0,annotationMethodHandlerAdapter,sim pleControllerHandlerAdapter,mu
      ltipartResolver]; root of factory hierarchy
      Jan 12, 2010 8:21:56 AM org.apache.catalina.startup.HostConfig checkResources
      INFO: Undeploying context [/community]
      Jan 12, 2010 8:21:56 AM org.apache.catalina.startup.HostConfig deployWAR
      INFO: Deploying web application archive community.war

      Roo Log:

      [INFO] [war:war {execution: default-war}]
      [INFO] Exploding webapp...
      [INFO] Assembling webapp community in C:\SpringSource\community\target\comm
      [INFO] Copy webapp webResources to C:\SpringSource\community\target\communi
      [INFO] Generating war C:\SpringSource\community\target\community-0.1.0-SNAP
      [INFO] Building war: C:\SpringSource\community\target\community-0.1.0-SNAPS
      [INFO] [tomcat:redeploy {execution: default-cli}]
      [INFO] Deploying war to http://localhost:8080/community
      [INFO] OK - Undeployed application at context path /community
      [INFO] OK - Deployed application at context path /community
      [INFO] ------------------------------------------------------------------------
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 9 seconds
      [INFO] Finished at: Tue Jan 12 08:21:58 PST 2010
      [INFO] Final Memory: 18M/46M
      [INFO] ------------------------------------------------------------------------


      • #4

        I can't reproduce your issue. The redeployment works fine for me.

        Maybe you can reinstall your tomcat and also when you finish first deploy, make sure you wait till it finish before make the second deployment ?



        • #5
          It still happens with a fresh copy of tomcat 6.0.20.

          1) Run Roo (using M2) to build and deploy 'community' to fresh tomcat
          The only change made to tomcat was to enable the admin user with 'manager' role.
          2) Verify in browser that the site is running -- all OK
          3) Made no changes to any of the project files.
          mvn tomcat:redeploy
          4) Results as before.
          All I have left is the tomcat\webapps\community\WEB-INF\lib\* directory.
          No other files or directories are under community -- so the app cannot run.
          5) In Windows Explorer I go to the lib directory and try to delete all 62 files.

          Cannot delete abdera-client-0.4.0-incubating: It is being used by another person or program. Close any programs that might be using it and try again.

          6) Run 'mvn clean tomcat:undeploy'
          Tomcat reports [/community] context undeployed
          Only the tomcat\webapps\community\WEB-INF\lib\* directory still exists.
          I tried to delete the files again, but I get the same message about
          being unable to delete abdera-client.


          • #6
            This was some time ago, but this thread reports not an identical, but similar problem:


            I'm wondering if something about the referenced jar files in the project is not right.


            • #7
              I'm unsure if this will fix your problem but try this:

              Add a META-INF folder at the same folder level as WEB-INF. Add a context.xml file to the META-INF folder with the following:

              <Context reloadable=”true” antiResourceLocking=”true”> </Context>
              However please read the documentation on these properties. Using these properties will impact startup time and the possibility to hotdeploy jsp's. Not sure if there will be issues with webscripts/surf stuff.


              • #8
                Maven redeploy fails

                Hi, I ve got the same issue ... when I undeploy, I still have a jar file left, n i cannot delete it. I have to stop tomcat to delete it. Its really annoying :-/
                rbw did you find a solution ?

                If someone did, it will be awesome to share


                • #9
                  Is it still an issue with you?

                  Have you tried Jetty or use Spring TC server?