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

Maven Java Discussion :

Cargo start-server timeout avec Linux


Sujet :

Maven Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Janvier 2011
    Messages
    41
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2011
    Messages : 41
    Par défaut Cargo start-server timeout avec Linux
    Bonjour, je dois réaliser quelques tests selenium sur l’application finale
    L’application contient notamment, un web server (tomcat 7), un moteur osgi (karaf). Ces 2 applications, doivent tourner ensembles, pour pouvoir effectuer mes tests finaux.
    Pour réaliser les tests, j’ai créé un projet spécial qui:
    - Extrait l’application finale dans “target” (fichier zip)
    - Lance karaf (antrun)
    - Créé un conteneur CARGO en local
    - Lance les tests selenium

    Le build et les tests fonctionnent très bien sous Windows.
    Sous Linux (Ubuntu 11.10), le build reste bloqué à selenium:start-server, pour finalement me donner une erreur de timeout.

    Voici mon pom.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
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    <plugin>
    	<artifactId>maven-antrun-plugin</artifactId>
    	<version>1.6</version>
    	<executions>
    		<execution>
    			<id>prepare-for-test</id>
    			<phase>generate-resources</phase>
    			<configuration>
    				<target>
    					<exec  dir="${project.build.directory}/CARGO/Karaf/bin" executable="xterm" spawn="true" os="Linux">  
    						<arg value="-e"/>
    						<arg value="sh"/>
    						<arg value="-c"/>
    						<arg value="${project.build.directory}/CARGO/Karaf/bin/Karaf"/>
    					</exec>
    					<exec  dir="${project.build.directory}/CARGO/Karaf/bin" executable="cmd" spawn="true" os="Windows">  
    						<arg value="/c"/>
    						<arg value="${project.build.directory}/CARGO/Karaf/bin/Karaf.bat"/>
    					</exec>	
    					<echo message="Starting Karaf monitoring, Wait 2 min ..."/>
    					<sleep seconds="120" />
    				</target>
    			</configuration>
    			<goals>
    				<goal>run</goal>
    			</goals>
    		</execution>
     
    		<execution>
    			<id>kill-karaf</id>
    			<phase>post-integration-test</phase>
    			<configuration>
    				<target >
    					<exec  dir="${project.build.directory}/CARGO/Karaf/bin" executable="xterm" spawn="true" os="Linux">  
    						<arg value="-e"/>
    						<arg value="sh"/>
    						<arg value="-c"/>
    						<arg value="${project.build.directory}/CARGO/Karaf/bin/Karaf"/>
    						<arg value="stop"/>
    					</exec>
    					<exec  dir="${project.build.directory}/CARGO/Karaf/bin" executable="cmd" spawn="true" os="Windows">  
    						<arg value="/c"/>
    						<arg value="${project.build.directory}/CARGO/Karaf/bin/Karaf.bat"/>
    						<arg value="stop"/>
    					</exec>
    				</target>
    			</configuration>
    		</execution>
    	</executions>
    </plugin>
    <plugin>
    	<groupId>org.codehaus.cargo</groupId>
    	<artifactId>cargo-maven2-plugin</artifactId>
    	<configuration>
    		<wait>false</wait>
    		<container>
    			<containerId>tomcat7x</containerId>
    			<home>${project.build.directory}/CARGO/Tomcat7</home>
    			<timeout>1800000</timeout>
    			<output> ${project.build.directory}/tomcat7x/container.log</output>
    			<append>false</append>
    			<log> ${project.build.directory}/tomcat7x/cargo.log</log>
    		</container>
    		<configuration>
    			<type>existing</type>
    			<home>${project.build.directory}/CARGO/Tomcat7</home>
    			<properties>
    				<cargo.java.home>${project.build.directory}/CARGO/java</cargo.java.home>
    				<cargo.jvmargs>-Xmx512M -XX:MaxPermSize=512m</cargo.jvmargs>
    			</properties>
    		</configuration>
    	</configuration>
    	<executions>
    		<execution>
    			<id>start</id>
    			<phase>pre-integration-test</phase>
    			<goals>
    				<goal>start</goal>
    			</goals>
    		</execution>
    		<execution>
    			<id>stop</id>
    			<phase>post-integration-test</phase>
    			<goals>
    				<goal>stop</goal>
    			</goals>
    		</execution>
    	</executions>
    </plugin>
    <plugin>
    	<groupId>org.codehaus.mojo</groupId>
    	<artifactId>selenium-maven-plugin</artifactId>
    	<version>2.1</version>
    	<executions>
    		<execution>
    			<id>server</id>
    			<phase>pre-integration-test</phase>
    			<goals>
    				<goal>start-server</goal>
    			</goals>
    			<configuration>
    				<background>true</background>
    				<singleWindow>true</singleWindow>
    				<logOutput>true</logOutput>
    				<ensureCleanSession>true</ensureCleanSession>
    				<trustAllSSLCertificates>true</trustAllSSLCertificates>
    			</configuration>
    		</execution>
    		<execution>
    			<id>stop</id>
    			<phase>post-integration-test</phase>
    			<goals>
    				<goal>stop-server</goal>
    			</goals>
    		</execution>
    	</executions>
    </plugin>
    <plugin>
    	<groupId>org.apache.maven.plugins</groupId>
    	<artifactId>maven-surefire-plugin</artifactId>
    	<configuration>
    		<excludes>
    			<exclude>**/company/**</exclude>
                    </excludes>
            </configuration>
            <executions>
                    <execution>
                            <id>run-it</id>
                            <phase>integration-test</phase>
                            <goals>
                                    <goal>test</goal>
                            </goals>
                            <configuration>
                                    <systemPropertyVariables>
                                            <rootTesting>${project.build.directory}/CARGO</rootTesting>
                                    </systemPropertyVariables>
                                    <excludes>
                                            <exclude>*</exclude>
                                    </excludes>
                                    <includes>
                                            <include>**/company/**/Test.java</include>
    				</includes>
    			</configuration>
    		</execution>
    	</executions>
    </plugin>
    Voici ce que je me suis résous à faire temporairement pour remplacer cargo (dans le plugin antrun):

    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
    <chmod file="${project.build.directory}/CARGO/Tomcat7/bin/catalina.sh" perm="755" />
    					<chmod file="${project.build.directory}/CARGO/Tomcat7/bin/configtest.sh" perm="755" />
    					<chmod file="${project.build.directory}/CARGO/Tomcat7/bin/digest.sh" perm="755" />
    					<chmod file="${project.build.directory}/CARGO/Tomcat7/bin/setclasspath.sh" perm="755" />
    					<chmod file="${project.build.directory}/CARGO/Tomcat7/bin/shutdown.sh" perm="755" />
    					<chmod file="${project.build.directory}/CARGO/Tomcat7/bin/startup.sh" perm="755" />
    					<chmod file="${project.build.directory}/CARGO/Tomcat7/bin/tool-wrapper.sh" perm="755" />
    					<chmod file="${project.build.directory}/CARGO/Tomcat7/bin/version.sh" perm="755" />
    					<exec  dir="${project.build.directory}/CARGO/Tomcat7/bin" executable="/bin/sh" spawn="true" os="Linux">  
    						 <arg value="${project.build.directory}/CARGO/Tomcat7/bin/startup.sh"/>
    					</exec>
    					<exec  dir="${project.build.directory}/CARGO/Tomcat7/bin" executable="cmd" spawn="true" os="Windows">  
    						<arg value="/c"/>
    						<arg value="${project.build.directory}/CARGO/Karaf/bin/startup.bat"/>
    					</exec>	
    					<echo message="Starting Tomcat Web Server, Waiting 10 min ..."/>
    					<sleep seconds="600" />

    Bien évidemment, je préfère utiliser cargo, qui me permet d’attendre la fin du déploiement de Tomcat, mais aussi d’effectuer un shudown de Tomcat même en cas d’échec du test.
    Je ne pense pas que ce problème soit dû à des paramétrages de permissions d’exécution sous Linux, puisque j’ai essayé en faisant un "chmod –R 777".

    Environnement :
    OS : Ubuntu 11.10 / Kernel Linux 3.0.0-12-generic
    Apache Maven version 3.0.3
    cargo-maven2-plugin version 1.1.4
    Apache Tomcat version 7.0.23

  2. #2
    Membre éclairé
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Janvier 2011
    Messages
    41
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2011
    Messages : 41
    Par défaut
    Problème résolut.
    Il s’agissait d’une erreur extrêmement stupide: cargo utilisait comme JAVA_HOME, une jdk intégrée dans l’application, qui est destinée seulement à Windows. En enlevant la propriété
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <cargo.java.home>${project.build.directory}/CARGO_TOMCAT/java</cargo.java.home>
    , ça marche

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

Discussions similaires

  1. Débuter avec linux Ubuntu Server
    Par a.elbaki dans le forum Linux
    Réponses: 6
    Dernier message: 22/07/2010, 09h04
  2. Réponses: 0
    Dernier message: 11/06/2008, 13h26
  3. Timeout avec un linked server
    Par Wisefool dans le forum MS SQL Server
    Réponses: 3
    Dernier message: 02/09/2005, 15h35
  4. Gérer ce qui se lance avec linux
    Par Harry dans le forum Mandriva / Mageia
    Réponses: 7
    Dernier message: 26/07/2004, 16h05
  5. [SQL Server]Requête avec DateDiff
    Par sangokus dans le forum MS SQL Server
    Réponses: 6
    Dernier message: 10/05/2004, 14h44

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