Results 1 to 9 of 9

Thread: Maven redeploy fails

  1. #1
    Join Date
    Jan 2010
    Posts
    8

    Default 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. #2

    Default

    Hi,

    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?

    Yong

  3. #3
    Join Date
    Jan 2010
    Posts
    8

    Default

    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 : org.springframework.web.context.support.XmlWebAppl 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 : org.springframework.beans.factory.support.DefaultL istableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultL 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.store,
    webscripts.store.alfresco,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,webscript.org.springframe
    work.extensions.webscripts.index.get,webscript.org .springframework.extensions.we
    bscripts.indexall.get,webscript.org.springframewor k.extensions.webscripts.indexf
    amily.get,webscript.org.springframework.extensions .webscripts.indexlifecycle.get
    ,webscript.org.springframework.extensions.webscrip ts.indexuri.get,webscript.org.
    springframework.extensions.webscripts.indexpackage .get,webscript.org.springframe
    work.extensions.webscripts.index.post,webscript.or g.springframework.extensions.w
    ebscripts.scriptdescription.get,webscript.org.spri ngframework.extensions.webscri
    pts.scriptdump.get,webscript.org.springframework.e xtensions.webscripts.scriptins
    tall.post,webscript.org.springframework.extensions .webscripts.jsdebugger.get,web
    script.org.springframework.extensions.webscripts.j sdebugger.post,webframework.co
    nfigsource,webframework.previewcontext.provider,we bframework.connector.provider,
    webframework.store.classpath.abstract,webframework .store.remote.abstract,webfram
    ework.store.local.abstract,webframework.store.weba pp.abstract,webframework.store
    .system.abstract,webframework.webapp.store.root,we bframework.webapp.store.local,
    webframework.webapp.store.remote,webframework.webs cripts.store.classpath,webfram
    ework.webscripts.store.remote,webframework.webscri pts.store.local,webframework.w
    ebscripts.store.system,webframework.webscripts.sto re.alfresco.classpath,webframe
    work.webscripts.store.alfresco.custom,webframework .templates.store.webinf,webfra
    mework.webscripts.store.webinf,webframework.webscr ipts.searchpath,webframework.w
    ebscripts.registry.templateprocessor,webframework. webscripts.registry.scriptproc
    essor,webframework.webscripts.templateprocessor.fr eemarker,webframework.webscrip
    ts.scriptprocessor.javascript,webframework.webscri pts.index,webframework.webscri
    pts.scriptremote,webframework.templates.store.clas spath,webframework.templates.s
    tore.remote,webframework.templates.store.local,web framework.templates.store.syst
    em,webframework.templates.store.alfresco.classpath ,webframework.templates.store.
    alfresco.custom,webframework.templates.searchpath, webframework.templates.registr
    y.templateprocessor,webframework.templates.registr y.scriptprocessor,webframework
    .templates.container,webframework.templates.templa teprocessor.freemarker,webfram
    ework.templates.scriptprocessor.javascript,webscri pt.org.springframework.extensi
    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.renderer.page,webframework.render er.region,webframework.rendere
    r.template,webframework.rendercontext.provider,web framework.sitedata.persister.a
    bstract,webframework.webinf.persister.abstract,web framework.sitedata.store.alfre
    sco-classpath,webframework.sitedata.persister.alfresco-classpath,webframework.si
    tedata.store.classpath.alfresco-custom,webframework.sitedata.persister.classpath
    .alfresco-custom,webframework.sitedata.store.alfresco-system,webframework.siteda
    ta.persister.alfresco-system,webframework.sitedata.store.classpath,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,webframework.presets.search 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
    s.surf.WebScriptsStoreRegistrar#0,org.springframew ork.extensions.surf.WebScripts
    StoreRegistrar#1,org.springframework.extensions.su rf.TemplatesStoreRegistrar#0,w
    ebscript.org.springframework.extensions.surf.conso le.get,webscript.org.springfra
    mework.extensions.surf.console.post,webscript.org. 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
    unity-0.1.0-SNAPSHOT
    [INFO] Copy webapp webResources to C:\SpringSource\community\target\communi
    ty-0.1.0-SNAPSHOT
    [INFO] Generating war C:\SpringSource\community\target\community-0.1.0-SNAP
    SHOT.war
    [INFO] Building war: C:\SpringSource\community\target\community-0.1.0-SNAPS
    HOT.war
    [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] BUILD SUCCESSFUL
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 9 seconds
    [INFO] Finished at: Tue Jan 12 08:21:58 PST 2010
    [INFO] Final Memory: 18M/46M
    [INFO] ------------------------------------------------------------------------

  4. #4

    Default

    Hmmm...

    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 ?

    Yong

  5. #5
    Join Date
    Jan 2010
    Posts
    8

    Default

    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.

    Message:
    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. #6
    Join Date
    Jan 2010
    Posts
    8

    Default

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

    http://www.myeclipseide.com/PNphpBB2...3-start-0.html

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

  7. #7
    Join Date
    Dec 2009
    Posts
    10

    Default

    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:

    Code:
    <Context reloadable=”true” antiResourceLocking=”true”> </Context>
    However please read the documentation on these properties. http://tomcat.apache.org/tomcat-5.5-...g/context.html 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. #8
    Join Date
    Jul 2010
    Posts
    1

    Default 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
    Thx

  9. #9

    Default

    Is it still an issue with you?

    Have you tried Jetty or use Spring TC server?

    Yong

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •