1 2 Previous Next 16 Replies Latest reply: Jun 25, 2011 10:00 AM by rafael nunes RSS

Seam applications continuously redeploy in AS-5.1.0

jaikiran pai Master

A couple of users have now reported an issue with Seam applications in AS-5.1.0. The issue causes the applications to continuously redeploy without any changes in the app. The issue is specific to Seam apps.

Here are the 2 threads:

http://www.jboss.org/index.html?module=bb&op=viewtopic&t=156752

http://www.jboss.org/index.html?module=bb&op=viewtopic&t=155974

The issue is because of the *.spdia or *.jsfdia files that get added to the metadata locations of a Seam app (.war/WEB-INF). However, the extension of those files doesn't matter as long as the extension is not a .xml. So any files that have a non .xml extension in the metadata location (WEB-INF) of a Seam application causes the app to continuously redeploy.

The piece of code that causes this is:

List<VirtualFile> children = mdpVF.getChildren(filter);
 String mdpPathName = mdpVF.getPathName();
 Set<String> leaves = getCache().getLeaves(mdpPathName);
 // do we have some new files or some were deleted
 if (leaves != null && children != null && leaves.size() != children.size())
 {
 if (log.isTraceEnabled())
 log.trace("Metadata files number changed, old: " + leaves + ", now: " + children);
 return true;
 }


Here's the output from the logs for this piece of code:

2009-06-11 18:54:01,957 TRACE [org.jboss.deployers.vfs.spi.structure.modified.MetaDataStructureModificationChecker] (HDScanner) Metadata files number changed, old: [myapp.ear/myapp.war/WEB-INF/pages.xml.unknownexttype, myapp.ear/myapp.war/WEB-INF/web.xml, myapp.ear/myapp.war/WEB-INF/components.xml], now: [FileHandler@16915265[path=myapp.ear/myapp.war/WEB-INF/components.xml context=file:/home/me/jboss-5.1.0.GA/server/default/deploy/ real=file:/home/me/jboss-5.1.0.GA/server/default/deploy/myapp.ear/myapp.war/WEB-INF/components.xml], FileHandler@21718173[path=myapp.ear/myapp.war/WEB-INF/web.xml context=file:/home/me/jboss-5.1.0.GA/server/default/deploy/ real=file:/home/me/jboss-5.1.0.GA/server/default/deploy/myapp.ear/myapp.war/WEB-INF/web.xml]]


Interesting the presence of such files does not cause the other non-seam app to go crazy. So i am sure it has to do something with the Seam integration deployers or the SeamModificationTypeMatcher. Even after some debugging i haven't understood why this happens.




  • 1. Re: Seam applications continuously redeploy in AS-5.1.0
    Dimitris Andreadis Master

    Isn't this related to the other discussion in the dev-list about the change in behaviour relative to 4.x, i.e. redeploying the application whenever anything in the metadata folders changes?

  • 2. Re: Seam applications continuously redeploy in AS-5.1.0
    jaikiran pai Master

    Yes, its related although slightly different (and buggy) since in this case none of the files are removed or added in the metadata locations. But ultimately its the same issue that we have started redeploying applications based on the files available in metadata locations.

  • 3. Re: Seam applications continuously redeploy in AS-5.1.0
    Ales Justin Master

     

    "jaikiran" wrote:

    Interesting the presence of such files does not cause the other non-seam app to go crazy. So i am sure it has to do something with the Seam integration deployers or the SeamModificationTypeMatcher. Even after some debugging i haven't understood why this happens.

    Actually the whole problem is described in this extra file: myapp.ear/myapp.war/WEB-INF/pages.xml.unknownexttype :-)

    And yes, unfortunately it's a bug. :-(

    The problem is, that SynchWrapperModificationChecker
    is not taking filter into an account when doing synch check.
    Hence it populates the cache with "illegal" entries == the one's that would be actually filtered.
    So the original (non-synch) checker sees them as leaves, whereas children do not, due to a filter.

    I'll fix this in deployers.
    But there are currently few workarounds, depending on what the users still want to do:
    * fall back to non-synch checker --> MetaDataStructureModificationChecker
    * exclude SeamModificationTypeMatcher (no temping)


  • 4. Re: Seam applications continuously redeploy in AS-5.1.0
    Ales Justin Master

     

    "alesj" wrote:

    Actually the whole problem is described in this extra file: myapp.ear/myapp.war/WEB-INF/pages.xml.unknownexttype :-)

    And yes, unfortunately it's a bug. :-(

    Actually thinking about it a bit more.
    It's a semi bug. :-)
    The behavior is as expected, just the configuration is poor.

    Previous filtering has nothing to with the problem.
    It's actually two completely different issues.
    A proper filtering might help there, to solve the problem more easily, but the real issue is in precise/right config.

    The real problem is really in cache usage.
    Metadata checker and synch checker shouldn't share their cache.
    If they do, then a clear separation must be made with proper filtering.

    The problem with not sharing same cache between metadata and synching is in proper validation.
    Only metadata knows when to invalidate it, where as synch just uses it - read/write.

    I'll need to see what can/should be done.

  • 5. Re: Seam applications continuously redeploy in AS-5.1.0
    jaikiran pai Master

     

    "alesj" wrote:

    The behavior is as expected, just the configuration is poor.

    You mean our (=AS) configuration is incorrect, right? :) And not the user application configuration. IMO the end user should not even be concerned about this.



  • 6. Re: Seam applications continuously redeploy in AS-5.1.0
    Ales Justin Master

     

    "jaikiran" wrote:
    "alesj" wrote:

    The behavior is as expected, just the configuration is poor.

    You mean our (=AS) configuration is incorrect, right? :)

    Yes.

    It could be solved with proper configuration.
    Although I think I have the right fix - just coded up atm in Deployers.

    "jaikiran" wrote:

    And not the user application configuration. IMO the end user should not even be concerned about this.

    Definitely.
    Concern is not the right word, it should be oblivious. :-)

  • 7. Re: Seam applications continuously redeploy in AS-5.1.0
    Ales Justin Master

     

    "alesj" wrote:

    Although I think I have the right fix - just coded up atm in Deployers.

    https://jira.jboss.org/jira/browse/JBDEPLOY-192

  • 8. Re: Seam applications continuously redeploy in AS-5.1.0
    Cody Lerum Apprentice

    I've tried building the jboss-deployers-vfs-spi.jar from trunk after the JBDEPLOY-192 was closed and replacing this in the JBOSS_HOME/lib but the issue still exists for me.

    Are their any other files or config settings that need to be updated/replaced?

  • 9. Re: Seam applications continuously redeploy in AS-5.1.0
    Ales Justin Master

     

    "clerum" wrote:
    Are their any other files or config settings that need to be updated/replaced?

    Yes.

    You need to set cacheFilter to MetaDataStructureModificationChecker (MDSMC),
    which does the same filtering as MDSMC's VFS filter instance.
    - http://anonsvn.jboss.org/repos/jbossas/projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/modified/MetaDataStructureModificationChecker.java

    The best way to do this is to replace existing filter instance with the one that extends this:
    - http://anonsvn.jboss.org/repos/jbossas/projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/modified/AbstractPathNameFilter.java
    And of course re-write the logic of previous .xml matching filter.

  • 10. Re: Seam applications continuously redeploy in AS-5.1.0
    Cody Lerum Apprentice

    OK-

    I think that is going to be over my head.

    Is this something that is going to be fixed in the next JBAS 5.x release?

  • 11. Re: Seam applications continuously redeploy in AS-5.1.0
    Cody Lerum Apprentice

    OK-

    I think that is going to be over my head.

    I'll just stick with JBAS 4.2.3GA until a 5.x version is released with this setup correctly by default.

  • 12. Re: Seam applications continuously redeploy in AS-5.1.0
    Ales Justin Master

     

    "clerum" wrote:

    Is this something that is going to be fixed in the next JBAS 5.x release?

    Definitely.

  • 13. Re: Seam applications continuously redeploy in AS-5.1.0
    Ales Justin Master

     

    "clerum" wrote:
    I'll just stick with JBAS 4.2.3GA until a 5.x version is released with this setup correctly by default.

    If you don't need any
    (a) synching - updating some jsp, xhtml, ...
    (b) temping - doing some resources lookup at undeploy
    you can easily get simpler behavior.

    For
    (a) fallback to plain MetaDataStructureModificationChecker instead of Synching one, in profile.xml
    (b) remove SeamStructureModificationMatcher in Seam deployer config



  • 14. Re: Seam applications continuously redeploy in AS-5.1.0
    jaikiran pai Master

     

    "alesj" wrote:

    If you don't need any
    (a) synching - updating some jsp, xhtml, ...

    I think this will be needed since almost all applications will rely on this during development. And based on my understanding updating the jsp should work without the necessity of synching (with temp). Not sure about xhtml.

    "alesj" wrote:

    (b) temping - doing some resources lookup at undeploy
    you can easily get simpler behavior.

    I think most applications will *not* need this because AS-4.x does not support this and people haven't yet raised any issues related to this (except that one related to Seam tutorial) :)

    "alesj" wrote:

    For
    (a) fallback to plain MetaDataStructureModificationChecker instead of Synching one, in profile.xml
    (b) remove SeamStructureModificationMatcher in Seam deployer config


    So here's what clerum can try:

    Edit the following content in JBOSS_HOME/server/< servername>/conf/bootstrap/profile.xml:
    <bean name="DefaultDeploymentRepositoryFactory" class="org.jboss.system.server.profileservice.repository.DefaultDeploymentRepositoryFactory">
     <property name="deploymentFilter"><inject bean="DeploymentFilter" /></property>
     <property name="checker"><inject bean="StructureModificationChecker" /></property>
     </bean>
    

    to
    <bean name="DefaultDeploymentRepositoryFactory" class="org.jboss.system.server.profileservice.repository.DefaultDeploymentRepositoryFactory">
     <property name="deploymentFilter"><inject bean="DeploymentFilter" /></property>
     <property name="checker"><inject bean="MetaDataStructureModificationChecker" /></property>
     </bean>
    


    Edit JBOSS_HOME/server/< serverName>/default/deployers/seam.deployer/META-INF/seam-deployers-jboss-beans.xml to *remove* (or comment out) the following entry:

     <bean name="SeamMTMatcher" class="org.jboss.seam.integration.microcontainer.deployers.SeamTempModificationTypeMatcher"/>
    


    Restart the server and see if the issue is gone.




1 2 Previous Next