IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Wildfly/JBoss Java Discussion :

[Débutant] Ordre de déploiement JBoss


Sujet :

Wildfly/JBoss Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2003
    Messages
    67
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2003
    Messages : 67
    Par défaut [Débutant] Ordre de déploiement JBoss
    Bonjour,
    Je suis un gros débutant sur le serveur d'application JBoss et dans JEE en général.
    J'ai un projet dont les différentes fractions sont déployés dans des sar et des ear.
    1 - Est ce possible d'intégrer des SAR dans des EAR si non pourquoi ?
    2 - Je voudrais spécifier l'ordre de déploiement de mes archives, non pas par leur suffixe, car j'ai des sars qui doivent être déployés avant l'EAR et d'autres après cet EAR, mais idéalement par leur suffixe. Est ce possible ?
    Je vous remercie !


  2. #2
    Membre émérite Avatar de XmasRock
    Inscrit en
    Janvier 2007
    Messages
    729
    Détails du profil
    Informations forums :
    Inscription : Janvier 2007
    Messages : 729
    Par défaut
    Regardes la DTD de jboss-app.xml (sous-répertoire : docs/dtd fichier jboss_app.dtd) tu y trouveras sans doute ton bonheur

    Il est préférable de ne pas mettre de SAR (propriétaire JBoss AS) dans un EAR (standard). Tu rend ton appli dépendante du serveur d'appli.

    Tu devrais déployer ton EAR dans un SAR. Comme ça tu n'auras que des SARs et l'organisation seras peut-être plus facile.

    Pour gérer l'ordre de déploiement, tu peux aussi développer toi même la classe à utiliser. Regardes dans le fichier conf/jboss-service.xml :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
     
       <!-- ==================================================================== -->
       <!-- Deployment Scanning                                                  -->
       <!-- ==================================================================== -->
     
       <!-- An mbean for hot deployment/undeployment of archives.
       -->
       <mbean code="org.jboss.deployment.scanner.URLDeploymentScanner"
          name="jboss.deployment:type=DeploymentScanner,flavor=URL">
     
          <!-- Uncomment (and comment/remove version below) to enable usage of the
            DeploymentCache
          <depends optional-attribute-name="Deployer">jboss.deployment:type=DeploymentCache</depends>
          -->
          <depends optional-attribute-name="Deployer">jboss.system:service=MainDeployer</depends>
     
          <!-- The URLComparator can be used to specify a deployment ordering
               for deployments found in a scanned directory.  The class specified
               must be an implementation of java.util.Comparator, it must be able
               to compare two URL objects, and it must have a no-arg constructor.
               Two deployment comparators are shipped with JBoss:
                 - org.jboss.deployment.DeploymentSorter
                   Sorts by file extension, as follows:
                     "sar", "service.xml", "rar", "jar", "war", "wsr", "ear", "zip",
                     "*"
                 - org.jboss.deployment.scanner.PrefixDeploymentSorter
                   If the name portion of the url begins with 1 or more digits, those
                   digits are converted to an int (ignoring leading zeroes), and
                   files are deployed in that order.  Files that do not start with
                   any digits will be deployed first, and they will be sorted by
                   extension as above with DeploymentSorter.
          -->
          <attribute name="URLComparator">org.jboss.deployment.DeploymentSorter</attribute>
          <!--
          <attribute name="URLComparator">org.jboss.deployment.scanner.PrefixDeploymentSorter</attribute>
          -->
     
          <!-- The FilterInstance specifies a URLLister.URLFilter for scanned
               directories. This DeploymentFilter is initialized with the given
               prefixes, suffixes and matches that define which URLs should be
               ignored.
          -->
          <attribute name="FilterInstance"
             attributeClass="org.jboss.deployment.scanner.DeploymentFilter"
             serialDataType="javaBean">
             <!-- Files starting with theses strings are ignored -->
             <property name="prefixes">#,%,\,,.,_$</property>
             <!-- Files ending with theses strings are ignored -->
             <property name="suffixes">#,$,%,~,\,v,.BAK,.bak,.old,.orig,.tmp,.rej,.sh</property>
             <!-- Files matching with theses strings are ignored -->
             <property name="matches">.make.state,.nse_depinfo,CVS,CVS.admin,RCS,RCSLOG,SCCS,TAGS,core,tags</property>
          </attribute>
     
          <!-- Frequency in milliseconds to rescan the URLs for changes -->
          <attribute name="ScanPeriod">5000</attribute>
          <!-- A flag to disable the scans -->
          <attribute name="ScanEnabled">true</attribute>
     
          <!-- URLs are comma separated and resolve relative to the server home URL
             unless the given path is absolute. If the URL ends in "/" it is
             considered a collection and scanned, otherwise it is simply deployed;
             this follows RFC2518 convention and allows discrimination between
             collections and directories that are simply unpacked archives.
     
             URLs may be local (file:) or remote (http:). Scanning is supported
             for remote URLs but unpacked deployment units are not.
     
             Example URLs:
                deploy/
                     scans ${jboss.server.url}/deploy/, which is local or remote
                     depending on the URL used to boot the server
                ${jboss.server.home}/deploy/
                     scans ${jboss.server.home}/deploy, which is always local
                file:/var/opt/myapp.ear
                     deploy myapp.ear from a local location
                file:/var/opt/apps/
                     scans the specified directory
                <a href="http://www.test.com/netboot/myapp.ear" target="_blank">http://www.test.com/netboot/myapp.ear</a>
                     deploys myapp.ear from a remote location
                <a href="http://www.test.com/netboot/apps/" target="_blank">http://www.test.com/netboot/apps/</a>
                     scans the specified WebDAV location
           -->
          <attribute name="URLs">
             deploy/
          </attribute>
     
          <!-- Indicates if the scanner should recursively scan directories that
          contain no "." in their names. This can be used to group applications
          and services that must be deployed and that have the same
          logical function in the same directory i.e.
            deploy/JMX/
            deploy/JMS/
            ...
          -->
          <attribute name="RecursiveSearch">True</attribute>
     
       </mbean>

  3. #3
    Membre confirmé
    Profil pro
    Inscrit en
    Août 2003
    Messages
    67
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2003
    Messages : 67
    Par défaut
    Je te remercie beaucoup XmasRock.
    Ca marche Nickel.
    Tout ce que j'ai fait c'est renommer mes archives à déployer en fonction de l'ordre de leur déploiement. 1_...sar 2_...ear et 3_...sar et j'ai commenté
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <attributename="URLComparator">org.jboss.deployment.DeploymentSorter</attribute>

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. JBoss 5.0.0 RC1 - Ordre de déploiement
    Par Jibee dans le forum Wildfly/JBoss
    Réponses: 1
    Dernier message: 06/08/2008, 09h23
  2. Réponses: 3
    Dernier message: 05/02/2007, 11h51
  3. [Débutant]Ordre des champs dans une table
    Par goony dans le forum Débuter
    Réponses: 4
    Dernier message: 16/02/2006, 12h05
  4. [Débutant] Ordre d'affichage, 2D
    Par YéTeeh dans le forum OpenGL
    Réponses: 4
    Dernier message: 13/06/2005, 19h51
  5. [débutant] Ordre des champs de saisie par la touche tab
    Par almisuifre dans le forum C++Builder
    Réponses: 10
    Dernier message: 03/03/2005, 19h45

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo